Skip to content

Commit a6c1a5e

Browse files
committed
Fix #301: Make all command settings classes private
1 parent 4e089c8 commit a6c1a5e

7 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/hermes/commands/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from 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.

src/hermes/commands/clean/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from hermes.commands.base import HermesCommand
1313

1414

15-
class HermesCleanSettings(BaseModel):
15+
class _HermesCleanSettings(BaseModel):
1616
"""Configuration of the ``clean`` command."""
1717
pass
1818

@@ -21,7 +21,7 @@ class HermesCleanCommand(HermesCommand):
2121
""" Clean up caches from previous HERMES runs. """
2222

2323
command_name = "clean"
24-
settings_class = HermesCleanSettings
24+
settings_class = _HermesCleanSettings
2525

2626
def __call__(self, args: argparse.Namespace) -> None:
2727
self.log.info("Removing HERMES caches...")

src/hermes/commands/curate/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from hermes.model.context import CodeMetaContext
1616

1717

18-
class CurateSettings(BaseModel):
18+
class _CurateSettings(BaseModel):
1919
"""Generic deposition settings."""
2020

2121
pass
@@ -25,7 +25,7 @@ class HermesCurateCommand(HermesCommand):
2525
""" Curate the unified metadata before deposition. """
2626

2727
command_name = "curate"
28-
settings_class = CurateSettings
28+
settings_class = _CurateSettings
2929

3030
def init_command_parser(self, command_parser: argparse.ArgumentParser) -> None:
3131
pass

src/hermes/commands/deposit/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def publish(self) -> None:
106106
pass
107107

108108

109-
class DepositSettings(BaseModel):
109+
class _DepositSettings(BaseModel):
110110
"""Generic deposition settings."""
111111

112112
target: str = ""
@@ -116,7 +116,7 @@ class HermesDepositCommand(HermesCommand):
116116
""" Deposit the curated metadata to repositories. """
117117

118118
command_name = "deposit"
119-
settings_class = DepositSettings
119+
settings_class = _DepositSettings
120120

121121
def init_command_parser(self, command_parser: argparse.ArgumentParser) -> None:
122122
command_parser.add_argument('--file', '-f', nargs=1, action='append',

src/hermes/commands/harvest/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __call__(self, command: HermesCommand) -> t.Tuple[t.Dict, t.Dict]:
2525
pass
2626

2727

28-
class HarvestSettings(BaseModel):
28+
class _HarvestSettings(BaseModel):
2929
"""Generic harvesting settings."""
3030

3131
sources: list[str] = []
@@ -35,7 +35,7 @@ class HermesHarvestCommand(HermesCommand):
3535
""" Harvest metadata from configured sources. """
3636

3737
command_name = "harvest"
38-
settings_class = HarvestSettings
38+
settings_class = _HarvestSettings
3939

4040
def __call__(self, args: argparse.Namespace) -> None:
4141
self.args = args

src/hermes/commands/init/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,15 @@ def convert_remote_url(url: str) -> str:
139139
return url
140140

141141

142-
class HermesInitSettings(BaseModel):
142+
class _HermesInitSettings(BaseModel):
143143
"""Configuration of the ``init`` command."""
144144
pass
145145

146146

147147
class HermesInitCommand(HermesCommand):
148148
""" Install HERMES onto a project. """
149149
command_name = "init"
150-
settings_class = HermesInitSettings
150+
settings_class = _HermesInitSettings
151151

152152
def __init__(self, parser: argparse.ArgumentParser):
153153
super().__init__(parser)

src/hermes/commands/postprocess/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class HermesPostprocessPlugin(HermesPlugin):
1515
pass
1616

1717

18-
class PostprocessSettings(BaseModel):
18+
class _PostprocessSettings(BaseModel):
1919
"""Generic post-processing settings."""
2020

2121
execute: list = []
@@ -25,7 +25,7 @@ class HermesPostprocessCommand(HermesCommand):
2525
"""Post-process the published metadata after deposition."""
2626

2727
command_name = "postprocess"
28-
settings_class = PostprocessSettings
28+
settings_class = _PostprocessSettings
2929

3030
def __call__(self, args: argparse.Namespace) -> None:
3131
pass

0 commit comments

Comments
 (0)