Skip to content

Commit

Permalink
Handle no-packages projects in editable_wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Oct 12, 2022
1 parent 832a51c commit 367a82b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion setuptools/command/editable_wheel.py
Expand Up @@ -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)
Expand Down

0 comments on commit 367a82b

Please sign in to comment.