1616from pydantic_settings import BaseSettings , SettingsConfigDict
1717
1818
19- class HermesSettings (BaseSettings ):
19+ class _HermesSettings (BaseSettings ):
2020 """Root class for HERMES configuration model."""
2121
2222 model_config = SettingsConfigDict (env_file_encoding = 'utf-8' )
@@ -31,7 +31,7 @@ class HermesCommand(abc.ABC):
3131 """
3232
3333 command_name : str = ""
34- settings_class : Type = HermesSettings
34+ settings_class : Type = _HermesSettings
3535
3636 def __init__ (self , parser : argparse .ArgumentParser ):
3737 """Initialize a new instance of any HERMES command.
@@ -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