26 lines
749 B
Python
26 lines
749 B
Python
import os
|
|
|
|
|
|
def run_task(task_name):
|
|
print(f"Running {task_name}...")
|
|
os.system(
|
|
"uv run python -m pytest --cov --cov-config=pyproject.toml --cov-report=term-missing"
|
|
if task_name == "test"
|
|
else "uv run ruff check . && uv run ruff format --check . && uv run mypy src/main.py && uv run deptry ."
|
|
if task_name == "check"
|
|
else "uv run python src/main.py"
|
|
if task_name == "run"
|
|
else "uv sync && uv run pre-commit install"
|
|
if task_name == "install"
|
|
else "rm -rf .venv __pycache__ .pytest_cache .mypy_cache .ruff_cache"
|
|
if task_name == "clean"
|
|
else ""
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
import sys
|
|
|
|
if len(sys.argv) > 1:
|
|
run_task(sys.argv[1])
|