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 33
44* #377: In ``PathDistribution._name_from_stem ``, avoid including
55 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.
610
711v4.11.3
812=======
Original file line number Diff line number Diff line change @@ -956,7 +956,10 @@ def _normalized_name(self):
956956 normalized name from the file system path.
957957 """
958958 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+ )
960963
961964 @staticmethod
962965 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):
8989 self .assertIn (ep .dist .name , ('distinfo-pkg' , 'egginfo-pkg' ))
9090 self .assertEqual (ep .dist .version , "1.0.0" )
9191
92- def test_entry_points_unique_packages (self ):
92+ def test_entry_points_unique_packages_normalized (self ):
9393 """
9494 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) .
9696 """
9797 alt_site_dir = self .fixtures .enter_context (fixtures .tempdir ())
9898 self .fixtures .enter_context (self .add_sys_path (alt_site_dir ))
9999 alt_pkg = {
100- "distinfo_pkg -1.1.0.dist-info" : {
100+ "DistInfo_pkg -1.1.0.dist-info" : {
101101 "METADATA" : """
102102 Name: distinfo-pkg
103103 Version: 1.1.0
You can’t perform that action at this time.
0 commit comments