File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 1+ v4.11.4
2+ =======
3+
4+ * #377: In ``PathDistribution._name_from_stem ``, avoid including
5+ parts of the extension in the result.
6+
17v4.11.3
28=======
39
Original file line number Diff line number Diff line change @@ -958,11 +958,20 @@ def _normalized_name(self):
958958 stem = os .path .basename (str (self ._path ))
959959 return self ._name_from_stem (stem ) or super ()._normalized_name
960960
961- def _name_from_stem (self , stem ):
962- name , ext = os .path .splitext (stem )
961+ @staticmethod
962+ def _name_from_stem (stem ):
963+ """
964+ >>> PathDistribution._name_from_stem('foo-3.0.egg-info')
965+ 'foo'
966+ >>> PathDistribution._name_from_stem('CherryPy-3.0.dist-info')
967+ 'CherryPy'
968+ >>> PathDistribution._name_from_stem('face.egg-info')
969+ 'face'
970+ """
971+ filename , ext = os .path .splitext (stem )
963972 if ext not in ('.dist-info' , '.egg-info' ):
964973 return
965- name , sep , rest = stem .partition ('-' )
974+ name , sep , rest = filename .partition ('-' )
966975 return name
967976
968977
You can’t perform that action at this time.
0 commit comments