Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (46 loc) · 1.76 KB
/
Copy pathMakefile
File metadata and controls
58 lines (46 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
ARG := $(word 2, $(MAKECMDGOALS))
$(eval $(ARG):;@:)
sources = src tests
clean-folders:
rm -rf __pycache__ */__pycache__ */**/__pycache__ \
.pytest_cache */.pytest_cache */**/.pytest_cache \
.ruff_cache */.ruff_cache */**/.ruff_cache \
.mypy_cache */.mypy_cache */**/.mypy_cache \
site build dist htmlcov .coverage .tox
lint:
uvx ruff version
uvx ruff format $(sources)
uvx ruff check $(sources) --fix
uvx ruff clean
uvx rumdl check .
test:
uv run --group tests pytest $(sources) --cov=src --cov=tests --cov-fail-under=95 --doctest-modules --cache-clear
slotscheck:
uvx --with ".[all]" slotscheck -m iso_week_date
interrogate:
uvx interrogate src
interrogate-badge:
uvx interrogate src --generate-badge docs/img/interrogate-shield.svg
typing:
uv run --group typing --all-extras mypy $(sources)
uv run --group typing --all-extras pyright $(sources)
docs-build:
uv run --group docs zensical build --clean
@# Executed code blocks (markdown-exec) render their traceback into the page instead of
@# failing the build, and zensical has no strict mode yet, so scan the output ourselves.
@if grep -rq "markdown_exec/_internal" site; then \
echo "ERROR: a documentation code block failed to execute. Offending page(s):"; \
grep -rl "markdown_exec/_internal" site --include="*.html"; \
exit 1; \
fi
@echo "All documentation code blocks executed successfully."
docs-serve:
uv run --group docs zensical serve -a localhost:$(if $(ARG),$(ARG),8000)
check: interrogate lint test slotscheck typing docs-build clean-folders
setup-release:
git checkout main
git fetch upstream
git reset --hard upstream/main
git checkout -b bump-version
python bump-version.py $(ARG)
gh pr create --title "release: Bump version to " --body "Bump version" --base main --label release