-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
100 lines (80 loc) · 2.85 KB
/
Copy pathMakefile
File metadata and controls
100 lines (80 loc) · 2.85 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
.PHONY: help install dev test lint format type-check dead-code clean docs build version release release-dry
help:
@echo "Available commands:"
@echo " make install Install the package"
@echo " make dev Install the package in development mode with all extras"
@echo " make test Run tests"
@echo " make test-changed Run only tests affected by changes (testmon)"
@echo " make lint Run linting"
@echo " make format Format code"
@echo " make type-check Run type checking"
@echo " make dead-code Find dead code with vulture"
@echo " make clean Clean build artifacts"
@echo " make docs Build documentation"
@echo " make build Build distribution packages"
@echo " make version Show next version based on commits"
@echo " make release-dry Dry run semantic release (show what would happen)"
@echo " make release Create semantic release (bump version, tag, build, publish)"
install:
uv pip install -e .
dev:
uv pip install -e ".[dev]"
pre-commit install
test:
uv run pytest -v
test-cov:
uv run pytest --cov=karenina --cov-report=html --cov-report=term
test-changed:
uv run pytest --testmon -v
lint:
uv run ruff check --fix src/karenina tests
format:
uv run ruff format src/karenina tests
type-check:
uv run mypy src/karenina tests
dead-code:
uv run vulture src/karenina tests
clean:
rm -rf build/
rm -rf dist/
rm -rf *.egg-info
rm -rf .coverage
rm -rf htmlcov/
rm -rf .pytest_cache/
rm -rf .mypy_cache/
rm -rf .ruff_cache/
find . -type f -name "*.pyc" -delete
find . -type d -name "__pycache__" -delete
docs:
PYTHONPATH="./src:$$PYTHONPATH" uv run mkdocs build --clean
docs-serve:
PYTHONPATH="./src:$$PYTHONPATH" uv run mkdocs serve
build:
uv pip install build
python -m build
check: lint type-check dead-code test
version:
@echo "Analyzing commits for next version..."
uv run semantic-release version --print
release-dry:
@echo "Dry run - showing what would be released..."
uv run semantic-release version --dry-run
release: check
@echo "Creating semantic release..."
@echo "This will:"
@echo " 1. Analyze git commits using conventional commit format"
@echo " 2. Determine the next version (patch/minor/major)"
@echo " 3. Update version in files"
@echo " 4. Create git tag"
@echo " 5. Build distribution packages"
@echo " 6. Upload to PyPI"
@echo " 7. Create GitHub release"
@echo ""
@read -p "Continue? [y/N]: " confirm && [ "$$confirm" = "y" ] || exit 1
uv run semantic-release version
all: clean install dev check
sync-skill-docs: ## Sync karenina docs into skills/using-karenina/references
uv run skills/using-karenina/scripts/sync_docs.py \
--source docs/ \
--target skills/using-karenina/references/
@echo "Done. $$(find skills/using-karenina/references/ -name '*.md' | wc -l | tr -d ' ') files synced."