Skip to content

Commit

Permalink
follow package_dir automatically when set in the distribution (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
thrau committed Feb 25, 2024
1 parent 217fea7 commit af0e4f9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions plux/build/setuptools.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,17 @@ def finalize_options(self) -> None:
self.plux_json_path = get_plux_json_path(self.distribution)

def run(self) -> None:
self.debug_print("finding plugins...")
ep = find_plugins(exclude=("tests", "tests.*")) # TODO: options
if not self.distribution.package_dir:
where = "."
else:
if self.distribution.package_dir[""]:
where = self.distribution.package_dir[""]
else:
self.debug_print("plux doesn't know how to resolve multiple package_dir directories")
where = "."

self.debug_print(f"finding plugins in '{where}'...")
ep = find_plugins(where=where, exclude=("tests", "tests.*")) # TODO: pass options through CLI

self.debug_print(f"writing discovered plugins into {self.plux_json_path}")
self.mkpath(os.path.dirname(self.plux_json_path))
Expand Down

0 comments on commit af0e4f9

Please sign in to comment.