Switch cibuildwheel to the uv build frontend#234
Merged
Conversation
Setting `build-frontend = "build[uv]"` makes cibuildwheel use uv for every virtual environment it provisions, both on the build side (passed to `python -m build` as `--installer=uv`) and when materializing the test environment. Test-dependency installs in the wheel matrix drop from a multi-second pip resolve per ABI to roughly a sub-second uv resolve, which compounds across the seven ABIs and four host platforms.
uv venvs do not ship pip, so the inherited ``"PIP_CONSTRAINT= pip install PyYAML"`` before-test step fails on macOS and Linux with ``pip: command not found``. The workaround (pypa/cibuildwheel#1666) was specific to pip's build isolation propagating ``PIP_CONSTRAINT`` to PyYAML's source build; uv handles build constraints through a different env var (``UV_BUILD_CONSTRAINT``) that is not set here, so the original conflict does not arise and the pre-cache is unnecessary. Drop the workaround and the now-empty Windows override that existed only to neutralize the same hook on cmd.
Member
Author
|
major improvement. just scrolls by now. will apply broadly |
This was referenced May 17, 2026
5 tasks
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What do these changes do?
Set
build-frontend = "build[uv]"in[tool.cibuildwheel]so thatuvprovisions every virtualenvironment cibuildwheel creates, both on the build side (passed
to
python -m buildas--installer=uv) and whenmaterializing the per-ABI test environment. The previous
build-frontend = "build"left every test env doing amulti-second pip resolve of
requirements/test.txtper ABI;uvresolves and installs the same set in roughly a second,which compounds across the seven ABIs and four host platforms in
the wheel matrix.
Also adds
frontendtodocs/spelling_wordlist.txtso thenews fragment passes the docs spell check.
Are there changes in behavior for the user?
No, contributor tooling only.
Related issue number
N/A
Checklist
CONTRIBUTORS.txt: N/A (no such file in this repo)CHANGES/folder (CHANGES/234.contrib.rst)Drafted with Claude Code (Opus 4.7); reviewed by @bdraco.
Agent run details (optional, for reviewers)
Local validation:
```
$ python3 -c "import tomllib; tomllib.load(open('pyproject.toml','rb'))"
$ make doc-spelling
2 pre-existing misspellings only ("subdirectory" in CHANGES/207.contrib.rst, "postfix" in CHANGES.rst); CHANGES/234.contrib.rst is clean after adding "frontend" to the wordlist.
$ SKIP=actionlint-docker pre-commit run --all-files
all hooks pass (actionlint-docker skipped: Docker daemon not running locally; runs in CI).
```
Not verified locally: the actual cibuildwheel + uv interaction
inside the build container; that requires running cibuildwheel
which is impractical without pushing. The live CI run on this
branch is the verification. Existing
PIP_CONSTRAINTin[tool.cibuildwheel.environment]is left in place; uv ignoresit (uv reads
UV_CONSTRAINT/UV_BUILD_CONSTRAINT), and ifthe wheel build ends up needing the Cython pin to apply during
uv-driven build dependency resolution, a follow-up can add a
parallel
UV_BUILD_CONSTRAINTentry. Thebefore-testPyYAML pre-cache (
"PIP_CONSTRAINT= pip install PyYAML") wasalso left untouched; it becomes a no-op under uv but is harmless
and removing it is out of scope for this PR.
Independent of and stacks naturally with #233 (ccache wrapping
for the C compile); the two PRs touch different cibuildwheel
config sections and different workflow steps.