Skip to content

Commit

Permalink
fix: entrypoints
Browse files Browse the repository at this point in the history
  • Loading branch information
NotPeopling2day committed Apr 24, 2024
1 parent 36309cd commit 3b25939
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ape/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,14 @@ def commands(self) -> Dict:
if self._commands:
return self._commands

eps: Iterable = entry_points().get(self._CLI_GROUP_NAME, [])
# Update when dropping Python 3.9 support.
_entry_points = entry_points()
eps: Iterable = (
_entry_points.get(self._CLI_GROUP_NAME, [])
if isinstance(_entry_points, dict)
else entry_points(group=self._CLI_GROUP_NAME)
)

self._commands = {clean_plugin_name(cmd.name): cmd.load for cmd in eps}
return self._commands

Expand Down

0 comments on commit 3b25939

Please sign in to comment.