2424set dotenv-load := true
2525
2626#=======================================================================================
27- # Aliases
27+ # Public Recipes
2828#=======================================================================================
2929
30- alias f := fmt
31- alias l := lint
32- alias ty := type
33- alias t := test
34- alias tc := test-contract
35- # TODO(Liam): Revert back to regular check once you're done fixing type check issues.
36- alias cv := coverage
37- alias do := docs
38- alias c := temp-check
39- alias d := dev
30+ # Run all code quality checks.
31+ check : format lint type _dj_check test coverage
4032
41- #=======================================================================================
42- # Public Recipes
43- #=======================================================================================
33+ # Show test coverage.
34+ coverage : _py_coverage
35+
36+ # Run the development server.
37+ dev : _dj_makemigrations _dj_migrate _dj_runserver
38+
39+ # Build the developer documentation site.
40+ docs : _sp_build_html
4441
4542# Format Python code.
46- fmt : _py_fmt
43+ format : _py_format
4744
4845# Check Python code for common mistakes that can be identified by static analysis.
4946lint : _py_lint
5047
51- # Check Python code for problems with type hints.
52- type : _py_type
53-
5448# Run all tests.
55- test : _dj_makemigrations _dj_migrate
56- cd src && coverage run -m pytest
57-
58- # Run contract tests.
59- test-contract : _dj_makemigrations _dj_migrate
60- cd src && pytest -m contract
49+ test : _dj_makemigrations _dj_migrate _py_test
6150
62- # Show test coverage.
63- coverage :
64- cd src && coverage report -m
65-
66- # Build the developer documentation site.
67- docs :
68- cd docs && make html
69-
70- # Run all code quality checks.
71- check : fmt lint type test _dj_check
72-
73- # TODO(Liam): Remove this once you're done fixing type check issues.
74- # Run all code quality checks except type checking.
75- temp-check : fmt lint test _dj_check
76-
77- # Run the development server.
78- dev : _dj_makemigrations _dj_migrate
79- cd src && python manage.py runserver
51+ # Check Python code for problems with type hints.
52+ type : _py_type
8053
8154#=======================================================================================
8255# Django Recipes
8356#=======================================================================================
8457
8558# Use the system check framework to inspect the project for common problems.
8659_ dj_check :
87- cd src && python manage.py check
60+ cd src && uv run manage.py check
8861
8962# Make migrations.
9063_ dj_makemigrations :
91- cd src && python manage.py makemigrations
64+ cd src && uv run manage.py makemigrations
9265
9366# Apply migrations.
9467_ dj_migrate :
95- cd src && python manage.py migrate
68+ cd src && uv run manage.py migrate
9669
9770# Run the development server.
9871_ dj_runserver :
99- cd src && python manage.py runserver
72+ cd src && uv run manage.py runserver
10073
10174# Enter the shell.
10275_ dj_shell :
103- cd src && python manage.py shell
76+ cd src && uv run manage.py shell
10477
10578#=======================================================================================
10679# Python Code Quality Recipes
10780#=======================================================================================
10881
10982# Format all files in the current directory and all subdirectories.
110- _ py_fmt :
111- uv run ruff format
83+ _ py_format :
84+ cd src && uv run ruff format
11285
11386# Check all files in the current directory and all subdirectories for formatting issues.
114- _ py_fmt_check :
115- uv run ruff format --check
87+ _ py_format_check :
88+ cd src && uv run ruff format --check
11689
11790# Lint all files in the current directory and all subdirectories.
11891_ py_lint :
119- uv run ruff check
92+ cd src && uv run ruff check
12093
12194# Try to fix lint errors in current directory and all subdirectories.
12295_ py_lint_fix :
123- uv run ruff check --fix
96+ cd src && uv run ruff check --fix
12497
12598# Check type hints in the `src` directory and all subdirectories.
12699_ py_type :
127100 cd src && uv run mypy .
128101
102+ # Run test suite and collect coverage stats.
103+ _ py_test :
104+ cd src && uv run coverage run -m pytest
105+
106+ # Report the test coverage stats.
107+ _ py_coverage :
108+ cd src && uv run coverage report
109+
110+ # Build the test coverage report site.
111+ _ py_build_coverage_html :
112+ cd src && uv run coverage html
113+
129114#=======================================================================================
130115# Sphinx Documentation Recipes
131116#=======================================================================================
132117
133- _ sp_build :
134- cd docs && make html
135-
136- _ sp_run :
137- echo " Serving developer documentation: http://localhost:8001/html/index.html" && cd docs/ build && python -m http.server 8001 --directory .
118+ # Build the developer documentation site.
119+ _ sp_build_html :
120+ cd docs && uv run make html
0 commit comments