-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Discard markers on editable requirements #3622
Conversation
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 file contained some regression tests for whitespace behavior in the parser
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.
I’m pretty sure those exist in a separate file. This was just a duplicate of another test file, no?
To me, pypa/pip#8581 (comment) makes it look like this is a bug in pip, could we check back with the pip devs on this? |
I don’t think it’s a bug. I think it’s an intentional limitation right now because it’s not covered by any standard. For that reason I’m also somewhat hesitant to support it… It also means that files that work with uv won’t work with pip. |
c59804d
to
06f0d0f
Compare
Ok, I decided to change the behavior to continue to allow spaces between extras in editables (i.e., we continue to support |
d52d5d9
to
7ef21a9
Compare
cd8f63b
to
a937154
Compare
a937154
to
2745530
Compare
## Summary As a follow-up to #3622, we now parse and store (but don't respect) markers on editable requirements.
Summary
If a user includes markers after an editable, we now ignore them (rather than including them in the parsed URL). This matches pip's behavior. In the future, we could further improve by respecting them, but that would be a deviation from pip.
For example, given:
We now split at the first whitespace (just before the
;
), parse everything before, and throw out everything after.This logic also extends to extras. So given:
We'll now parse this as the URL
./scripts/packages/black_editable[dev,
, and throw outcolorama]
. Instead, you need to do:(I.e., remove the space.)
This also matches pip's behavior. I could "fix" this but I'm unsure if I should -- it means requirements files will be parseable by uv that won't work with pip. Open to input. My gut reaction is that we should properly support
-e ./scripts/packages/black_editable[dev, colorama]
even if pip would reject it, butrequirements.txt
is implementation-defined so it'd be a "deviation".Closes #3604.