-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (45 loc) · 1.54 KB
/
Copy pathMakefile
File metadata and controls
57 lines (45 loc) · 1.54 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
PYTHON ?= python3
RELEASE := ./release.py
BUMP_PARTS := patch minor major
.PHONY: help setup sync hooks lint lint-fix test check-release status bump $(BUMP_PARTS)
help:
@echo "Targets ($(notdir $(CURDIR))):"
@echo " make setup — uv sync + enable .githooks (run once per clone)"
@echo " make sync — uv sync only"
@echo " make hooks — git config core.hooksPath .githooks"
@echo " make lint — ruff check + format --check"
@echo " make lint-fix - ruff --fix"
@echo " make test — pytest unit tests (no integration)"
@echo " make check-release — VERSION + CHANGELOG gate for current branch vs main"
@echo " make status — current version, tag, git state"
@echo " make bump patch|minor|major — bump VERSION + pyproject.toml"
setup: sync hooks
@echo "ready — local hooks enabled (.githooks). Bypass: git commit --no-verify"
sync:
uv sync
hooks:
git config core.hooksPath .githooks
@chmod +x .githooks/* 2>/dev/null || true
lint:
uv run ruff check .
uv run ruff format --check .
lint-fix:
uv run ruff check --fix .
uv run ruff format .
test:
uv run pytest tests/ -q -m "not integration"
check-release:
@base="$${RELEASE_BASE:-origin/main}"; \
head="$${RELEASE_HEAD:-HEAD}"; \
$(PYTHON) ci/gates.py mr "$$base" "$$head"
$(BUMP_PARTS):
@:
status:
$(PYTHON) $(RELEASE) status
bump:
@part="$(filter $(BUMP_PARTS),$(MAKECMDGOALS))"; \
if [ -z "$$part" ]; then \
echo "usage: make bump patch|minor|major" >&2; \
exit 1; \
fi; \
$(PYTHON) $(RELEASE) bump $$part