Add prototype implementation of wheel variant specification#12203
Add prototype implementation of wheel variant specification#12203charliermarsh wants to merge 2 commits intomainfrom
Conversation
6ca5626 to
f598b60
Compare
|
The But then it seems to succeed. |
|
Ah sorry. I’ll update the instructions. You can either remove that section from the pyproject.toml, then run the build script, then re-add it. Or run cargo build, then point the build script to ./target/debug/uv instead of your global uv. |
|
And the |
I had a feeling about that! |
|
You can run uv venv prior to the cargo run command to create a virtual environment in the current working directory. cargo run will then install into that virtual environment by default. |
|
[[tool.uv.variant]]
backend = "provider_fictional_hw.plugin:build"
requires = ["provider_fictional_hw"]For this configuration I'm curious if this would be end-user facing or would this be package maintainer facing? From my POV I feel like this would be best served at the package maintainer side where a potential PyTorch packaging config might look like: [[tool.uv.variant]]
backend = "torch.build.variants:detect_variants"
requires = ["cuda_variants", "rocm_variants", "xpu_variants", "your_fav_hardware_variants"]fwiw I don't know if requiring people to install variant plugins themselves is necessarily going to be a way to adopt this heavily since this should be something that reduces the friction towards someone installing the correct package for their machine instead of them having to remember which variant plugins they're installing vs. not. |
|
I was thinking it would be declared by the package maintainer, but possibly overridable by the end user (so, like, if they don't care about |
f598b60 to
189dd02
Compare
|
(Applied your changes, thanks @warsawnv.) |
bd7d6d2 to
9146f46
Compare
18dfd1e to
5ac01b8
Compare
5ae7861 to
f168655
Compare
531619a to
3f33934
Compare
0009f18 to
baea3ac
Compare
b389852 to
d53cca9
Compare
5131d07 to
96182b3
Compare
d3df356 to
2918fc7
Compare
b2b513f to
de2d1ed
Compare
dc6757b to
cc81ee9
Compare
cc81ee9 to
81f0ecc
Compare
(Branch taken over by @konstin)
This branch contains the prototype implementation of wheel variants proposal. It support
uv pip installanduv syncfor basic test cases and torch. Included are:It does not implement
abi_dependencyyet, nor does it consider whether features are multi-value or single value.Naturally, it is not ready for any serious usage yet. Expect that things break, please report problems.
release Installing the latest release, potentially a bit behind this branch:
Unix:
Windows:
latest The best way to test is to clone the repo, checkout the branch (charlie/wheel-variant) and run:
If you don’t have Rust installed, there's a bootstrapping process from current uv, though it's slow:
To use a static variant declaration, i.e. not query any providers, you pass a JSON file by settings its path in
UV_VARIANT_LOCK. It assumes that you don't want to run any additional providers with it, i.e. no third party code execution, unless you setUV_VARIANT_LOCK_INCOMPLETE=1. The file format has to follow the schema below: