-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Restrict unused version pins in URL/VCS requirements? #11567
Comments
Also: I'm happy to submit the patch for this! I just wanted to file it as an issue first, to register interest/awareness. |
+1 on giving an error for anything other than |
Awesome! I'll take a stab at this tomorrow. |
This should help reduce user confusion about what can go in a URI's egg fragment. Fixes pypa#11567. Signed-off-by: William Woodruff <william@trailofbits.com>
#11617 is a first stab at this, but it's revealed some ambiguities in how |
If I remember the history correctly, originally |
What's the problem this feature will solve?
I noticed this behavior while debugging/repro-ing pypa/pip-audit#382:
pip install -r requirements.txt
will happily install a VCS or other URL dependency that contains a fragment string like this:The
egg=hypothesis==9.9.9
fragment implies thathypothesis==9.9.9
is being installed from this URL, but that version specifier is actually ignored and the real version at that VCS ref (6.56.3) is installed instead.AFAICT this version pin was never supported in the first place (#5384 says that the egg fragment has never supported 508-style specs), but it's a little surprising (as an end user) for it to silently be ignored rather than producing a warning or requirements parsing error.
Describe the solution you'd like
Ideally,
pip
would produce a hard error (or at least a warning) here, since the supplied version specifier is (1) ineffective and (2) indicates user confusion about what they're asking for.Alternative Solutions
No alternative solution is necessary, since this isn't broken per se.
Additional context
pip-audit
context: pypa/pip-audit#382This issue also manifests in third-party requirements-file parsers, like
pip-audit
andpip-requirements-parser
. If this behavior is changed inpip
itself, I can submit patches there as well.Code of Conduct
The text was updated successfully, but these errors were encountered: