File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 3
3
4
4
* #377: In ``PathDistribution._name_from_stem ``, avoid including
5
5
parts of the extension in the result.
6
+ # #381: In ``PathDistribution._normalized_name ``, ensure names
7
+ loaded from the stem of the filename are also normalized, ensuring
8
+ duplicate entry points by packages varying only by non-normalized
9
+ name are hidden.
6
10
7
11
v4.11.3
8
12
=======
Original file line number Diff line number Diff line change @@ -956,7 +956,10 @@ def _normalized_name(self):
956
956
normalized name from the file system path.
957
957
"""
958
958
stem = os .path .basename (str (self ._path ))
959
- return self ._name_from_stem (stem ) or super ()._normalized_name
959
+ return (
960
+ pass_none (Prepared .normalize )(self ._name_from_stem (stem ))
961
+ or super ()._normalized_name
962
+ )
960
963
961
964
@staticmethod
962
965
def _name_from_stem (stem ):
Original file line number Diff line number Diff line change @@ -89,15 +89,15 @@ def test_entry_points_distribution(self):
89
89
self .assertIn (ep .dist .name , ('distinfo-pkg' , 'egginfo-pkg' ))
90
90
self .assertEqual (ep .dist .version , "1.0.0" )
91
91
92
- def test_entry_points_unique_packages (self ):
92
+ def test_entry_points_unique_packages_normalized (self ):
93
93
"""
94
94
Entry points should only be exposed for the first package
95
- on sys.path with a given name.
95
+ on sys.path with a given name (even when normalized) .
96
96
"""
97
97
alt_site_dir = self .fixtures .enter_context (fixtures .tempdir ())
98
98
self .fixtures .enter_context (self .add_sys_path (alt_site_dir ))
99
99
alt_pkg = {
100
- "distinfo_pkg -1.1.0.dist-info" : {
100
+ "DistInfo_pkg -1.1.0.dist-info" : {
101
101
"METADATA" : """
102
102
Name: distinfo-pkg
103
103
Version: 1.1.0
You can’t perform that action at this time.
0 commit comments