Skip to content

Commit

Permalink
Prevent accidental partial name matching in editable hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Aug 24, 2022
1 parent 753b195 commit 1387232
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion setuptools/command/editable_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ class _EditableFinder: # MetaPathFinder
@classmethod
def find_spec(cls, fullname, path=None, target=None):
for pkg, pkg_path in reversed(list(MAPPING.items())):
if fullname.startswith(pkg):
if fullname == pkg or fullname.startswith(f"{{pkg}}."):
rest = fullname.replace(pkg, "", 1).strip(".").split(".")
return cls._find_spec(fullname, Path(pkg_path, *rest))
Expand Down

0 comments on commit 1387232

Please sign in to comment.