Skip to content

Commit

Permalink
Move cli alongside other Typer modules
Browse files Browse the repository at this point in the history
  • Loading branch information
JimMadge committed May 7, 2024
1 parent cdbeb90 commit 35637a3
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 23 deletions.
14 changes: 2 additions & 12 deletions data_safe_haven/commands/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
from .admin import admin_command_group
from .config import config_command_group
from .context import context_command_group
from .deploy import deploy_command_group
from .teardown import teardown_command_group
from .cli import application

__all__ = [
"admin_command_group",
"context_command_group",
"config_command_group",
"deploy_command_group",
"teardown_command_group",
]
__all__ = ["application"]
12 changes: 5 additions & 7 deletions data_safe_haven/cli.py → data_safe_haven/commands/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@
import typer

from data_safe_haven import __version__
from data_safe_haven.commands import (
admin_command_group,
config_command_group,
context_command_group,
deploy_command_group,
teardown_command_group,
)
from data_safe_haven.exceptions import DataSafeHavenError
from data_safe_haven.utility import LoggingSingleton

from .admin import admin_command_group
from .config import config_command_group
from .context import context_command_group
from .deploy import deploy_command_group
from .teardown import teardown_command_group

# Create the application
application = typer.Typer(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ dependencies = [
]

[project.scripts]
dsh = "data_safe_haven.cli:main"
dsh = "data_safe_haven.commands.cli:main"

[tool.hatch.version]
path = "data_safe_haven/version.py"
Expand Down
2 changes: 1 addition & 1 deletion tests/commands/test_help.py → tests/commands/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from data_safe_haven.cli import application
from data_safe_haven.commands import application


class TestHelp:
Expand Down
2 changes: 1 addition & 1 deletion tests/commands/test_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from data_safe_haven.commands import config_command_group
from data_safe_haven.commands.config import config_command_group
from data_safe_haven.config import Config
from data_safe_haven.external import AzureApi

Expand Down
2 changes: 1 addition & 1 deletion tests/commands/test_context.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from data_safe_haven.commands import context_command_group
from data_safe_haven.commands.context import context_command_group
from data_safe_haven.context_infrastructure import ContextInfrastructure


Expand Down

0 comments on commit 35637a3

Please sign in to comment.