-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (54 loc) · 2.14 KB
/
Copy pathMakefile
File metadata and controls
69 lines (54 loc) · 2.14 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
.PHONY: install test lint type-check coverage clean build publish-test publish protos
# ── Setup ─────────────────────────────────────────────────────
install:
pip install -e ".[dev]"
pre-commit install
# ── Protobuf generation (uses ./protos/, no backend dependency) ─
protos:
@echo "Generating Python gRPC stubs from ./protos/..."
@mkdir -p src/nullrun/v1
python -m grpc_tools.protoc \
-I./protos \
--python_out=./src/nullrun/v1 \
--grpc_python_out=./src/nullrun/v1 \
./protos/nullrun/v1/track.proto
@touch src/nullrun/v1/__init__.py
@echo "Done. Generated files: src/nullrun/v1/track_pb2.py, track_pb2_grpc.py"
# ── Tests ─────────────────────────────────────────────────────
test:
pytest tests/ -v
test-watch:
pytest tests/ -v --tb=short -f
coverage:
coverage run -m pytest tests/
coverage report
coverage html
@echo "HTML report: htmlcov/index.html"
# ── Code quality ──────────────────────────────────────────────
lint:
ruff check src/ tests/
ruff format --check src/ tests/
lint-fix:
ruff check --fix src/ tests/
ruff format src/ tests/
type-check:
mypy src/nullrun --strict
check: lint type-check test
# ── Build & Publish ───────────────────────────────────────────
clean:
rm -rf dist/ build/ *.egg-info htmlcov/ .coverage
build: clean
pip install build
python -m build
pip install twine
twine check dist/*
publish-test: build
twine upload --repository testpypi dist/*
publish: build
twine upload dist/*
# ── Dev helpers ───────────────────────────────────────────────
run-example:
python examples/basic.py
smoke-test: build
pip install dist/*.whl --force-reinstall
python -c "from nullrun import protect; print('OK')"