Skip to content

services

dev_tool.services

__all__ = ['CommandRunnerProtocol', 'DockerServiceProtocol', 'ExecutionStrategyProtocol'] module-attribute

CommandRunnerProtocol

Bases: Protocol

A protocol defining the interface for command execution.

cleanup_build_context

A method that cleans up temporary build context directories.

Source code in dev_tool/services/protocols.py
def cleanup_build_context(self) -> None:
    """A method that cleans up temporary build context directories."""
    ...

ensure_services

A method that ensures Docker services are running.

Source code in dev_tool/services/protocols.py
def ensure_services(self) -> None:
    """A method that ensures Docker services are running."""
    ...

is_containerized_available

A method that checks if Docker and docker-compose are available.

Returns:

  • bool

    True if Docker is available, False otherwise.

Source code in dev_tool/services/protocols.py
def is_containerized_available(self) -> bool:
    """
    A method that checks if Docker and docker-compose are available.

    :return: True if Docker is available, False otherwise.
    """
    ...

run_bun_command

A method that executes a Bun command.

Parameters:

  • args (list[str]) –

    The command arguments.

  • kwargs (Any, default: {} ) –

    Additional subprocess arguments.

Returns:

Source code in dev_tool/services/protocols.py
def run_bun_command(self, args: list[str], **kwargs: Any) -> subprocess.CompletedProcess:
    """
    A method that executes a Bun command.

    :param args: The command arguments.
    :param kwargs: Additional subprocess arguments.
    :return: The completed process result.
    """
    ...

run_django_command

A method that executes a Django management command.

Parameters:

  • args (list[str]) –

    The command arguments.

  • kwargs (Any, default: {} ) –

    Additional subprocess arguments.

Returns:

Source code in dev_tool/services/protocols.py
def run_django_command(self, args: list[str], **kwargs: Any) -> subprocess.CompletedProcess:
    """
    A method that executes a Django management command.

    :param args: The command arguments.
    :param kwargs: Additional subprocess arguments.
    :return: The completed process result.
    """
    ...

run_pip_command

A method that executes a pip command.

Parameters:

  • args (list[str]) –

    The command arguments.

  • kwargs (Any, default: {} ) –

    Additional subprocess arguments.

Returns:

Source code in dev_tool/services/protocols.py
def run_pip_command(self, args: list[str], **kwargs: Any) -> subprocess.CompletedProcess:
    """
    A method that executes a pip command.

    :param args: The command arguments.
    :param kwargs: Additional subprocess arguments.
    :return: The completed process result.
    """
    ...

run_python_command

A method that executes a Python command.

Parameters:

  • args (list[str]) –

    The command arguments.

  • kwargs (Any, default: {} ) –

    Additional subprocess arguments.

Returns:

Source code in dev_tool/services/protocols.py
def run_python_command(self, args: list[str], **kwargs: Any) -> subprocess.CompletedProcess:
    """
    A method that executes a Python command.

    :param args: The command arguments.
    :param kwargs: Additional subprocess arguments.
    :return: The completed process result.
    """
    ...

run_shell_script

A method that executes a Django shell script.

Parameters:

  • script (str) –

    The Python script to execute in Django shell.

  • kwargs (Any, default: {} ) –

    Additional subprocess arguments.

Returns:

Source code in dev_tool/services/protocols.py
def run_shell_script(self, script: str, **kwargs: Any) -> subprocess.CompletedProcess:
    """
    A method that executes a Django shell script.

    :param script: The Python script to execute in Django shell.
    :param kwargs: Additional subprocess arguments.
    :return: The completed process result.
    """
    ...

DockerServiceProtocol

Bases: Protocol

A protocol defining the interface for Docker service operations.

ensure_local_container

A method that ensures a local database container exists and is running.

Parameters:

  • recreate (bool, default: False ) –

    Whether to recreate the container if it exists.

Source code in dev_tool/services/protocols.py
def ensure_local_container(self, recreate: bool = False) -> None:
    """
    A method that ensures a local database container exists and is running.

    :param recreate: Whether to recreate the container if it exists.
    """
    ...

