Skip to content

Commit

Permalink
Misc. touch-ups to target-to-resolution routine (#9131)
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh authored Nov 14, 2024
1 parent fe477c3 commit 92735ce
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions crates/uv-resolver/src/lock/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl<'env> InstallTarget<'env> {

let dep_dist = self.lock().find_by_id(&dep.package_id);

// Add the dependency to the graph.
// Add the package to the graph.
let dep_index = match inverse.entry(&dep.package_id) {
Entry::Vacant(entry) => {
let index = petgraph.add_node(self.package_to_node(
Expand Down Expand Up @@ -275,7 +275,7 @@ impl<'env> InstallTarget<'env> {
name: root_name.clone(),
})?;

// Add the workspace package to the graph.
// Add the package to the graph.
let index = match inverse.entry(&dist.id) {
Entry::Vacant(entry) => {
let index = petgraph.add_node(self.package_to_node(
Expand All @@ -293,17 +293,21 @@ impl<'env> InstallTarget<'env> {
}
};

// Add an edge from the root.
// Add the edge.
petgraph.add_edge(
root,
index,
Edge::Dev(group.clone(), dependency.marker.clone()),
);

// Push its dependencies on the queue.
queue.push_back((dist, None));
if seen.insert((&dist.id, None)) {
queue.push_back((dist, None));
}
for extra in &dependency.extras {
queue.push_back((dist, Some(extra)));
if seen.insert((&dist.id, Some(extra))) {
queue.push_back((dist, Some(extra)));
}
}
}
}
Expand Down

0 comments on commit 92735ce

Please sign in to comment.