-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (67 loc) · 2.97 KB
/
Makefile
File metadata and controls
79 lines (67 loc) · 2.97 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
.PHONY: help install build test lint fmt clean dev
help:
@echo "StrataRouter Development Commands"
@echo ""
@echo "Setup:"
@echo " make install Install in development mode (Rust core + Python SDK)"
@echo " make dev Alias for install"
@echo ""
@echo "Build:"
@echo " make build Build Rust core (release) + Python wheel"
@echo ""
@echo "Quality:"
@echo " make test Run all tests (Rust + Python)"
@echo " make lint Run all linters (clippy + ruff + mypy)"
@echo " make fmt Auto-format all code (cargo fmt + black)"
@echo ""
@echo "Housekeeping:"
@echo " make clean Remove build artifacts"
@echo ""
# ── Setup ─────────────────────────────────────────────────────────────────────
install:
@echo "→ Installing maturin..."
pip install maturin
@echo "→ Building Rust core and installing Python package..."
cd python && maturin develop --release
@echo "→ Installing dev dependencies..."
cd python && pip install -e ".[dev]"
@echo "✓ Installation complete"
dev: install
# ── Build ─────────────────────────────────────────────────────────────────────
build:
@echo "→ Building Rust core (release)..."
cd core && cargo build --release
@echo "→ Building Python wheel..."
cd python && maturin build --release
@echo "✓ Build complete"
# ── Quality ───────────────────────────────────────────────────────────────────
test:
@echo "→ Running Rust tests..."
cd core && cargo test --release
@echo "→ Running Python tests (python/tests/)..."
cd python && pytest tests/ -v --tb=short
@echo "→ Running root-level tests (tests/)..."
pytest tests/ -v --tb=short
@echo "✓ All tests passed"
lint:
@echo "→ cargo clippy..."
cd core && cargo clippy -- -D warnings
@echo "→ ruff..."
cd python && ruff check stratarouter/
@echo "→ mypy..."
cd python && mypy stratarouter/ --ignore-missing-imports || true
@echo "✓ Lint complete"
fmt:
@echo "→ cargo fmt..."
cd core && cargo fmt
@echo "→ black..."
cd python && black stratarouter/ tests/
@echo "✓ Format complete"
# ── Housekeeping ──────────────────────────────────────────────────────────────
clean:
@echo "→ Cleaning build artifacts..."
rm -rf core/target/
rm -rf python/build/ python/dist/ python/*.egg-info
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -name "*.so" -o -name "*.pyd" -o -name "*.dylib" | xargs rm -f 2>/dev/null || true
@echo "✓ Clean complete"