-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (41 loc) · 1.75 KB
/
Copy pathMakefile
File metadata and controls
52 lines (41 loc) · 1.75 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
.PHONY: help install test lint fmt check audit clean examples docs release
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
install: ## Install package with dev dependencies
pip install -e ".[dev]"
pre-commit install
test: ## Run tests with coverage
pytest --cov=td --cov-report=term-missing --cov-fail-under=85
lint: ## Run linter and type checker
ruff check .
ruff format --check .
mypy src/td/
fmt: ## Auto-format code
ruff format .
ruff check --fix .
check: lint test ## Run all checks (lint + test)
audit: ## Scan dependencies for known vulnerabilities
pip-audit --desc
examples: ## Regenerate command examples doc
python scripts/generate_examples.py > docs/examples.md
docs: ## Serve docs locally
mkdocs serve
clean: ## Remove build artifacts
rm -rf dist/ build/ *.egg-info .coverage coverage.xml htmlcov/ .mypy_cache/ .ruff_cache/ .pytest_cache/
release: check ## Release a new version (make release VERSION=x.y.z)
ifndef VERSION
$(error VERSION is required. Usage: make release VERSION=0.2.0)
endif
@echo "Releasing v$(VERSION)..."
git checkout -b release/v$(VERSION)
@echo -n "$(VERSION)" > src/td/VERSION
@sed -i 's/## \[Unreleased\]/## [Unreleased]\n\n## [$(VERSION)] - $(shell date +%Y-%m-%d)/' CHANGELOG.md
git add src/td/VERSION CHANGELOG.md
git commit -m "chore(release): v$(VERSION)"
git push -u origin release/v$(VERSION)
gh pr create --title "chore(release): v$(VERSION)" --body "Version bump and changelog for v$(VERSION)."
@echo ""
@echo "PR created. After CI passes and PR is merged, run:"
@echo " git checkout main && git pull"
@echo " git tag -a v$(VERSION) -m \"v$(VERSION)\""
@echo " git push origin v$(VERSION)"