Don't constrain build-system.requires
with our dependency-versions
#2583
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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)