Skip to content

Commit

Permalink
change (sdist.git): exclude folders with no python file
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and [email protected] committed Jan 24, 2020
1 parent 7cd6e5e commit b6f4129
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions poetry/masonry/builders/sdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,13 @@ def find_nearest_pkg(rel_path):
if from_top_level == ".":
continue

is_subpkg = any([filename.endswith(".py") for filename in filenames]) and not self.is_excluded(
Path(path, "__init__.py").relative_to(self._path)
is_subpkg = any(
[filename.endswith(".py") for filename in filenames]
) and not all(
[
self.is_excluded(Path(path, filename).relative_to(self._path))
for filename in filenames if filename.endswith(".py")
]
)
if is_subpkg:
subpkg_paths.add(from_top_level)
Expand Down

0 comments on commit b6f4129

Please sign in to comment.