strategy
dev_tool.services.execution.strategy
ExecutionStrategy
Bases: ABC
An abstract base class defining the interface for execution strategies.
This class allows swapping between containerized and local execution without scattering conditionals throughout the codebase.
cleanup
abstractmethod
ensure_database
abstractmethod
A method that ensures the database is available.
Parameters:
-
recreate(bool, default:False) –Whether to recreate the database container.
run_bun_command
abstractmethod
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/execution/strategy.py
run_django_command
abstractmethod
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/execution/strategy.py
run_pip_command
abstractmethod
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/execution/strategy.py
run_python_command
abstractmethod
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/execution/strategy.py
run_seed
abstractmethod
A method that runs the database seeding script.
Parameters:
-
seed_script(Path) –The path to the seed script.
run_server
abstractmethod
A method that starts the Django development server.
Parameters:
run_shell_script
abstractmethod
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.