From 44a7abab82e9edc31f3965570f689354bc61e994 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 23 Dec 2021 03:07:39 +0100 Subject: [PATCH] fix(app): Skip plugins with not satisfied dependencies. --- flaschengeist/plugins/__init__.py | 1 + flaschengeist/utils/plugin.py | 3 +++ migrations/env.py | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/flaschengeist/plugins/__init__.py b/flaschengeist/plugins/__init__.py index 1b6fdda..f8df702 100644 --- a/flaschengeist/plugins/__init__.py +++ b/flaschengeist/plugins/__init__.py @@ -204,6 +204,7 @@ class Plugin: Dict containing version and permissions of the plugin """ from flaschengeist.utils.plugin import plugin_version + return {"version": plugin_version(self), "permissions": self.permissions} diff --git a/flaschengeist/utils/plugin.py b/flaschengeist/utils/plugin.py index b37e582..56f0643 100644 --- a/flaschengeist/utils/plugin.py +++ b/flaschengeist/utils/plugin.py @@ -25,6 +25,9 @@ def get_plugins() -> list[type[Plugin]]: plugins.append(plugin_class) except TypeError: logger.error(f"Invalid entry point for plugin {entry_point.name} found.") + except pkg_resources.DistributionNotFound: + logger.warn(f"Requirements not fulfilled for {entry_point.name}") + logger.debug("DistributionNotFound", exc_info=True) return plugins diff --git a/migrations/env.py b/migrations/env.py index fd8edac..f2bf297 100644 --- a/migrations/env.py +++ b/migrations/env.py @@ -60,7 +60,7 @@ def run_migrations_online(): connection=connection, target_metadata=target_metadata, process_revision_directives=process_revision_directives, - **current_app.extensions["migrate"].configure_args + **current_app.extensions["migrate"].configure_args, ) with context.begin_transaction():