-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
94 lines (80 loc) · 2.58 KB
/
Makefile
File metadata and controls
94 lines (80 loc) · 2.58 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
.PHONY: install test lint format typecheck check clean coverage help sync build docs-serve docs-build
# Default target
help:
@echo "Available commands:"
@echo " make install - Install development dependencies with uv"
@echo " make sync - Sync dependencies with uv.lock"
@echo " make test - Run all tests"
@echo " make lint - Run code linting"
@echo " make typecheck - Run type checking with mypy"
@echo " make format - Format code with black and sort imports with isort"
@echo " make check - Run all checks (lint + typecheck + test)"
@echo " make clean - Clean up temporary files"
@echo " make coverage - Run tests with coverage report"
@echo " make build - Build the package"
@echo " make docs-serve - Serve docs locally for preview"
@echo " make docs-build - Build docs locally"
# Install development dependencies and sync with lock file
install:
uv sync --all-groups
# Sync dependencies without updating lock file
sync:
uv sync --all-groups
# Run all tests
test:
uv run pytest tests/ -v
# Run linting
lint:
uv run ruff check .
uv run black --check .
uv run isort --check-only .
# Run type checking
typecheck:
uv run mypy src/kanka tests --ignore-missing-imports
# Format code
format:
uv run black .
uv run isort .
uv run ruff check --fix .
# Run pre-commit hooks on all files
pre-commit:
uv run pre-commit run --all-files
# Run all checks
check: lint typecheck test
# Clean up temporary files
clean:
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
find . -type f -name "*.pyo" -delete
find . -type f -name "*.pyd" -delete
find . -type f -name ".coverage" -delete
find . -type d -name "*.egg-info" -exec rm -rf {} +
find . -type d -name ".pytest_cache" -exec rm -rf {} +
find . -type d -name ".ruff_cache" -exec rm -rf {} +
find . -type d -name ".mypy_cache" -exec rm -rf {} +
find . -type d -name "htmlcov" -exec rm -rf {} +
find . -type d -name "dist" -exec rm -rf {} +
find . -type d -name "build" -exec rm -rf {} +
# Run tests with coverage
coverage:
uv run pytest tests/ -v --cov=src/kanka --cov-report=html --cov-report=term
# Build the package
build:
uv build
# Serve docs locally for preview
docs-serve:
mv docs/README.md docs/index.md
uv run mkdocs serve || true
mv docs/index.md docs/README.md
# Build docs locally
docs-build:
mv docs/README.md docs/index.md
uv run mkdocs build --strict
mv docs/index.md docs/README.md
@for f in docs/*.md; do \
name=$$(basename "$$f"); \
if [ "$$name" != "README.md" ]; then \
cp "$$f" site/; \
fi; \
done
cp docs/README.md site/llms.txt