uv/docs/configuration
Charlie Marsh 9a76e47888
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.
2024-10-15 22:58:15 +00:00
..
authentication.md Add support for `--trusted-host` (#6591) 2024-08-27 09:36:50 -04:00
environment.md Add support for named and explicit indexes (#7481) 2024-10-15 18:24:23 -04:00
files.md docs(configuration): clarify `uv.toml` precedence (#6986) 2024-09-04 15:57:41 +00:00
index.md Add support for named and explicit indexes (#7481) 2024-10-15 18:24:23 -04:00
indexes.md Allow multiple pinned indexes in `tool.uv.sources` (#7769) 2024-10-15 22:58:15 +00:00