Properly apply constraints in venv audit (#1956)

## 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.
This commit is contained in:
Charlie Marsh
2024-02-24 16:42:46 -05:00
committed by GitHub
parent db53486308
commit 372cfc00bf
+4
View File
@@ -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;
}