Skip to content

Commit

Permalink
fix: directory is not package unless contains metadata file (#7)
Browse files Browse the repository at this point in the history
iter_packages previously considered any directory in a package_path
to be a package.
This adds a check that the metadata.path is a file before considering
the directory to be a package.
  • Loading branch information
AGiantSquid authored Aug 3, 2023
1 parent a9e3f03 commit 917ce0d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/monas/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ def iter_packages(self) -> Iterable[PyPackage]:
for p in self.package_paths:
for package in p.iterdir():
if package.is_dir():
yield PyPackage(self, package)
pypackage = PyPackage(self, package)
if not pypackage.metadata.path.is_file():
# directory has no python metadata file, ignore
continue
yield pypackage


pass_config = click.make_pass_decorator(Config, ensure=True)

0 comments on commit 917ce0d

Please sign in to comment.