Skip to content

Commit ed3d982

Browse files
authored
build: move setuptools constraint to where --build-option is used (#247)
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.
1 parent 12a80fa commit ed3d982

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

.github/workflows/external-zstd.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
- uses: actions/checkout@v4
2626

2727
- name: Build
28+
env:
29+
PIP_CONSTRAINT: 'ci/constraints.txt'
2830
run: |
2931
python -m pip install --config-settings=--build-option=--system-zstd .
3032
@@ -50,5 +52,7 @@ jobs:
5052
- uses: actions/checkout@v4
5153

5254
- name: Build
55+
env:
56+
PIP_CONSTRAINT: 'ci/constraints.txt'
5357
run: |
5458
python -m pip install --config-settings=--build-option=--system-zstd .

.github/workflows/sphinx.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
with:
1414
version: "0.4.29"
1515
- name: Run Sphinx
16+
env:
17+
PIP_CONSTRAINT: 'ci/constraints.txt'
1618
run: |
1719
uv venv --python 3.12 venv
1820
source venv/bin/activate

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ jobs:
8080
# TODO enable once PyO3 supports 3.13.
8181
- name: Build (Rust)
8282
if: matrix.arch == 'x64' && matrix.py != '3.13'
83+
env:
84+
PIP_CONSTRAINT: 'ci/constraints.txt'
8385
run: |
8486
python -m pip install --config-settings='--build-option=--rust-backend' -e .
8587

ci/constraints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# 69.0.0 breaks handling of --config-settings=--build-option, which our CI
2+
# relies on. So constrained to an older version until we figure out a
3+
# workaround. See comment at
4+
# https://github.com/pypa/pip/issues/11859#issuecomment-2132287974.
5+
setuptools<69.0.0

pyproject.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ Documentation = "https://python-zstandard.readthedocs.io/en/latest/"
2929
[build-system]
3030
requires = [
3131
"cffi>=1.17.0",
32-
# 69.0.0 breaks handling of --config-settings=--build-option, which our CI
33-
# relies on. So constrained to an older version until we figure out a
34-
# workaround. See comment at
35-
# https://github.com/pypa/pip/issues/11859#issuecomment-2132287974.
36-
"setuptools<69.0.0",
32+
"setuptools",
3733
]
3834
# Need to use legacy backend because setup_zstd.py breaks build isolation.
3935
build-backend = "setuptools.build_meta:__legacy__"

0 commit comments

Comments
 (0)