Skip to content

Commit

Permalink
Properly apply constraints in venv audit (astral-sh#1956)
Browse files Browse the repository at this point in the history
## Summary

We were applying every constraint to every dependency. This is
"harmless" in practice since this is just an optimization, but we thus
had false negatives ~every time which could lead to wasted work.
  • Loading branch information
charliermarsh authored and yasufumy committed Feb 25, 2024
1 parent 201ca4b commit 3fc3610
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/uv-installer/src/site_packages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ impl<'a> SitePackages<'a> {

// Validate that the installed version satisfies the constraints.
for constraint in constraints {
if constraint.name != requirement.name {
continue;
}

if !constraint.evaluate_markers(self.venv.interpreter().markers(), &[]) {
continue;
}
Expand Down

0 comments on commit 3fc3610

Please sign in to comment.