From fbf562d5a86a58d857ed31545f3faed9ed837da7 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Mon, 3 Jun 2024 10:38:36 -0400 Subject: [PATCH] uv {lock,sync}: propagate index URLs to registry client (#3986) Otherwise the `uv lock` command wasn't respecting the index URL option. This is a follow-up to #3984, and I believe should now allow #3970 to be merged. --- crates/uv/src/commands/project/lock.rs | 1 + crates/uv/src/commands/project/mod.rs | 1 + crates/uv/src/commands/project/sync.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/crates/uv/src/commands/project/lock.rs b/crates/uv/src/commands/project/lock.rs index 1e3f0348e..1f364d5b8 100644 --- a/crates/uv/src/commands/project/lock.rs +++ b/crates/uv/src/commands/project/lock.rs @@ -99,6 +99,7 @@ pub(super) async fn do_lock( // Initialize the registry client. // TODO(zanieb): Support client options e.g. offline, tls, etc. let client = RegistryClientBuilder::new(cache.clone()) + .index_urls(index_locations.index_urls()) .markers(markers) .platform(venv.interpreter().platform()) .build(); diff --git a/crates/uv/src/commands/project/mod.rs b/crates/uv/src/commands/project/mod.rs index 938cc0b2c..9d89b45b3 100644 --- a/crates/uv/src/commands/project/mod.rs +++ b/crates/uv/src/commands/project/mod.rs @@ -157,6 +157,7 @@ pub(crate) async fn update_environment( // TODO(zanieb): Support client options e.g. offline, tls, etc. let client = RegistryClientBuilder::new(cache.clone()) .connectivity(connectivity) + .index_urls(index_locations.index_urls()) .markers(markers) .platform(venv.interpreter().platform()) .build(); diff --git a/crates/uv/src/commands/project/sync.rs b/crates/uv/src/commands/project/sync.rs index 8eb1e5b61..06c82e1ce 100644 --- a/crates/uv/src/commands/project/sync.rs +++ b/crates/uv/src/commands/project/sync.rs @@ -90,6 +90,7 @@ pub(super) async fn do_sync( // Initialize the registry client. // TODO(zanieb): Support client options e.g. offline, tls, etc. let client = RegistryClientBuilder::new(cache.clone()) + .index_urls(index_locations.index_urls()) .markers(markers) .platform(venv.interpreter().platform()) .build();