Skip to content

Commit 195493b

Browse files
committed
Pin build requirements versions
... and manage them with dependabot. I've intentionally left the version in project.toml open and then installed it separately with a file used only on our CI (so as not to put artificial barriers on future users trying to install it somewhere we hadn't anticipated). I tried using the argument to `build` `--dependency-constraints-txt`. That's unfortunately too new so didn't work. Setting an environmental variable to `PIP_BUILD_CONSTRAINT` seemed like it might also work, but to me looked a bit more opaque than what I've done here. For Cython 3.2.x we'll need a slightly more complicated requirements file with different versions for Python 3.8.
1 parent cc0a466 commit 195493b

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

.github/dependabot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,20 @@ updates:
4848
- dependency-name: "cibuildwheel"
4949
cooldown:
5050
default-days: 7
51+
52+
# Constraints for build dependencies
53+
- package-ecosystem: "pip"
54+
target-branch: "master"
55+
directory: ".wheel_build_requirements"
56+
schedule:
57+
interval: "monthly"
58+
cooldown:
59+
default-days: 7
60+
61+
- package-ecosystem: "pip"
62+
target-branch: "3.2.x"
63+
directory: ".wheel_build_requirements"
64+
schedule:
65+
interval: "monthly"
66+
cooldown:
67+
default-days: 7
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
setuptools == 82.0.1

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ test-command = [
1919
"cython {project}/Cython/Compiler/Scanning.py",
2020
"cython {project}/Cython/Compiler/Parsing.py",
2121
]
22+
# For cibuildwheel, use strict version constraints to ensure it's as reproducible as possible.
23+
# This means not installing from pyproject.toml but instead using a separate, more constrained file.
24+
# However, keep pyproject.toml build-system.requires open to not artificially constrain users
25+
# who may be trying to install on future versions of Python with unknown setuptools support.
26+
build-frontend = "build; args: --no-isolation"
27+
before-build = "pip install -r .wheel_build_requirements/requirements.txt --no-deps --only-binary :all:"
2228

2329
[tool.cibuildwheel.linux]
2430
archs = ["x86_64", "aarch64", "i686", "armv7l"]

0 commit comments

Comments
 (0)