-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
132 lines (101 loc) · 4.63 KB
/
Makefile
File metadata and controls
132 lines (101 loc) · 4.63 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
.PHONY: help
# Check if 'uv' is installed
ifeq (, $(shell which uv))
$(error "uv is not installed. Please install it before running this Makefile.")
endif
# Default target - show available commands
help: # Show this help menu
@echo "Available make commands:"
@echo ""
@awk 'BEGIN {FS = ":.*# "; printf "%-20s %s\n", "Target", "Description"} /^[a-zA-Z_-]+:.*# / {printf "%-20s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
@echo ""
dev: # Install development dependencies and package in editable mode
uv sync --all-groups
uv pip install -e .
update:
uv sync --upgrade --all-groups
uv lock --upgrade
proto: # TODO: auto-generate proto files
@echo "TODO"
clean: # Remove build artifacts and cache files
rm -rf dist build *.egg-info
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
build: clean dev # Build PyPI Package
uv build
validate-wheel: build # Validate wheel packaging
@./scripts/validate-wheel.sh
security-scans: # Run security scans (informational)
uv pip install bandit[toml] --quiet
uv run bandit -r src/ -ll -x "**/tests/**" || echo "Security scan completed with issues (informational)"
# Code intelligence targets
index: # Generate code intelligence index
@echo "🔍 Indexing codebase..."
@uv run python scripts/ast_to_sqlite.py
query: # Query symbols (usage: make query SYMBOL=name)
@test -n "$(SYMBOL)" || (echo "Usage: make query SYMBOL=<name>" && exit 1)
@uv run python scripts/code_intel.py find $(SYMBOL)
query-classes: # List all classes in codebase
@uv run python scripts/code_intel.py list-all --kind class
query-all: # List all symbols in codebase
@uv run python scripts/code_intel.py list-all
# Test commands
test: # Run all tests in parallel (auto-detect cores)
uv run pytest tests/ -v -n auto
test-serial: # Run all tests serially (for debugging)
uv run pytest tests/ -v
test-unit: # Run unit tests in parallel (auto-detect cores)
uv run pytest tests/unit/ -v -n auto -m "not integration"
test-unit-serial: # Run unit tests serially (for debugging)
uv run pytest tests/unit/ -v -m "not integration"
test-integration: # Run integration tests in parallel (auto-detect cores)
uv run pytest tests/integration/ -v -n auto -m integration
test-integration-serial: # Run integration tests serially (for debugging)
uv run pytest tests/integration/ -v -m integration
test-coverage: # Run tests with coverage report (parallel by default)
uv run pytest tests/ -v -n auto -m "not serial" --cov=runpod_flash --cov-report=xml
uv run pytest tests/ -v -m "serial" --cov=runpod_flash --cov-append --cov-report=term-missing
test-coverage-serial: # Run tests with coverage report (serial execution)
uv run pytest tests/ -v --cov=runpod_flash --cov-report=term-missing
test-fast: # Run tests with fast-fail mode and parallel execution
uv run pytest tests/ -v -x --tb=short -n auto
test-workers: # Run tests with specific number of workers (e.g., WORKERS=4)
uv run pytest tests/ -v -n $(WORKERS)
# Linting commands
lint: # Check code with ruff
uv run ruff check .
lint-fix: # Fix code issues with ruff
uv run ruff check . --fix
format: # Format code with ruff
uv run ruff format .
format-check: # Check code formatting
uv run ruff format --check .
# Type checking
typecheck: # Check types with mypy
uv run mypy .
# Quality gates (used in CI)
quality-check: format-check lint test-coverage # Essential quality gate for CI (parallel by default)
quality-check-strict: format-check lint typecheck test-coverage # Strict quality gate with type checking (parallel by default)
quality-check-serial: format-check lint test-coverage-serial # Serial quality gate for debugging
# GitHub Actions specific targets
ci-quality-github: # Quality checks with GitHub Actions formatting (parallel by default)
@echo "::group::Code formatting check"
uv run ruff format --check .
@echo "::endgroup::"
@echo "::group::Linting"
uv run ruff check . --output-format=github
@echo "::endgroup::"
@echo "::group::Test suite with coverage"
uv run pytest tests/ --junitxml=pytest-results.xml -v -n auto -m "not serial" --cov=runpod_flash --cov-report=xml --cov-fail-under=0
uv run pytest tests/ --junitxml=pytest-results.xml -v -m "serial" --cov=runpod_flash --cov-append --cov-report=term-missing
@echo "::endgroup::"
ci-quality-github-serial: # Serial quality checks for GitHub Actions (for debugging)
@echo "::group::Code formatting check"
uv run ruff format --check .
@echo "::endgroup::"
@echo "::group::Linting"
uv run ruff check . --output-format=github
@echo "::endgroup::"
@echo "::group::Test suite with coverage (serial)"
uv run pytest tests/ --junitxml=pytest-results.xml -v --cov=runpod_flash --cov-report=term-missing
@echo "::endgroup::"