mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-01 09:32:18 +00:00
Allow multiple pinned indexes in tool.uv.sources
(#7769)
## Summary This PR lifts the restriction that a package must come from a single index. For example, you can now do: ```toml [project] name = "project" version = "0.1.0" readme = "README.md" requires-python = ">=3.12" dependencies = ["jinja2"] [tool.uv.sources] jinja2 = [ { index = "torch-cu118", marker = "sys_platform == 'darwin'"}, { index = "torch-cu124", marker = "sys_platform != 'darwin'"}, ] [[tool.uv.index]] name = "torch-cu118" url = "https://download.pytorch.org/whl/cu118" [[tool.uv.index]] name = "torch-cu124" url = "https://download.pytorch.org/whl/cu124" ``` The construction is very similar to the way we handle URLs today: you can have multiple URLs for a given package, but they must appear in disjoint forks. So most of the code is just adding that abstraction to the resolver, following our handling of URLs. Closes #7761.
This commit is contained in:
parent
ad24cee7c6
commit
9a76e47888
14 changed files with 715 additions and 109 deletions
|
@ -34,6 +34,7 @@ mod error;
|
|||
mod exclude_newer;
|
||||
mod exclusions;
|
||||
mod flat_index;
|
||||
mod fork_indexes;
|
||||
mod fork_urls;
|
||||
mod graph_ops;
|
||||
mod lock;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue