summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--setuptools/command/editable_wheel.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/setuptools/command/editable_wheel.py b/setuptools/command/editable_wheel.py
index cd535e48..b908298f 100644
--- a/setuptools/command/editable_wheel.py
+++ b/setuptools/command/editable_wheel.py
@@ -684,9 +684,13 @@ def _is_nested(pkg: str, pkg_path: str, parent: str, parent_path: str) -> bool:
False
>>> _is_nested("a.b", "path/a/b", "c", "path/c")
False
+ >>> _is_nested("a.a", "path/a/a", "a", "path/a")
+ True
+ >>> _is_nested("b.a", "path/b/a", "a", "path/a")
+ False
"""
norm_pkg_path = _normalize_path(pkg_path)
- rest = pkg.replace(parent, "").strip(".").split(".")
+ rest = pkg.replace(parent, "", 1).strip(".").split(".")
return (
pkg.startswith(parent)
and norm_pkg_path == _normalize_path(Path(parent_path, *rest))