This repository was archived by the owner on Feb 18, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
132 lines (108 loc) · 4.52 KB
/
Makefile
File metadata and controls
132 lines (108 loc) · 4.52 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
# AASMS Makefile
# Author: Bradley R. Kinnard
#
# Provides local equivalents of CI checks for contributors without GitHub access.
.PHONY: help install install-dev lint type-check test test-ci test-cov security clean
PYTHON := python3
VENV := .venv
PIP := $(VENV)/bin/pip
PYTEST := $(VENV)/bin/pytest
RUFF := $(VENV)/bin/ruff
MYPY := $(VENV)/bin/mypy
BANDIT := $(VENV)/bin/bandit
help:
@echo "AASMS Development Commands"
@echo "=========================="
@echo ""
@echo "Setup:"
@echo " make install Install production dependencies"
@echo " make install-dev Install all development dependencies"
@echo ""
@echo "Testing:"
@echo " make test Run all tests"
@echo " make test-ci Run full CI suite locally (lint + type + test + security)"
@echo " make test-cov Run tests with coverage report"
@echo ""
@echo "Code Quality:"
@echo " make lint Run ruff linter and formatter check"
@echo " make type-check Run mypy type checking"
@echo " make security Run bandit security scan"
@echo " make format Auto-format code with ruff"
@echo ""
@echo "Utilities:"
@echo " make clean Remove build artifacts and caches"
@echo " make check-gpu Check GPU and Docker capabilities"
@echo " make benchmark Run reproducible benchmark (5 cycles)"
# =============================================================================
# SETUP
# =============================================================================
$(VENV):
$(PYTHON) -m venv $(VENV)
install: $(VENV)
$(PIP) install --upgrade pip
$(PIP) install -r requirements.txt
install-dev: $(VENV)
$(PIP) install --upgrade pip
$(PIP) install -r requirements.txt
$(PIP) install -r requirements-dev.txt
# =============================================================================
# TESTING
# =============================================================================
test:
$(PYTEST) tests/ -v
test-cov:
$(PYTEST) tests/ -v --cov=. --cov-report=term-missing --cov-report=html
test-ci: lint type-check test security
@echo ""
@echo "✓ All CI checks passed!"
# =============================================================================
# CODE QUALITY
# =============================================================================
lint:
@echo "Running ruff linter..."
$(RUFF) check .
@echo "Checking formatting..."
$(RUFF) format --check .
format:
$(RUFF) format .
$(RUFF) check --fix .
type-check:
@echo "Running mypy type checker..."
$(MYPY) --ignore-missing-imports utils/ evaluator/ orchestrator/
security:
@echo "Running bandit security scan..."
$(BANDIT) -r utils/ evaluator/ orchestrator/ -ll -q
# =============================================================================
# UTILITIES
# =============================================================================
clean:
rm -rf __pycache__ .pytest_cache .mypy_cache .ruff_cache htmlcov .coverage
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete
check-gpu:
@echo "Checking GPU and Docker capabilities..."
$(PYTHON) -c "from utils.gpu_docker import get_system_isolation_report; import pprint; pprint.pprint(get_system_isolation_report())"
benchmark:
$(PYTHON) scripts/benchmark.py --cycles 5 --seed 42
verify-locality:
@echo "Verifying local-only execution..."
@echo "1. Checking Ollama endpoint..."
@curl -s http://localhost:11434/api/tags > /dev/null && echo " ✓ Ollama running locally" || echo " ✗ Ollama not running"
@echo "2. Checking GPU detection..."
@$(PYTHON) -c "from utils.gpu_docker import detect_gpu; g = detect_gpu(); print(f' ✓ GPU: {g.name}' if g.available else ' ✓ CPU-only mode')"
@echo "3. Checking Docker isolation..."
@docker run --rm --network=none alpine echo " ✓ Network isolation works" 2>/dev/null || echo " ⚠ Docker not available (optional)"
@echo "4. Checking no cloud endpoints in code..."
@! grep -r "api.openai.com\|api.anthropic.com\|googleapis.com" utils/ evaluator/ orchestrator/ 2>/dev/null && echo " ✓ No cloud API endpoints found" || echo " ✗ Cloud endpoints detected!"
@echo ""
@echo "Locality verification complete."
proof:
@echo "Generating reproducibility proof..."
$(PYTHON) scripts/benchmark.py --cycles 10 --seed 42 --output results/proof_run_$$(date +%Y%m%d).json
@echo "Proof generated. See results/ directory."
# =============================================================================
# QUICK ALIASES
# =============================================================================
ci: test-ci
check: lint type-check
all: install-dev test-ci