From 2059a7f112e482b758ae9bb1fdd032ae1aa450b4 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Fri, 20 Dec 2024 12:34:17 +0900 Subject: [PATCH] Move setuptools constraint to where --build-option is used Instead of restricting the version of setuptools used to build zstandard in every case, only limit it where necessary. This allows to pick setuptools fixes, like proper detection of newer versions of MSVC. --- .github/workflows/external-zstd.yml | 4 ++++ .github/workflows/sphinx.yml | 2 ++ .github/workflows/test.yml | 2 ++ ci/constraints.txt | 5 +++++ pyproject.toml | 6 +----- 5 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 ci/constraints.txt diff --git a/.github/workflows/external-zstd.yml b/.github/workflows/external-zstd.yml index 1894ae5d..fb069aee 100644 --- a/.github/workflows/external-zstd.yml +++ b/.github/workflows/external-zstd.yml @@ -25,6 +25,8 @@ jobs: - uses: actions/checkout@v4 - name: Build + env: + PIP_CONSTRAINT: 'ci/constraints.txt' run: | python -m pip install --config-settings=--build-option=--system-zstd . @@ -50,5 +52,7 @@ jobs: - uses: actions/checkout@v4 - name: Build + env: + PIP_CONSTRAINT: 'ci/constraints.txt' run: | python -m pip install --config-settings=--build-option=--system-zstd . diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml index 3d71b029..d6ae608d 100644 --- a/.github/workflows/sphinx.yml +++ b/.github/workflows/sphinx.yml @@ -13,6 +13,8 @@ jobs: with: version: "0.4.29" - name: Run Sphinx + env: + PIP_CONSTRAINT: 'ci/constraints.txt' run: | uv venv --python 3.12 venv source venv/bin/activate diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9dc2ba8f..73de905d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -80,6 +80,8 @@ jobs: # TODO enable once PyO3 supports 3.13. - name: Build (Rust) if: matrix.arch == 'x64' && matrix.py != '3.13' + env: + PIP_CONSTRAINT: 'ci/constraints.txt' run: | python -m pip install --config-settings='--build-option=--rust-backend' -e . diff --git a/ci/constraints.txt b/ci/constraints.txt new file mode 100644 index 00000000..37a50d6c --- /dev/null +++ b/ci/constraints.txt @@ -0,0 +1,5 @@ +# 69.0.0 breaks handling of --config-settings=--build-option, which our CI +# relies on. So constrained to an older version until we figure out a +# workaround. See comment at +# https://github.com/pypa/pip/issues/11859#issuecomment-2132287974. +setuptools<69.0.0 diff --git a/pyproject.toml b/pyproject.toml index b27ac67d..9d0e0f01 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,11 +29,7 @@ Documentation = "https://python-zstandard.readthedocs.io/en/latest/" [build-system] requires = [ "cffi>=1.17.0", - # 69.0.0 breaks handling of --config-settings=--build-option, which our CI - # relies on. So constrained to an older version until we figure out a - # workaround. See comment at - # https://github.com/pypa/pip/issues/11859#issuecomment-2132287974. - "setuptools<69.0.0", + "setuptools", ] # Need to use legacy backend because setup_zstd.py breaks build isolation. build-backend = "setuptools.build_meta:__legacy__"