-
Notifications
You must be signed in to change notification settings - Fork 283
Don't constrain build-system.requires
with our dependency-versions
#2583
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests are asserting on the version of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Seems reasonable to me from an iOS perspective, and I can't fault the general logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for Pyodide
I decided not to pin the version of pip inside the build venv. It was not as easy as setting VIRTUALENV_PIP (this doesn't appear to do anything, fwiw, I think that pip/build uses |
Fix #2570.
Don't constrain the versions installed during the package build using
dependency-versions
. See #2570 for full discussion. AI summary of the change belowThis change stops cibuildwheel's dependency-versions from being applied as constraints within the isolated build environment used for the package build. This resolves an issue where conflicts between cibuildwheel's internal requirements and a project's build-system.requires would cause cryptic build failures.
The Problem
Currently, on macOS, Windows, and Pyodide platforms, cibuildwheel injects its own dependency constraints (from CIBW_DEPENDENCY_VERSIONS or the defaults) into the isolated environment where a project's build-time dependencies are installed.
This leads to an issue: if a project specifies a build requirement in pyproject.toml (e.g., conan) that has a dependency conflict with cibuildwheel's constraints (e.g., on urllib3), the build fails with an unhelpful subprocess.CalledProcessError traceback.
This behaviour is also inconsistent, as it does not occur on Linux, which invokes the build without injecting these internal constraints.
The Solution
Remove the logic that sets the PIP_CONSTRAINT and UV_CONSTRAINT environment variables on the build_env before invoking the build frontend (
pip wheel
orbuild
).The effect is:
The user's project's build-time dependencies are now resolved independently, without interference from cibuildwheel's toolchain constraints.
The build process behaviour is now the same across all platforms (Linux, macOS, Windows, and Pyodide)