-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
83 lines (67 loc) · 2.41 KB
/
Copy pathMakefile
File metadata and controls
83 lines (67 loc) · 2.41 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
# erm Makefile
.PHONY: all setup lint test test-cov docs-cli clean build build-python publish publish-python publish-test publish-dry-run sync-version help
all: help
# Install dev dependencies (creates .venv via uv)
setup:
uv sync --extra dev
# Check Python syntax
lint:
uv run python -m py_compile src/erm/*.py
@echo "Syntax check passed"
# Run pytest
test:
uv run pytest tests/ -v
# Run pytest with coverage
test-cov:
uv run pytest tests/ -v --cov=src/erm --cov-report=term-missing
# Regenerate docs/cli-reference.md from erm's argparse parsers.
# Pinned to Python 3.13 because argparse's --help formatting changed across
# versions (e.g. 3.13 collapses "-o OUTPUT, --output OUTPUT" to "-o, --output
# OUTPUT"). The CI drift-guard generates on the same version, so the committed
# file and CI always agree.
docs-cli:
uv run --python 3.13 python scripts/gen_cli_docs.py
# Remove build/dist artifacts
clean:
rm -rf build/ dist/ src/*.egg-info/
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete
# Build distribution packages (wheel + sdist)
build: build-python
build-python:
./scripts/build-python.sh
# Publish to PyPI (production)
publish: publish-python
publish-python:
./scripts/publish-python.sh
# Publish to TestPyPI
publish-test:
./scripts/publish-python.sh --test
# Validate dist/ without uploading
publish-dry-run:
./scripts/publish-python.sh --dry-run
# Bump version. Usage: make sync-version VERSION=0.2.0
sync-version:
@test -n "$(VERSION)" || (echo "Usage: make sync-version VERSION=x.y.z" && exit 1)
./scripts/sync-version.sh $(VERSION)
help:
@echo "erm Makefile"
@echo ""
@echo "Setup & checks:"
@echo " setup Install dev deps (uv sync --extra dev)"
@echo " lint Compile-check Python sources"
@echo " test Run pytest"
@echo " test-cov Run pytest with coverage"
@echo " clean Remove build/dist/__pycache__ artifacts"
@echo ""
@echo "Docs:"
@echo " docs-cli Regenerate docs/cli-reference.md from the CLI parsers"
@echo ""
@echo "Build & publish:"
@echo " build Build wheel + sdist into dist/"
@echo " publish Upload dist/ to PyPI"
@echo " publish-test Upload dist/ to TestPyPI"
@echo " publish-dry-run Validate dist/ without uploading"
@echo ""
@echo "Version:"
@echo " sync-version VERSION=x.y.z Bump version in pyproject.toml + __init__.py"