This repository was archived by the owner on Aug 26, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (52 loc) · 2.05 KB
/
Copy pathMakefile
File metadata and controls
64 lines (52 loc) · 2.05 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
.PHONY: help install lint format typecheck test test-unit test-realtime test-e2e codegen release-check
EASYPUSH_DIR ?= ../easy-push
SPEC_URL ?= http://localhost:3000/swagger/json
SPEC_FILE := spec/openapi.json
GEN_OUT := src/axonpush/_internal/api
help:
@echo "axonpush-python — common dev targets"
@echo
@echo " make install uv sync (dev + all extras)"
@echo " make codegen dump backend OpenAPI spec, regenerate $(GEN_OUT)"
@echo " make lint ruff check + format check"
@echo " make format ruff format --write + ruff check --fix"
@echo " make typecheck mypy --strict src/"
@echo " make test-unit fast unit tests"
@echo " make test-realtime realtime/MQTT unit tests (mocked broker)"
@echo " make test-e2e e2e tests against $(SPEC_URL) (boot backend yourself)"
@echo " make release-check lint + typecheck + test-unit"
@echo
@echo "Codegen requires the backend to be running on $(SPEC_URL)."
@echo "Start it with: cd $(EASYPUSH_DIR) && bun run start:dev"
install:
uv sync --extra dev --extra all
codegen:
@echo "[+] Fetching OpenAPI spec from $(SPEC_URL)..."
@mkdir -p spec tools
@curl -fsS $(SPEC_URL) > $(SPEC_FILE) || (echo "ERR: backend not reachable at $(SPEC_URL)" && exit 1)
@uv run python tools/patch-spec.py $(SPEC_FILE)
@echo "[+] Generating client into $(GEN_OUT)..."
@rm -rf _internal_api
uv run openapi-python-client generate --path $(SPEC_FILE) --config tools/openapi-config.yaml --overwrite --meta none
@rm -rf $(GEN_OUT)
@mkdir -p src/axonpush/_internal
@touch src/axonpush/_internal/__init__.py
@mv _internal_api $(GEN_OUT)
@echo "[+] Codegen complete. Run 'git diff' to review changes."
lint:
uv run ruff check .
uv run ruff format --check .
format:
uv run ruff format .
uv run ruff check . --fix
typecheck:
uv run mypy --strict src/
test: test-unit
test-unit:
uv run pytest tests/unit -v
test-realtime:
uv run pytest tests/realtime -v
test-e2e:
uv run pytest tests/e2e -v -m e2e
release-check: lint typecheck test-unit
@echo "[+] Release gate would pass."