-
Notifications
You must be signed in to change notification settings - Fork 995
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only respect preferences across the same indexes (#9302)
## Summary The issue here is fairly complex. Consider the following: ```toml [project] name = "project" version = "0.1.0" requires-python = ">=3.12.0" dependencies = [] [project.optional-dependencies] cpu = [ "torch>=2.5.1", "torchvision>=0.20.1", ] cu124 = [ "torch>=2.5.1", "torchvision>=0.20.1", ] [tool.uv] conflicts = [ [ { extra = "cpu" }, { extra = "cu124" }, ], ] [tool.uv.sources] torch = [ { index = "pytorch-cpu", extra = "cpu", marker = "platform_system != 'Darwin'" }, ] torchvision = [ { index = "pytorch-cpu", extra = "cpu", marker = "platform_system != 'Darwin'" }, ] [[tool.uv.index]] name = "pytorch-cpu" url = "https://download.pytorch.org/whl/cpu" explicit = true ``` When solving this project, we first pick a PyTorch version from PyPI, to solve the `cu124` extra, selecting `2.5.1`. Later, we try to solve the `cpu` extra. In solving that extra, we look at the PyTorch CPU index. Ideally, we'd select `2.5.1+cpu`... But `2.5.1` is already a preference. So we choose that. Now, we only respect preferences for explicit indexes if they came from the same index. Closes #9295.
- Loading branch information
1 parent
c6482dd
commit 5e48819
Showing
9 changed files
with
129 additions
and
64 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.