-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathMakefile
More file actions
84 lines (66 loc) · 2.69 KB
/
Copy pathMakefile
File metadata and controls
84 lines (66 loc) · 2.69 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
.PHONY: help install dev test test-cov bench lint format type check build clean examples-screenshots smoke-capture smoke-recall console webapp-build
PY ?= python
PIP ?= $(PY) -m pip
help:
@echo "vouch developer targets"
@echo ""
@echo " make install editable install with dev extras"
@echo " make test run pytest"
@echo " make test-cov run pytest with coverage"
@echo " make bench run the performance benchmark suite (needs pytest-benchmark)"
@echo " make lint ruff check"
@echo " make format ruff format (writes)"
@echo " make type mypy"
@echo " make check lint + type + test"
@echo " make build build sdist + wheel"
@echo " make clean remove caches, build artifacts, *.egg-info"
@echo " make examples-screenshots re-render docs/img/examples/*.svg"
@echo " make smoke-capture end-to-end check of session auto-capture"
@echo " make smoke-recall end-to-end check of session-start recall"
@echo " make console run the vouch backend + vouch-ui web console together"
install:
$(PIP) install -e '.[dev]'
dev: install
test:
$(PY) -m pytest
test-cov:
$(PY) -m pytest --cov=vouch --cov-report=term-missing --cov-report=xml
lint:
$(PY) -m ruff check src tests
format:
$(PY) -m ruff format src tests
type:
$(PY) -m mypy src
check: lint type test
# the bench_*.py filenames don't match pytest's default python_files glob,
# so the override is required or zero benchmarks are collected.
bench:
$(PY) -m pytest benchmarks/ --benchmark-only \
-o python_files='bench_*.py test_*.py' \
--benchmark-json=bench.json
examples-screenshots:
$(PY) docs/img/examples/render.py
smoke-capture:
VOUCH="$(PY) -m vouch" bash scripts/smoke-capture.sh
smoke-recall:
VOUCH="$(PY) -m vouch" bash scripts/smoke-recall.sh
# Run the vouch HTTP backend and the vouch-ui web console together (Ctrl-C stops
# both). Installs the web console's node deps on first run.
console:
bash scripts/console.sh
# Build the React console into webapp/dist so the wheel can bundle it as
# vouch/web/console (hatch_build.py force-includes it when present). Installs
# the web console's node deps on first run.
webapp-build:
cd webapp && { [ -d node_modules ] || npm ci; } && npm run build
# sdist is source-only; the wheel is built from the working tree (not the
# sdist) so the freshly-built, gitignored webapp/dist rides inside it.
build: webapp-build
$(PY) -m pip install --upgrade build
$(PY) -m build --sdist
$(PY) -m build --wheel
clean:
rm -rf build dist *.egg-info src/*.egg-info \
.pytest_cache .ruff_cache .mypy_cache .benchmarks \
coverage.xml .coverage htmlcov bench.json
find . -type d -name __pycache__ -prune -exec rm -rf {} +