service
dev_tool.services.command.service
log = logging.getLogger(__name__)
module-attribute
CommandRunner
Bases: BaseService
A service that abstracts command execution for local or containerized environments.
The constructor for the CommandRunner class.
Parameters:
-
execution_strategy(ExecutionStrategyProtocol) –The execution strategy for running commands.
Source code in dev_tool/services/command/service.py
execution_strategy
property
A property that returns the ExecutionStrategy.
Returns:
-
ExecutionStrategyProtocol–The ExecutionStrategyProtocol instance.
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.
Source code in dev_tool/services/command/service.py
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/command/service.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/command/service.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/command/service.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/command/service.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.