ExecutionStrategyProtocol

Bases: Protocol

A protocol defining the interface for execution strategies.

cleanup

A method that performs any necessary cleanup.

Source code in dev_tool/services/protocols.py
def cleanup(self) -> None:
    """A method that performs any necessary cleanup."""
    ...

ensure_database

A method that ensures the database is available.

Parameters:

  • recreate (bool, default: False ) –

    Whether to recreate the database container.

Source code in dev_tool/services/protocols.py
def ensure_database(self, recreate: bool = False) -> None:
    """
    A method that ensures the database is available.

    :param recreate: Whether to recreate the database container.
    """
    ...

run_bun_command

A method that executes a Bun command.

Parameters:

  • args (list[str]) –

    The command arguments.

  • kwargs (Any, default: {} ) –

    Additional subprocess arguments.

Returns:

Source code in dev_tool/services/protocols.py
def run_bun_command(self, args: list[str], **kwargs: Any) -> subprocess.CompletedProcess:
    """
    A method that executes a Bun command.

    :param args: The command arguments.
    :param kwargs: Additional subprocess arguments.
    :return: The completed process result.
    """
    ...

run_django_command

A method that executes a Django management command.

Parameters:

  • args (list[str]) –

    The command arguments.

  • kwargs (Any, default: {} ) –

    Additional subprocess arguments.

Returns:

Source code in dev_tool/services/protocols.py
def run_django_command(self, args: list[str], **kwargs: Any) -> subprocess.CompletedProcess:
    """
    A method that executes a Django management command.

    :param args: The command arguments.
    :param kwargs: Additional subprocess arguments.
    :return: The completed process result.
    """
    ...

run_pip_command

A method that executes a pip command.

Parameters:

  • args (list[str]) –

    The command arguments.

  • kwargs (Any, default: {} ) –

    Additional subprocess arguments.

Returns:

Source code in dev_tool/services/protocols.py
def run_pip_command(self, args: list[str], **kwargs: Any) -> subprocess.CompletedProcess:
    """
    A method that executes a pip command.

    :param args: The command arguments.
    :param kwargs: Additional subprocess arguments.
    :return: The completed process result.
    """
    ...

run_python_command

A method that executes a Python command.

Parameters:

  • args (list[str]) –

    The command arguments.

  • kwargs (Any, default: {} ) –

    Additional subprocess arguments.

Returns:

Source code in dev_tool/services/protocols.py
def run_python_command(self, args: list[str], **kwargs: Any) -> subprocess.CompletedProcess:
    """
    A method that executes a Python command.

    :param args: The command arguments.
    :param kwargs: Additional subprocess arguments.
    :return: The completed process result.
    """
    ...

run_seed

A method that runs the database seeding script.

Parameters:

  • seed_script (Path) –

    The path to the seed script.

Source code in dev_tool/services/protocols.py
def run_seed(self, seed_script: Path) -> None:
    """
    A method that runs the database seeding script.

    :param seed_script: The path to the seed script.
    """
    ...

run_server

A method that starts the Django development server.

Parameters:

  • ip_address (str) –

    The IP address to bind to.

  • port (int) –

    The port number to bind to.

Source code in dev_tool/services/protocols.py
def run_server(self, ip_address: str, port: int) -> None:
    """
    A method that starts the Django development server.

    :param ip_address: The IP address to bind to.
    :param port: The port number to bind to.
    """
    ...

run_shell_script

A method that executes a Django shell script.

Parameters:

  • script (str) –

    The Python script to execute in Django shell.

  • kwargs (Any, default: {} ) –

    Additional subprocess arguments.

Returns:

Source code in dev_tool/services/protocols.py
def run_shell_script(self, script: str, **kwargs: Any) -> subprocess.CompletedProcess:
    """
    A method that executes a Django shell script.

    :param script: The Python script to execute in Django shell.
    :param kwargs: Additional subprocess arguments.
    :return: The completed process result.
    """
    ...