diff --git a/changelog.d/3624.change.rst b/changelog.d/3624.change.rst new file mode 100644 index 0000000000..61b8f92aad --- /dev/null +++ b/changelog.d/3624.change.rst @@ -0,0 +1 @@ +Fixed editable install for multi-module/no-package ``src``-layout projects. diff --git a/setuptools/command/editable_wheel.py b/setuptools/command/editable_wheel.py index d05c3a75e9..a219ec3cad 100644 --- a/setuptools/command/editable_wheel.py +++ b/setuptools/command/editable_wheel.py @@ -551,13 +551,18 @@ def _simple_layout( False >>> _simple_layout(['a', 'a.b'], {"": "src", "a.b": "_ab"}, "/tmp/myproj") False + >>> # Special cases, no packages yet: + >>> _simple_layout([], {"": "src"}, "/tmp/myproj") + True + >>> _simple_layout([], {"a": "_a", "": "src"}, "/tmp/myproj") + False """ layout = { pkg: find_package_path(pkg, package_dir, project_dir) for pkg in packages } if not layout: - return False + return set(package_dir) in ({}, {""}) parent = os.path.commonpath([_parent_path(k, v) for k, v in layout.items()]) return all( _normalize_path(Path(parent, *key.split('.'))) == _normalize_path(value)