Skip to content

Commit

Permalink
uv {lock,sync}: propagate index URLs to registry client
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
BurntSushi committed Jun 3, 2024
1 parent da17828 commit 99f36fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/uv/src/commands/project/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ pub(crate) async fn lock(
warn_user!("`uv lock` is experimental and may change without warning.");
}

dbg!(&index_locations);

// Find the project requirements.
let project = ProjectWorkspace::discover(&std::env::current_dir()?, None).await?;

Expand Down Expand Up @@ -99,6 +101,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();
Expand Down
1 change: 1 addition & 0 deletions crates/uv/src/commands/project/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 99f36fb

Please sign in to comment.