Debian Codegraph @

Makefile

raw
1 .PHONY: help clean clean-build clean-pyc lint format test test-all coverage docs dist
2
3 help:
4 @echo "clean-build - remove build artifacts"
5 @echo "clean-pyc - remove Python file artifacts"
6 @echo "lint - check style with ruff"
7 @echo "format - format code with ruff"
8 @echo "test - run tests quickly with the default Python"
9 @echo "test-all - run tests on every supported Python version via uv"
10 @echo "coverage - check code coverage quickly with the default Python"
11 @echo "docs - generate Sphinx HTML documentation"
12 @echo "dist - build sdist and wheel"
13
14 clean: clean-build clean-pyc
15 rm -fr htmlcov/ .coverage coverage.xml
16
17 clean-build:
18 rm -fr build/
19 rm -fr dist/
20 rm -fr src/*.egg-info
21
22 clean-pyc:
23 find . -name '*.pyc' -exec rm -f {} +
24 find . -name '*.pyo' -exec rm -f {} +
25 find . -name '*~' -exec rm -f {} +
26
27 lint:
28 uv run ruff check src/
29
30 format:
31 uv run ruff format src/
32
33 test:
34 uv run pytest
35
36 test-all:
37 for py in 3.10 3.11 3.12 3.13 3.14 pypy3.11; do \
38 uv run --python $$py --extra rdf --extra xml pytest || exit 1; \
39 done
40
41 coverage:
42 uv run coverage run -m pytest
43 uv run coverage report -m
44 uv run coverage html
45 open htmlcov/index.html
46
47 docs:
48 uv run --group docs --extra rdf --extra xml sphinx-build -b html docs docs/_build/html
49 open docs/_build/html/index.html
50
51 dist: clean
52 uv build
53 ls -l dist