-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
120 lines (97 loc) · 2.97 KB
/
Makefile
File metadata and controls
120 lines (97 loc) · 2.97 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
.PHONY: help install dev test test-cov lint format type-check security clean build publish docs serve-docs changelog release-patch release-minor release-major commit
.DEFAULT_GOAL := help
help:
@echo "Development Commands"
@echo "===================="
@echo ""
@echo "Setup:"
@echo " make install Install package"
@echo " make dev Install with dev dependencies + pre-commit"
@echo ""
@echo "Testing:"
@echo " make test Run tests"
@echo " make test-cov Run tests with coverage report"
@echo ""
@echo "Code Quality:"
@echo " make lint Run linters"
@echo " make format Auto-format code"
@echo " make type-check Run type checker"
@echo " make security Run security checks"
@echo " make commit Interactive conventional commit"
@echo ""
@echo "Build & Release:"
@echo " make clean Clean build artifacts"
@echo " make build Build package"
@echo " make publish Publish to PyPI"
@echo " make changelog Update CHANGELOG.md"
@echo ""
@echo "Documentation:"
@echo " make docs Build documentation"
@echo " make serve-docs Serve docs locally"
@echo ""
@echo "Release:"
@echo " make release-patch Bump patch version and release"
@echo " make release-minor Bump minor version and release"
@echo " make release-major Bump major version and release"
install:
uv sync
dev:
uv sync --group dev --group docs
uv run pre-commit install --hook-type commit-msg --hook-type pre-commit
test:
uv run pytest tests/unit
test-e2e:
uv run pytest tests/e2e -s
test-cov:
uv run pytest --cov --cov-report=html --cov-report=xml
lint:
uv run ruff check src/ tests/
uv run ruff format --check src/ tests/
format:
uv run ruff format src/ tests/
uv run ruff check --fix src/ tests/
type-check:
uv run ty check src/
security:
uv run bandit -r src/
uv run pip-audit
commit:
uv run cz commit
clean:
rm -rf build/ dist/ *.egg-info .pytest_cache .coverage htmlcov/ site/ .ruff_cache/ .mypy_cache/
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete 2>/dev/null || true
build: clean
uv build
publish: build
uv run twine check dist/*
uv run twine upload dist/*
publish-test: build
uv run twine check dist/*
uv run twine upload --repository testpypi dist/*
docs:
uv run mkdocs build
serve-docs:
uv run mkdocs serve
changelog:
uv run git-cliff -o CHANGELOG.md
release-patch: test security
uv run bump-my-version bump patch
$(MAKE) changelog
git add -A
git commit -m "chore(release): prepare release"
git push origin main --tags
release-minor: test security
uv run bump-my-version bump minor
$(MAKE) changelog
git add -A
git commit -m "chore(release): prepare release"
git push origin main --tags
release-major: test security
uv run bump-my-version bump major
$(MAKE) changelog
git add -A
git commit -m "chore(release): prepare release"
git push origin main --tags
ci-check: lint type-check security test-cov
@echo "All CI checks passed!"