重构项目为LLM 驱动
This commit is contained in:
25
tasks.py
Normal file
25
tasks.py
Normal file
@@ -0,0 +1,25 @@
|
||||
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])
|
||||
Reference in New Issue
Block a user