Skip to content

Conversation

@henryiii
Copy link
Contributor

@henryiii henryiii commented Mar 17, 2025

Adding an option to build directly with uv. Will conflict with #2321, so probably will rebase after that one.

@jake-arkinstall
Copy link

jake-arkinstall commented Apr 3, 2025

I have a question on this.

UV supports workspaces, and a 'uv build' of a workspace may result in more than one wheel. I currently have a project which builds ~10 wheels per target platform, and I'd love to be able to do this with a single invocation of CIBuildWheel. Is that something that could be made possible (or something that is already possible)?

The reason I'm asking is that I haven't been able to get build[uv] to be able to work with uv workspace projects, but invoking uv directly could make that possible.

@henryiii
Copy link
Contributor Author

henryiii commented Apr 3, 2025

That's interesting, probably! We might/will need to handle pure-Python output wheels, but other than that I think it should work. Nice to know this will enable something (especially since it's been annoying to make work due to astral-sh/uv#12639). I'll try to test that.

@henryiii henryiii force-pushed the henryiii/feat/uvbuild branch 2 times, most recently from 4a64a67 to eb53a73 Compare April 9, 2025 14:29
@henryiii
Copy link
Contributor Author

I'm happy to push this off to 3.1 for now in interests of getting a 3.0 out. This is just a new option, not a change.

@joerick joerick added the Hold for future release This PR might be complete, but is scheduled to be merged in a future release. Don't merge yet. label May 29, 2025
@joerick joerick removed the Hold for future release This PR might be complete, but is scheduled to be merged in a future release. Don't merge yet. label Jun 11, 2025
@henryiii henryiii force-pushed the henryiii/feat/uvbuild branch from eb53a73 to 11de286 Compare August 19, 2025 14:43
@henryiii henryiii force-pushed the henryiii/feat/uvbuild branch from d88de26 to 75fdded Compare September 10, 2025 14:11
@henryiii henryiii force-pushed the henryiii/feat/uvbuild branch from 75fdded to 244b654 Compare November 11, 2025 16:26
@henryiii henryiii force-pushed the henryiii/feat/uvbuild branch from c5f6934 to 75f2394 Compare January 5, 2026 16:23
@agriyakhetarpal agriyakhetarpal linked an issue Jan 28, 2026 that may be closed by this pull request
henryiii and others added 3 commits January 28, 2026 12:14
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

tests: add uv to tests

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

fix: uv doesn't pick special Pythons at the top of the path

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

fix: set uv build constraints too

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

fix: uv doesn't support PyPy 3.8

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

tests: add pyproject.toml for failing test

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

Revert "tests: add pyproject.toml for failing test"

This reverts commit 619bde3.

tests: skip uv output test

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
@henryiii henryiii force-pushed the henryiii/feat/uvbuild branch from 75f2394 to bed8622 Compare January 28, 2026 17:15
@trim21
Copy link
Contributor

trim21 commented Jan 29, 2026

Looks like now we get all naitve building works, the only failing tests are cross-build for iOS and Android.

I'm not sure how python or uv works on these platforms, I'll take a look on Android because I don't have a macos machine.

@trim21
Copy link
Contributor

trim21 commented Jan 29, 2026

Nevermind, uv can't do corss build, we should skip using uv on Android or iOS just like what we did for pip

astral-sh/uv#7957

@trim21
Copy link
Contributor

trim21 commented Jan 29, 2026

you forget to enable test_failed_build_with_so_files for uv, it's still skipped

@trim21
Copy link
Contributor

trim21 commented Jan 29, 2026

tested this locally, musllinux docker image doesn't have uv installed

@henryiii
Copy link
Contributor Author

uv is on musllinux, at least for common archs: https://manylinuxinspector.joerick.me/#/

This predates the update to Android, so not surprising that it wasn't skipped here. :)

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for selecting uv directly as the build frontend (in addition to existing build, build[uv], and pip) and updates validation + tests accordingly.

Changes:

  • Extend BuildFrontendName and config/schema parsing to accept uv.
  • Implement uv build invocation paths across platforms (Linux/macOS/Windows) and update troubleshooting detection.
  • Expand test matrix/fixtures and add config parsing coverage for build-frontend = "uv".

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
unit_test/options_test.py Adds unit test coverage for parsing build-frontend = "uv".
test/test_android.py Expands Android negative frontend test to include uv.
test/conftest.py Adds uv to build-frontend fixture params and adjusts skips for unsupported platforms.
cibuildwheel/platforms/windows.py Treats uv as a build frontend and adds a uv build execution path.
cibuildwheel/platforms/macos.py Treats uv as a build frontend; installs needed tools and adds uv build path.
cibuildwheel/platforms/linux.py Adds uv build execution path in containers and updates troubleshoot matching.
cibuildwheel/platforms/ios.py Explicitly rejects uv frontend on iOS (matching existing uv limitations).
cibuildwheel/frontend.py Extends BuildFrontendName literal to include uv.
bin/generate_schema.py Updates JSON schema generation to document/validate uv as a build frontend.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
@trim21
Copy link
Contributor

trim21 commented Jan 30, 2026

looks like the ci is failed on a network error, not our code

Do we still missing something in this PR? Except uv workspace support. I think it need a seprated pr to support multiple wheels output in single build

@henryiii
Copy link
Contributor Author

Yes, workspace support can be a followup PR, and I also would like to see if we can support uv for android; I don't see why build[uv] would work but not uv, but for this PR to move forward I just skipped the test instead of removing the conditional check. But I'd like to try that.

@henryiii henryiii marked this pull request as ready for review January 30, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

use uv as build-frontend directly?

4 participants