From 43bf002e503750e721353124b890981637289da0 Mon Sep 17 00:00:00 2001 From: Roman Bredehoft Date: Wed, 7 Feb 2024 17:10:53 +0100 Subject: [PATCH] chore: upgrade poetry to 1.7.1 and fix associated syntax error --- .github/workflows/prepare_release.yaml | 2 +- .github/workflows/update_licenses.yaml | 2 +- .github/workflows/weekly-pip-audit.yaml | 2 +- Makefile | 8 +++++++- script/make_utils/setup_os_deps.sh | 4 ++-- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/prepare_release.yaml b/.github/workflows/prepare_release.yaml index 54708f03e..4d6c82a69 100644 --- a/.github/workflows/prepare_release.yaml +++ b/.github/workflows/prepare_release.yaml @@ -59,7 +59,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install poetry==1.2.2 + python -m pip install poetry==1.7.1 make setup_env # Make sure that the workflow has been triggered from a release branch if this is a patch diff --git a/.github/workflows/update_licenses.yaml b/.github/workflows/update_licenses.yaml index 800f3a6e6..52c09bce4 100644 --- a/.github/workflows/update_licenses.yaml +++ b/.github/workflows/update_licenses.yaml @@ -46,7 +46,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install poetry==1.2.2 + python -m pip install poetry==1.7.1 make setup_env - name: Update licenses diff --git a/.github/workflows/weekly-pip-audit.yaml b/.github/workflows/weekly-pip-audit.yaml index 4016b1b1d..a5636e3a3 100644 --- a/.github/workflows/weekly-pip-audit.yaml +++ b/.github/workflows/weekly-pip-audit.yaml @@ -62,7 +62,7 @@ jobs: which pip3 python -m pip install --upgrade pip - python -m pip install poetry + python -m pip install poetry==1.7.1 make setup_env - name: Run pip-audit diff --git a/Makefile b/Makefile index 8abee1a99..7b1d1f9b7 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ CONCRETE_PACKAGE_PATH=$(SRC_DIR)/concrete COUNT?=1 RANDOMLY_SEED?=$$RANDOM PYTEST_OPTIONS:= -POETRY_VERSION:=1.2.2 +POETRY_VERSION:=1.7.1 APIDOCS_OUTPUT?="./docs/developer-guide/api" OPEN_PR="true" @@ -27,6 +27,10 @@ CONCRETE_PYTHON_VERSION="concrete-python==2.5.0" # --pyproject-toml-file pyproject.toml \ # --get-pip-install-spec-for-dependency concrete-python)" +# At the end of the command, we currently need to force an 'import skorch' in Python in order to +# avoid an obscure bug that led to all pytest commands to fail when installing dependencies with +# Poetry >= 1.3. It is however not very clear how this import fixes the issue, as the bug was +# difficult to understand and reproduce, so the line might become obsolete in the future. .PHONY: setup_env # Set up the environment setup_env: @# The keyring install is to allow pip to fetch credentials for our internal repo if needed @@ -53,6 +57,8 @@ setup_env: poetry run python -m pip install -U --pre "$(CONCRETE_PYTHON_VERSION)" "$(MAKE)" fix_omp_issues_for_intel_mac + poetry run python -c "import skorch" # Details above + .PHONY: sync_env # Synchronise the environment sync_env: if [[ $$(poetry --version) != "Poetry (version $(POETRY_VERSION))" ]];then \ diff --git a/script/make_utils/setup_os_deps.sh b/script/make_utils/setup_os_deps.sh index 808f2cdea..ca22b2efb 100755 --- a/script/make_utils/setup_os_deps.sh +++ b/script/make_utils/setup_os_deps.sh @@ -138,7 +138,7 @@ if [[ "${OS_NAME}" == "Linux" ]]; then wget && \ ${CLEAR_APT_LISTS:+$CLEAR_APT_LISTS} \ python3 -m pip install --no-cache-dir --upgrade pip && \ - python3 -m pip install --no-cache-dir --ignore-installed poetry==1.2.2 && \ + python3 -m pip install --no-cache-dir --ignore-installed poetry==1.7.1 && \ linux_install_gitleaks && linux_install_actionlint && linux_install_github_cli" fi eval "${SETUP_CMD}" @@ -151,7 +151,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.2.2 + python3 -m pip install poetry==1.7.1 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:'