Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): use new entry point method #5623

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/dispatch/common/utils/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@

logger = logging.getLogger(__name__)


# Plugin endpoints should determine authentication # TODO allow them to specify (kglisson)
def install_plugin_events(api):
"""Adds plugin endpoints to the event router."""
for plugin in plugins.all():
if plugin.events:
api.include_router(plugin.events, prefix="/{organization}/events", tags=["events"])


def install_plugins():
"""
Installs plugins associated with dispatch
:return:
"""
# Retrieve entry points for 'dispatch.plugins'
dispatch_plugins = entry_points().get("dispatch.plugins", [])
"""Installs plugins associated with dispatch"""
dispatch_plugins = entry_points().select(group="dispatch.plugins")

for ep in dispatch_plugins:
logger.info(f"Attempting to load plugin: {ep.name}")
Expand Down
Loading