-
Notifications
You must be signed in to change notification settings - Fork 36
Fix "Should be unreachable in pip8" caused by inconsistent use of normalization #205
Conversation
def normalize_name(name): | ||
"""Normalize a python package name a la PEP 503""" | ||
# https://www.python.org/dev/peps/pep-0503/#normalized-names | ||
return re.sub('[-_.]+', '-', name).lower() |
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.
stolen verbatim from distutils
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.
looks good to me
'pypi-server', '-vvvvvv', | ||
'-i', '127.0.0.1', | ||
'-p', port, | ||
# Default fallback is HTTP, which is no longer supported. |
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.
maybe a todo to remove this once a new enough pypiserver is released? or install pypiserver from git temporarily?
Codecov Report
@@ Coverage Diff @@
## master #205 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 39 40 +1
Lines 1826 1849 +23
Branches 105 105
=====================================
+ Hits 1826 1849 +23
Continue to review full report at Codecov.
|
Fixes #202
@asottile can you think of a better way to implement this?
I think the ideal way would be to capture the name of the installed package right after it's installed, but it doesn't appear that pip does that, and patching that + threading the resulting name all the way back to our code sounds unpleasant.
Or maybe WorkingSet already has a way to find a normalized name, but I couldn't find one.