We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fea6e75 commit 595eb5fCopy full SHA for 595eb5f
importlib_metadata/__init__.py
@@ -497,14 +497,16 @@ def normalize(name):
497
"""
498
return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_')
499
500
- def matches(self, name, base):
501
- n_low = name.lower()
+ def matches(self, cand, base):
+ low = cand.lower()
502
+ pre, ext = os.path.splitext(low)
503
+ name, sep, rest = pre.partition('-')
504
return (
- n_low in self.exact_matches
- or n_low.replace('.', '_').startswith(self.prefix)
505
- and n_low.endswith(self.suffixes)
+ low in self.exact_matches
506
+ or name.replace('.', '_').startswith(self.normalized)
507
+ and ext in self.suffixes
508
# legacy case:
- or self.is_egg(base) and n_low == 'egg-info'
509
+ or self.is_egg(base) and low == 'egg-info'
510
)
511
512
def is_egg(self, base):
0 commit comments