Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: py3.12 install deps #950

Merged
merged 11 commits into from
Dec 6, 2024
18 changes: 9 additions & 9 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ on:
default: "3.8"

manual_call:
description: "Do not uncheck this"
description: "Do not uncheck this!"
type: boolean
required: false
default: true
Expand Down Expand Up @@ -99,7 +99,7 @@ env:
jobs:
commit-checks:
name: Commit Checks
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
outputs:
commits_ok: ${{ steps.commit-conformance.outcome == 'success' }}
steps:
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
needs: [commit-checks]
# We skip the CI in cases of pushing to internal main (because all pushes to main internal are now from the bot)
if: ${{ !( github.repository != 'zama-ai/concrete-ml' && github.event_name == 'push' && github.ref == 'refs/heads/main' ) }}
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
timeout-minutes: 5
outputs:
linux-matrix: ${{ steps.set-matrix.outputs.linux-matrix }}
Expand Down Expand Up @@ -295,7 +295,7 @@ jobs:
start-runner-linux:
needs: [commit-checks, matrix-preparation]
name: Start EC2 runner (Linux)
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
timeout-minutes: 15
outputs:
label-38: ${{ steps.start-ec2-runner-38.outputs.label }}
Expand Down Expand Up @@ -1025,7 +1025,7 @@ jobs:
linux-build-status:
name: Build Status (Linux)
needs: [build-linux]
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
timeout-minutes: 2
if: success() || failure()
steps:
Expand All @@ -1045,7 +1045,7 @@ jobs:
stop-runner-linux:
name: Stop EC2 runner (Linux)
needs: [build-linux, start-runner-linux]
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
timeout-minutes: 2
if: ${{ always() && (needs.start-runner-linux.result != 'skipped') }}
steps:
Expand Down Expand Up @@ -1186,7 +1186,7 @@ jobs:

decide-slack-report:
name: Decide Slack report
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
outputs:
send_slack_report: ${{ steps.set-decision.outputs.send_slack_report }}
steps:
Expand All @@ -1211,7 +1211,7 @@ jobs:
# if the job should be run or not in an previous job and store it in its output
slack-report:
name: Slack report
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
if: |
always()
&& needs.matrix-preparation.result != 'skipped'
Expand Down Expand Up @@ -1310,7 +1310,7 @@ jobs:

stop-ec2-failure-slack-alert:
name: Stop EC2 failure Slack alert
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
if: |
always()
&& needs.matrix-preparation.result != 'skipped'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prepare_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry==1.7.1
python -m pip install poetry==1.8.4
make setup_env

# Make sure that the workflow has been triggered from a release branch if this is a patch
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_licenses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry==1.7.1
python -m pip install poetry==1.8.4
make setup_env

- name: Update licenses
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/weekly-pip-audit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
which pip3

python -m pip install --upgrade pip
python -m pip install poetry==1.7.1
python -m pip install poetry==1.8.4
make setup_env

- name: Run pip-audit
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CONCRETE_PACKAGE_PATH=$(SRC_DIR)/concrete
COUNT?=1
RANDOMLY_SEED?=$$RANDOM
PYTEST_OPTIONS:=
POETRY_VERSION:=1.7.1
POETRY_VERSION:=1.8.4
APIDOCS_OUTPUT?="./docs/references/api"
OPEN_PR="true"

Expand Down
29 changes: 25 additions & 4 deletions script/make_utils/setup_os_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,25 @@ linux_install_github_cli () {
${SUDO_BIN:+$SUDO_BIN} dpkg -i /home/dev_user/gh_${GH_CLI_VERSION}_linux_amd64.deb
}

