Skip to content

Commit 4e089c8

Browse files
committed
Make init_plugins a class method
1 parent d3f4656 commit 4e089c8

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/hermes/commands/base.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,19 @@ def __init__(self, parser: argparse.ArgumentParser):
4545
self.log = logging.getLogger(f"hermes.{self.command_name}")
4646
self.errors = []
4747

48-
def init_plugins(self):
48+
@classmethod
49+
def init_plugins(cls):
4950
"""Collect and initialize the plugins available for the HERMES command."""
5051

5152
# Collect all entry points for this group (i.e., all valid plug-ins for the step)
52-
entry_point_group = f"hermes.{self.command_name}"
53+
entry_point_group = f"hermes.{cls.command_name}"
5354
group_plugins = {
5455
entry_point.name: entry_point.load()
5556
for entry_point in metadata.entry_points(group=entry_point_group)
5657
}
5758

5859
# Collect the plug-in specific configurations
59-
self.derive_settings_class({
60+
cls.derive_settings_class({
6061
plugin_name: plugin_class.settings_class
6162
for plugin_name, plugin_class in group_plugins.items()
6263
if hasattr(plugin_class, "settings_class") and plugin_class.settings_class is not None

0 commit comments

Comments
 (0)