-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (64 loc) · 2.35 KB
/
Makefile
File metadata and controls
85 lines (64 loc) · 2.35 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
.PHONY: install lint check-fmt check-ruff check-mypy test profile fix format docs-deploy publish docs-serve
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
check-docs:
find docs -name "*.md" -not -path "docs/pages/class/*" | xargs uv run --python 3.14 blacken-docs -l 80 --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 .
fix:
uv run ruff wireup --fix
format-docs:
find docs -name "*.md" -not -path "docs/pages/class/*" | xargs uv run --python 3.14 blacken-docs -l 80 || true
build-docs:
uv run --python 3.14 mkdocs build --strict -f docs/mkdocs.yml
docs-serve:
uv run mkdocs serve -f docs/mkdocs.yml --livereload
# make docs-deploy version=...
docs-deploy $(version):
cd docs && uv run mike deploy --push --update-aliases $(version) latest
publish:
uv build
uv publish