Respect named --index and --default-index values in tool.uv.sources (#7910)

## Summary

If you pass a named index via the CLI, you can now reference it as a
named source. This required some surprisingly large refactors, since we
now need to be able to track whether a given index was provided on the
CLI vs. elsewhere (since, e.g., we don't want users to be able to
reference named indexes defined in global configuration).

Closes https://github.com/astral-sh/uv/issues/7899.
This commit is contained in:
Charlie Marsh 2024-10-15 16:56:24 -07:00 committed by GitHub
parent a034a8b83b
commit 2153c6ac0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 370 additions and 133 deletions

View file

@ -156,7 +156,7 @@ impl<'a> BuildContext for BuildDispatch<'a> {
self.sources
}
fn index_locations(&self) -> &IndexLocations {
fn locations(&self) -> &IndexLocations {
self.index_locations
}
@ -350,6 +350,7 @@ impl<'a> BuildContext for BuildDispatch<'a> {
self,
self.source_build_context.clone(),
version_id,
self.index_locations,
sources,
self.config_settings.clone(),
self.build_isolation,