Skip to content

Commit

Permalink
Skip prefetching when --no-deps is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Mar 12, 2024
1 parent c159a26 commit 08b20dc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/uv-resolver/src/resolver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,12 @@ impl<'a, Provider: ResolverProvider> Resolver<'a, Provider> {
// Run unit propagation.
state.unit_propagation(next)?;

// Pre-visit all candidate packages, to allow metadata to be fetched in parallel.
Self::pre_visit(state.partial_solution.prioritized_packages(), request_sink).await?;
// Pre-visit all candidate packages, to allow metadata to be fetched in parallel. If
// the dependency mode is direct, we only need to visit the root package.
if self.dependency_mode.is_transitive() {
Self::pre_visit(state.partial_solution.prioritized_packages(), &request_sink)
.await?;
}

// Choose a package version.
let Some(highest_priority_pkg) =
Expand Down

0 comments on commit 08b20dc

Please sign in to comment.