Skip to content

Commit

Permalink
Skip version iteration for non-base packages (astral-sh#4167)
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh authored Jun 8, 2024
1 parent ab0f8af commit 8ae5c2a
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions crates/uv-resolver/src/resolution/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ impl ResolutionGraph {
let mut diagnostics = Vec::new();

for (package, versions) in &resolution.packages {
for version in versions {
match &**package {
PubGrubPackageInner::Package {
name,
extra,
dev,
marker: None,
url: None,
} => {
match &**package {
PubGrubPackageInner::Package {
name,
extra,
dev,
marker: None,
url: None,
} => {
for version in versions {
// Create the distribution.
let dist = resolution
.pins
Expand Down Expand Up @@ -200,14 +200,16 @@ impl ResolutionGraph {
});
inverse.insert((name, version, extra.as_ref(), dev.as_ref()), index);
}
}

PubGrubPackageInner::Package {
name,
extra,
dev,
marker: None,
url: Some(url),
} => {
PubGrubPackageInner::Package {
name,
extra,
dev,
marker: None,
url: Some(url),
} => {
for version in versions {
// Create the distribution.
let dist = Dist::from_url(name.clone(), url_to_precise(url.clone(), git))?;

Expand Down Expand Up @@ -290,10 +292,10 @@ impl ResolutionGraph {
});
inverse.insert((name, version, extra.as_ref(), dev.as_ref()), index);
}
}

_ => {}
};
}
_ => {}
};
}

// Add every edge to the graph.
Expand Down

0 comments on commit 8ae5c2a

Please sign in to comment.