-
Notifications
You must be signed in to change notification settings - Fork 760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I must've checked this in at some point accidentally.
return false; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.