-
-
Notifications
You must be signed in to change notification settings - Fork 718
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
Provide automatic removal of pkg-resources==0.0.0 #275
Provide automatic removal of pkg-resources==0.0.0 #275
Conversation
Should help to deal with that pretty paintuly issue under Ubuntu/Debian family: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1635463
@@ -69,6 +69,11 @@ def fix_requirements(f): | |||
else: | |||
rest = [] | |||
|
|||
for requirement in requirements: | |||
if b'pkg-resources' in requirement.name: | |||
if b'0.0.0' in requirement.value: |
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 think this makes more sense?
if requirement.value == b'pkg-resources==0.0.0\n':
...
Otherwise looks good, shame debian botched the metadata here :( |
if b'0.0.0' in requirement.value: | ||
requirements.remove(requirement) | ||
if requirement.value == b'pkg-resources==0.0.0\n': | ||
requirements.remove(requirement) |
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.
actually, now that I look at it I think this loop results in UB (modifying list while iterating over it) -- you can avoid this with:
requirements = [
requirement for requirement in requirements
if requirement.value != b'pkg-resources==0.0.0\n'
]
Forgot to rename one var...
b6bdda5
to
980fc9b
Compare
Thanks for the feature! |
Thanks for the comments. Looking at it now all those comments and CI failures ... it's a sign I should go to sleep ;) |
This has been (finally!) released as part of v1.3.0! 🎉 |
Should help to deal with that pretty paintuly issue under Ubuntu/Debian
family:
https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1635463