@@ -7,41 +7,23 @@ PYTHON_DIRS := $(PACKAGE) $(TEST_DIR)
77.DEFAULT_GOAL := .PHONY
88help :
99 @echo " Available commands:"
10- @echo " qa : Run analysis and tests"
1110 @echo " analyze : Run code analysis with ruff"
12- @echo " format : Format code "
13- @echo " test : Run tests "
11+ @echo " build : Run QA and prepare build "
12+ @echo " clean : Remove temporary files "
1413 @echo " coverage : Check test coverage"
14+ @echo " format : Format code"
1515 @echo " lock : Lock dependencies with uv"
16- @echo " clean : Remove temporary files "
17- @echo " build : Run QA and prepare build "
18-
19- qa : analyze test
16+ @echo " qa : Run all quality assurance checks (analysis, type checking, security, tests) "
17+ @echo " security : Run security checks with bandit "
18+ @echo " test : Run tests "
19+ @echo " typecheck: Run mypy type checking "
2020
2121analyze :
22- @uv add ruff --dev
2322 @echo " Running code analysis..."
2423 @uv run ruff check $(PYTHON_DIRS )
2524
26- format :
27- @uv add ruff --dev
28- @echo " Formatting code..."
29- @uv run ruff format $(PYTHON_DIRS )
30-
31- lock :
32- @echo " Updating dependency lock..."
33- @uv run uv lock
34-
35- test :
36- @uv add pytest --dev
37- @echo " Running tests..."
38- @uv run pytest --maxfail=1
39-
40- coverage :
41- @uv add pytest --dev
42- @uv add pytest-cov --dev
43- @echo " Checking test coverage..."
44- @uv run pytest --cov=$(PACKAGE ) --cov-report=term-missing $(TEST_DIR )
25+ build : qa clean
26+ @echo " Build prepared."
4527
4628clean :
4729 @echo " Cleaning up..."
@@ -53,9 +35,34 @@ clean:
5335 @find . -type d -name " *.egg-info" -exec rm -rf {} +
5436 @find . -type d -name " *.egg" -exec rm -rf {} +
5537 @find . -type d -name " .pytest_cache" -exec rm -rf {} +
38+ @find . -type d -name " .mypy_cache" -exec rm -rf {} +
5639 @rm -rf build/ dist/ .coverage htmlcov/
5740
58- build : qa clean
59- @echo " Build prepared."
41+ coverage :
42+ @echo " Checking test coverage..."
43+ @uv run pytest --cov=$(PACKAGE ) --cov-report=term-missing $(TEST_DIR )
44+
45+ format :
46+ @echo " Formatting code..."
47+ @uv run ruff format $(PYTHON_DIRS )
48+
49+ lock :
50+ @echo " Updating dependency lock..."
51+ @uv run uv lock
52+
53+ qa : analyze typecheck security test
54+
55+ security :
56+ @echo " Running security checks..."
57+ @uv run bandit -r $(PACKAGE ) -c pyproject.toml
58+
59+ test :
60+ @echo " Running tests..."
61+ @uv run pytest --maxfail=1
62+
63+ typecheck :
64+ @uv add pyright --dev
65+ @echo " Running type checking..."
66+ @uv run pyright $(PACKAGE )
6067
61- .PHONY : analyze build clean format lock qa test coverage help
68+ .PHONY : analyze build clean coverage format help lock qa security test typecheck
0 commit comments