linux_install_cmake () {
${SUDO_BIN:+$SUDO_BIN} apt-get update
${SUDO_BIN:+$SUDO_BIN} apt-get -y install ca-certificates gpg wget
test -f /usr/share/doc/kitware-archive-keyring/copyright ||
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | \
gpg --dearmor - | \
${SUDO_BIN:+$SUDO_BIN} tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | \
${SUDO_BIN:+$SUDO_BIN} tee /etc/apt/sources.list.d/kitware.list >/dev/null
${SUDO_BIN:+$SUDO_BIN} apt-get update
test -f /usr/share/doc/kitware-archive-keyring/copyright || \
${SUDO_BIN:+$SUDO_BIN} rm /usr/share/keyrings/kitware-archive-keyring.gpg
${SUDO_BIN:+$SUDO_BIN} apt-get install -y kitware-archive-keyring
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal-rc main' | \
${SUDO_BIN:+$SUDO_BIN} tee -a /etc/apt/sources.list.d/kitware.list >/dev/null
${SUDO_BIN:+$SUDO_BIN} apt-get update
${SUDO_BIN:+$SUDO_BIN} apt-get -y install cmake
}

OS_NAME=$(uname)

if [[ "${OS_NAME}" == "Linux" ]]; then
Expand Down Expand Up @@ -126,26 +145,28 @@ if [[ "${OS_NAME}" == "Linux" ]]; then
jq \
make \
rsync \
cmake \
unzip \
pandoc \
openssl \
shellcheck \
libssl-dev \
texlive-latex-base texlive-latex-extra texlive-fonts-recommended texlive-xetex lmodern \
wget pipx &&
${CLEAR_APT_LISTS:+$CLEAR_APT_LISTS} \
linux_install_gitleaks && \
linux_install_actionlint && \
linux_install_github_cli"
linux_install_github_cli && \
linux_install_cmake"
fi
eval "${SETUP_CMD}"


# Install poetry, either with pipx for ubuntu >= 23
# or through regular pip for older ubuntu
(pipx install poetry && pipx ensurepath) || \
(\
python3 -m pip install --no-cache-dir --upgrade pip && \
python3 -m pip install --no-cache-dir --ignore-installed poetry==1.7.1 \
python3 -m pip install --no-cache-dir --ignore-installed poetry==1.8.4 \
);
echo "PATH=$PATH:/home/dev_user/.local/bin/" >> ~/.bashrc
elif [[ "${OS_NAME}" == "Darwin" ]]; then
Expand All @@ -157,7 +178,7 @@ elif [[ "${OS_NAME}" == "Darwin" ]]; then

brew install curl git git-lfs gitleaks graphviz jq make pandoc shellcheck openssl libomp actionlint unzip gh rsync
python3 -m pip install -U pip
python3 -m pip install poetry==1.7.1
python3 -m pip install poetry==1.8.4

echo "Make is currently installed as gmake"
echo 'If you need to use it as "make", you can add a "gnubin" directory to your PATH from your bashrc like:'
Expand Down
2 changes: 1 addition & 1 deletion src/concrete/ml/sklearn/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1591,7 +1591,7 @@ def get_sklearn_params(self, deep: bool = True) -> dict:

params.pop("n_bits", None)
if "1.1." in sklearn.__version__:
params.pop("monotonic_cst", None)
params.pop("monotonic_cst", None) # pragma: no cover

return params

Expand Down
2 changes: 1 addition & 1 deletion src/concrete/ml/sklearn/glm.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def get_sklearn_params(self, deep: bool = True) -> dict:
params.pop("n_bits", None)
# Remove sklearn 1.4 parameter when using sklearn 1.1
if "1.1." in sklearn.__version__:
params.pop("solver", None)
params.pop("solver", None) # pragma: no cover

return params

Expand Down
1 change: 0 additions & 1 deletion tests/torch/test_compile_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,6 @@ def test_pretrained_mnist_qat(
quantized_numpy_module = compile_onnx_model(
onnx_model,
inputset,
import_qat=True,
jfrery marked this conversation as resolved.
Show resolved Hide resolved
configuration=default_configuration,
n_bits=n_bits,
verbose=verbose,
Expand Down
Loading