Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
87 lines (66 loc) · 2.46 KB
/
Copy pathMakefile
File metadata and controls
87 lines (66 loc) · 2.46 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
85
86
87
.PHONY: install lint check-fmt check-ruff check-mypy test profile fix format docs-deploy publish docs-serve docs-preview
ifdef GITHUB_ACTIONS
RUFF_ARGS := --output-format github
endif
install:
pip install uv
uv sync --group dev
lint: check-fmt check-ruff check-mypy check-docs
check-fmt:
uv run ruff format wireup test benchmarks --check
check-ruff:
uv run ruff check wireup test benchmarks $(RUFF_ARGS)
check-mypy:
uv run mypy wireup --strict
uv run mypy benchmarks --ignore-missing-imports
uv run mypy test/typing_tests.py --strict
check-docs:
uv run ruff format docs --line-length 80 --exclude docs/pages/class --check
test:
uv run pytest test/unit
iterations ?= 5
requests ?= 10000
warmup ?= 2000
output ?= benchmarks/benchmark_results.csv
bench_assert ?= 0
ifeq ($(version),)
BENCH_WIREUP_WITH := wireup @ .
BENCH_LOCAL_FLAG := --local
BENCH_WIREUP_VERSION := local@$(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
else ifeq ($(version),local)
BENCH_WIREUP_WITH := wireup @ .
BENCH_LOCAL_FLAG := --local
BENCH_WIREUP_VERSION := local@$(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
else
BENCH_WIREUP_WITH := wireup==$(version)
BENCH_LOCAL_FLAG :=
BENCH_WIREUP_VERSION := $(version)
endif
# Bench examples
# make bench requests=10000 iterations=1
# make bench version=2.4.0 requests=10000 iterations=5
# make bench version=local requests=10000 iterations=5
bench:
uv run --no-project --with "$(BENCH_WIREUP_WITH)" benchmarks/bench_runner.py --iterations $(iterations) --requests $(requests) --warmup $(warmup) --output $(output) $(BENCH_LOCAL_FLAG) $(if $(filter 1,$(bench_assert)),--bench-assert,)
uv run benchmarks/generate_charts.py $(output)
BENCH_WIREUP_VERSION="$(BENCH_WIREUP_VERSION)" uv run benchmarks/generate_versions.py
uv run benchmarks/generate_tables.py $(output)
profile ./profile_tests $(num_runs):
uv run python ./profile_tests.py $(num_runs)
format: format-docs
uv run ruff format . --extend-exclude '*.md'
fix: format
uv run ruff check wireup test benchmarks --fix
format-docs:
uv run ruff format docs --line-length 80 --exclude docs/pages/class
build-docs:
uv run --python 3.14 zensical build --strict -f docs/zensical.toml
docs-serve:
uv run --python 3.14 zensical serve -f docs/zensical.toml
# make docs-deploy version=...
docs-deploy $(version):
git fetch origin gh-pages:gh-pages
cd docs && uv run --python 3.14 mike deploy -F zensical.toml --push --update-aliases $(version) latest
publish:
uv build
uv publish