-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
90 lines (73 loc) · 2.3 KB
/
Makefile
File metadata and controls
90 lines (73 loc) · 2.3 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
.PHONY: help check lint-check lint-fix format-check format-fix type-check test fix build build-wheel clean publish-test
# Default target
help:
@echo "Available commands:"
@echo ""
@echo " Checks (CI):"
@echo " make check - Run all checks (lint, format, type)"
@echo " make lint-check - Run linter (ruff check)"
@echo " make format-check - Check code formatting (ruff format --check)"
@echo " make type-check - Run type checker (mypy)"
@echo " make test - Run tests (pytest)"
@echo ""
@echo " Fixes:"
@echo " make fix - Fix all auto-fixable issues (lint + format)"
@echo " make lint-fix - Fix linting issues (ruff check --fix)"
@echo " make format-fix - Format code (ruff format)"
@echo ""
@echo " Build:"
@echo " make build - Build sdist and wheel"
@echo " make build-wheel - Build wheel only"
@echo " make clean - Remove build artifacts"
@echo ""
@echo " Publish:"
@echo " make publish-test - Build and upload to TestPyPI"
# === Checks ===
check: lint-check format-check type-check
@echo "✓ All checks passed"
lint-check:
@echo "Running linter..."
@uv run ruff check .
@echo "✓ Lint check passed"
format-check:
@echo "Checking format..."
@uv run ruff format --check .
@echo "✓ Format check passed"
type-check:
@echo "Running type checker..."
@uv run mypy calfkit/
@echo "✓ Type check passed"
test:
@echo "Running tests..."
@uv run pytest tests/ -v
# === Fixes ===
fix: lint-fix format-fix
@echo "✓ All auto-fixes applied"
lint-fix:
@echo "Fixing lint issues..."
@uv run ruff check . --fix
@echo "✓ Lint fixes applied"
format-fix:
@echo "Formatting code..."
@uv run ruff format .
@echo "✓ Format fixes applied"
# === Build ===
build: clean
@echo "Building sdist and wheel..."
@uv build
@echo "✓ Build complete (output in dist/)"
build-wheel: clean
@echo "Building wheel..."
@uv build --wheel
@echo "✓ Wheel build complete (output in dist/)"
clean:
@echo "Cleaning build artifacts..."
@rm -rf dist/ build/ *.egg-info
@echo "✓ Clean complete"
# === Publish ===
publish-test: clean
@echo "Building and uploading to TestPyPI..."
@uv build
@uv run twine upload --repository testpypi dist/*
@echo "✓ Published to TestPyPI"
@echo " View at: https://test.pypi.org/project/calfkit/"