-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (51 loc) · 2.29 KB
/
Makefile
File metadata and controls
62 lines (51 loc) · 2.29 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
UV := uv run --no-sync
.DEFAULT_GOAL := help
.PHONY: help setup format lint typecheck test test_e2e test_rf5 build clean
help:
@echo "═══════════════════════════════════════════════════════════════════════════════"
@echo " LibreYOLO Makefile"
@echo "═══════════════════════════════════════════════════════════════════════════════"
@echo ""
@echo "Development Commands:"
@echo " setup - Create venv and install package + dev dependencies"
@echo " format - Format code with ruff"
@echo " lint - Run linter"
@echo " typecheck - Run type checker"
@echo " test - Run fast unit tests (no weights needed)"
@echo " test_e2e - Run all e2e tests (needs GPU + model weights)"
@echo " test_rf5 - Run RF5 training benchmark tests"
@echo " build - Build package"
@echo " clean - Remove build and test cache artifacts"
setup:
uv sync --dev
@echo ""
@echo "✅ Setup complete! To activate the virtual environment, run:"
@echo " source .venv/bin/activate"
format:
$(UV) ruff format
lint:
$(UV) ruff check --fix
typecheck:
$(UV) ty check
test:
$(UV) pytest
test_e2e: clean
@echo "Running each test file in its own process (avoids CUDA driver state corruption)..."
@for f in tests/e2e/test_*.py; do \
$(UV) pytest "$$f" -m "e2e and not rf5" -v; \
rc=$$?; if [ $$rc -ne 0 ] && [ $$rc -ne 5 ]; then exit $$rc; fi; \
done
test_rf5: clean
$(UV) pytest tests/e2e/test_rf5_training.py -m rf5 -v
build:
@echo "📦 Building package..."
@mkdir -p dist
uv build --out-dir dist/
@echo "✅ Package built:"
@ls -lh dist/*.whl
clean:
@echo "🧹 Cleaning build and test cache artifacts..."
@rm -rf dist *.egg-info .ruff_cache .pytest_cache
@rm -rf /tmp/pytest-of-$(USER) 2>/dev/null || true
@find . -type d -name '__pycache__' -exec rm -rf {} +
@echo "✅ Clean complete!"