Avoid enforcing extra-only constraints#4570
Conversation
| @@ -1,3 +0,0 @@ | |||
| --index-url file:///Users/crmarsh/workspace/packse/index/simple-html/ | |||
|
|
|||
| example-a-961b4c22 | |||
There was a problem hiding this comment.
Sorry, I must've checked this in at some point accidentally.
| return false; | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
This is almost the same as above but not quite (the filtering on extras is different), just as it was prior to the refactor (intentionally so).
| .into_iter() | ||
| .flatten(), | ||
| ) | ||
| }) |
There was a problem hiding this comment.
The key is that we shouldn't apply the constraints here; we only apply them after we've filtered requirements.
|
Link to the problematic change: https://github.com/astral-sh/uv/pull/4430/files#diff-6be6d80fe4821c47b70a372260f55e73b8da8182b8dcad7525d5cd3eb584532bR1285 Compared to before, when we only applied constraints after filtering requirements: https://github.com/astral-sh/uv/pull/4430/files#diff-628347083e870ac5a60372227e35df821298fa35b830ae22517ad2ea7ad1c459L200 |
zanieb
left a comment
There was a problem hiding this comment.
Thanks for pulling up the additional context for me!
Summary
In the dependency refactor (#4430), the logic for requirements and constraints was combined. Specifically, we were applying constraints before filtering on markers and extras, and then applying that same filtering to the constraints. As a result, constraints that should only be activated when an extra is enabled were being enabled unconditionally.
Closes #4569.