Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
97 lines (80 loc) · 3.16 KB
/
Copy pathMakefile
File metadata and controls
97 lines (80 loc) · 3.16 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
88
89
90
91
92
93
94
95
96
97
#!/usr/bin/make -f
.DEFAULT: help
ifeq ($(shell command -v uv 2>/dev/null),)
$(error uv is required. Install it with `brew install uv`, `winget install astral-sh.uv`, or https://astral.sh/uv/install.sh)
endif
.PHONY: help
help:
@echo "test: run unit tests"
@echo "test-func: run functional tests"
@echo "typecheck: run mypy over vncdotool"
@echo "servers-up: start the docker VNC test servers"
@echo "servers-down: stop the docker VNC test servers"
@echo "test-servers: smoke test the docker VNC test server fleet"
@echo "test-os-server: run functional tests against this OS's VNC server"
@echo "test-api: run the in-process vncdotool.api lifecycle suite"
@echo "screenshots: screenshot each running VNC test server into a gallery"
@echo "goldens: capture decoder golden fixtures from the fleet"
@echo "scenes: regenerate the committed scene PNGs from tests/goldens/scenes.py"
@echo "bench: time a decoder against a committed golden fixture"
@echo "bench-record: time it and append the run to the tracked bench.jsonl"
@echo "bench-report: tabulate bench.jsonl, or diff two runs' call counts"
@echo "coverage: run both suites under coverage and report"
@echo "docs: build documentation"
@echo "prose-lint: check docs, README, and specs with vale"
@echo "release: tag and push current version to trigger PyPI release"
VERSION := $(shell uv version --bump stable --dry-run --short --no-sync 2>/dev/null)
NEXT_VERSION := $(shell uv version --bump patch --bump dev=0 --dry-run --short --no-sync 2>/dev/null)
.PHONY: release
release: test-unit
@echo "Releasing $(VERSION)"
uv version --bump stable --no-sync
sd "^## $(VERSION) \(UNRELEASED\)" "## $(VERSION) ($(shell date +%Y-%m-%d))" CHANGELOG.md
git add pyproject.toml CHANGELOG.md
git commit -m "Release $(VERSION)"
git tag v$(VERSION)
git push origin main v$(VERSION)
uv version --bump patch --bump dev=0 --no-sync
printf '## $(NEXT_VERSION) (UNRELEASED)\n\n' | cat - CHANGELOG.md > CHANGELOG.md.tmp && mv CHANGELOG.md.tmp CHANGELOG.md
git add pyproject.toml CHANGELOG.md
git commit -m "Bump version to $(NEXT_VERSION)"
git push origin main
.PHONY: docs
docs:
uv run mkdocs build
.PHONY: test testall test-unit
test: test-unit
testall: test-unit test-func
test-unit:
uv run python -m unittest discover tests/unit
.PHONY: bench
bench:
uv run python -m tests.goldens.benchmark $(ARGS)
.PHONY: bench-record
bench-record:
uv run python -m tests.goldens.benchmark --record $(ARGS)
.PHONY: bench-report
bench-report:
uv run python -m tests.goldens.report $(ARGS)
.PHONY: test-func
test-func:
uv run python -m unittest discover -s tests/functional -t .
.PHONY: typecheck
typecheck:
uv run mypy vncdotool
.PHONY: prose-lint
prose-lint:
vale sync
uv run vale docs/*.md README.md specs/*.md
include tests/servers/servers.mk
.PHONY: coverage coverage-unit coverage-func coverage-report
coverage: coverage-unit coverage-func coverage-report
coverage-unit:
uv run coverage run --parallel-mode -m unittest discover tests/unit
coverage-func:
uv run coverage run --parallel-mode -m unittest discover -s tests/functional -t .
coverage-report:
uv run coverage combine
uv run coverage report
uv run coverage html
@echo "open htmlcov/index.html"