summaryrefslogtreecommitdiff
path: root/setuptools/command
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-10-12 17:00:40 +0100
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-10-12 17:00:40 +0100
commit367a82b839e42ed2910193fdaae54d4e6353541a (patch)
tree6948854503096a269adae718357461966365b17b /setuptools/command
parent832a51c697d6c03500f94e09d699d1394e04c0c2 (diff)
downloadpython-setuptools-git-367a82b839e42ed2910193fdaae54d4e6353541a.tar.gz
Handle no-packages projects in editable_wheel
Diffstat (limited to 'setuptools/command')
-rw-r--r--setuptools/command/editable_wheel.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/setuptools/command/editable_wheel.py b/setuptools/command/editable_wheel.py
index d05c3a75..a219ec3c 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)