Switch cibuildwheel to the uv build frontend#1699
Merged
Merged
Conversation
Set build-frontend = "build[uv]" in [tool.cibuildwheel] so uv provisions every virtual environment cibuildwheel creates, both on the build side (passed to python -m build as --installer=uv) and when materializing the per-ABI test environment. The previous build-frontend = "build" left every test env doing a multi-second pip resolve of requirements/test-cibuildwheel.txt per ABI; uv resolves and installs the same set in roughly a second, which compounds across the wheel matrix. Adds extras: uv to the pypa/cibuildwheel action invocation so the uv binary is bundled with cibuildwheel on the macOS and Windows runners; on Linux the manylinux/musllinux containers already ship uv. Drops the now-unneeded PyYAML pre-cache before-test hook and the empty [tool.cibuildwheel.windows] override that paired with it. Also adds frontend to docs/spelling_wordlist.txt so the news fragment passes the docs spell check.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1699 +/- ##
=======================================
Coverage 99.80% 99.80%
=======================================
Files 21 21
Lines 4152 4167 +15
Branches 243 244 +1
=======================================
+ Hits 4144 4159 +15
Misses 5 5
Partials 3 3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4 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 that
uvprovisions every virtual environment cibuildwheelcreates, both on the build side (passed to
python -m buildas
--installer=uv) and when materializing the per-ABI testenvironment. The previous
build-frontend = "build"leftevery test env doing a multi-second pip resolve of
requirements/test-cibuildwheel.txtper ABI;uvresolvesand installs the same set in roughly a second, which compounds
across the wheel matrix.
Passes
extras: uvto thepypa/cibuildwheelaction so theuvbinary is bundled with cibuildwheel on the macOS andWindows runners; on Linux the manylinux/musllinux containers
already ship
uv. Drops the now-unneeded PyYAML pre-cachebefore-testhook and the empty[tool.cibuildwheel.windows]override that paired with it. Also adds
frontendtodocs/spelling_wordlist.txtso the news fragment passes thedocs spell check.
Are there changes in behavior for the user?
No, contributor tooling only.
Is it a substantial burden for the maintainers to support this?
No, it removes config rather than adding it; the wheel matrix on
this PR is the verification path.
Related issue number
N/A
Checklist
CONTRIBUTORS.txt: N/A (no such file in this repo)CHANGES/folder (CHANGES/1699.contrib.rst; rename if the PR lands at a different number)Drafted with Claude Code (Opus 4.7); reviewed by @bdraco.
Agent run details (optional, for reviewers)
Local validation:
```
$ make doc-spelling
7 pre-existing misspellings only (
quoter,subdirectory,Deprecations,recode,unobviousinCHANGES.rstandCHANGES/README.rst);CHANGES/1699.contrib.rstis clean after addingfrontendto the wordlist.```
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_CONSTRAINT = "requirements/cython.txt"under[tool.cibuildwheel.environment]is left in place;uvignores it (
uvreadsUV_CONSTRAINT/UV_BUILD_CONSTRAINT). If the wheel build ends up needingthe Cython pin to apply during
uv-driven build dependencyresolution, a follow-up can add a parallel
UV_BUILD_CONSTRAINTentry.This change mirrors the propcache change in
aio-libs/propcache#234.