services
dev_tool.services
__all__ = ['CommandRunnerProtocol', 'DockerServiceProtocol', 'ExecutionStrategyProtocol']
module-attribute
CommandRunnerProtocol
Bases: Protocol
A protocol defining the interface for command execution.
cleanup_build_context
ensure_services
is_containerized_available
A method that checks if Docker and docker-compose are available.
Returns:
-
bool–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:
-
CompletedProcess–The completed process result.
Source code in dev_tool/services/protocols.py
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:
-
CompletedProcess–The completed process result.
Source code in dev_tool/services/protocols.py
run_pip_command
A method that executes a pip command.
Parameters:
-
args(list[str]) –The command arguments.
-
kwargs(Any, default:{}) –Additional subprocess arguments.
Returns:
-
CompletedProcess–The completed process result.
Source code in dev_tool/services/protocols.py
run_python_command
A method that executes a Python command.
Parameters:
-
args(list[str]) –The command arguments.
-
kwargs(Any, default:{}) –Additional subprocess arguments.
Returns:
-
CompletedProcess–The completed process result.
Source code in dev_tool/services/protocols.py
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:
-
CompletedProcess–The completed process result.
Source code in dev_tool/services/protocols.py
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.
ExecutionStrategyProtocol
Bases: Protocol
A protocol defining the interface for execution strategies.
cleanup
ensure_database
A method that ensures the database is available.
Parameters:
-
recreate(bool, default:False) –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:
-
CompletedProcess–The completed process result.
Source code in dev_tool/services/protocols.py
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:
-
CompletedProcess–The completed process result.
Source code in dev_tool/services/protocols.py
run_pip_command
A method that executes a pip command.
Parameters:
-
args(list[str]) –The command arguments.
-
kwargs(Any, default:{}) –Additional subprocess arguments.
Returns:
-
CompletedProcess–The completed process result.
Source code in dev_tool/services/protocols.py
run_python_command
A method that executes a Python command.
Parameters:
-
args(list[str]) –The command arguments.
-
kwargs(Any, default:{}) –Additional subprocess arguments.
Returns:
-
CompletedProcess–The completed process result.
Source code in dev_tool/services/protocols.py
run_seed
A method that runs the database seeding script.
Parameters:
-
seed_script(Path) –The path to the seed script.
run_server
A method that starts the Django development server.
Parameters:
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:
-
CompletedProcess–The completed process result.