forked from harvard-edge/cs249r_book
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
178 lines (148 loc) · 5.54 KB
/
Makefile
File metadata and controls
178 lines (148 loc) · 5.54 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# TinyTorch Makefile
# ==================
# Simple commands for common development tasks.
#
# Usage:
# make help # Show all commands
# make test # Run all tests
# make preflight # Quick verification before work
# make release # Full release validation
#
.PHONY: help test preflight release clean lint
# Default target
help:
@echo ""
@echo "🔥 TinyTorch Development Commands"
@echo "=================================="
@echo ""
@echo "Quick Commands:"
@echo " make preflight Quick check (~1 min) - run before starting work"
@echo " make test Run main test suite"
@echo " make test-quick Fast smoke tests only (~30s)"
@echo ""
@echo "Release Validation:"
@echo " make release Full release validation (~10 min)"
@echo " make release-check Pre-release checklist"
@echo ""
@echo "Development:"
@echo " make lint Check code style"
@echo " make clean Remove generated files"
@echo " make setup Install development dependencies"
@echo ""
@echo "Testing Levels:"
@echo " make test-e2e-quick E2E quick tests (~30s)"
@echo " make test-e2e-module E2E module flow tests (~2min)"
@echo " make test-e2e-full E2E complete journey (~10min)"
@echo " make test-milestones Milestone learning tests (~90s)"
@echo ""
# ============================================================================
# QUICK COMMANDS (daily use)
# ============================================================================
# Quick preflight check - run this before starting work
preflight:
python -m tito.main dev preflight
# Quick preflight (faster)
preflight-quick:
python -m tito.main dev preflight --quick
# Standard test suite
test:
python -m pytest tests/ -v --ignore=tests/e2e --ignore=tests/milestones -q
# Fast smoke tests only
test-quick:
python -m pytest tests/e2e/test_user_journey.py -k quick -v
# ============================================================================
# E2E TESTING (by level)
# ============================================================================
# E2E quick verification (~30 seconds)
test-e2e-quick:
python -m pytest tests/e2e/test_user_journey.py -k quick -v
# E2E module workflow tests (~2 minutes)
test-e2e-module:
python -m pytest tests/e2e/test_user_journey.py -k module_flow -v
# E2E milestone tests
test-e2e-milestone:
python -m pytest tests/e2e/test_user_journey.py -k milestone_flow -v
# E2E complete journey (~10 minutes)
test-e2e-full:
python -m pytest tests/e2e/test_user_journey.py -v
# ============================================================================
# SPECIALIZED TESTS
# ============================================================================
# Milestone learning verification (actually trains models, ~90 seconds)
test-milestones:
python -m pytest tests/milestones/test_learning_verification.py -v
# CLI tests
test-cli:
python -m pytest tests/cli/ -v
# Module-specific tests
test-module-%:
python -m pytest tests/$*/ -v
# ============================================================================
# RELEASE VALIDATION
# ============================================================================
# Full release validation - run this before any release
release:
python -m tito.main dev preflight --release
# Full release validation with all tests
release-full:
python -m tito.main dev preflight --release
python -m pytest tests/ -v --tb=short
# Pre-release checklist (manual verification)
release-check:
@echo ""
@echo "📋 Pre-Release Checklist"
@echo "========================"
@echo ""
@echo "Run each of these commands and verify they pass:"
@echo ""
@echo " 1. make preflight # Quick sanity check"
@echo " 2. make test-e2e-full # E2E user journey"
@echo " 3. make test-milestones # ML actually learns"
@echo " 4. make test # Full test suite"
@echo ""
@echo "Manual checks:"
@echo " □ README.md is up to date"
@echo " □ Version number bumped in pyproject.toml"
@echo " □ CHANGELOG updated"
@echo " □ Git status is clean"
@echo ""
@echo "Then run: make release"
@echo ""
# ============================================================================
# DEVELOPMENT UTILITIES
# ============================================================================
# Install development dependencies
setup:
pip install -e ".[dev]"
pip install pytest pytest-cov rich
# Lint code
lint:
python -m py_compile tito/main.py
@echo "✓ No syntax errors"
# Clean generated files
clean:
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete 2>/dev/null || true
find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
@echo "✓ Cleaned generated files"
# ============================================================================
# CI/CD TARGETS (used by GitHub Actions)
# ============================================================================
# CI smoke test (fast, for every commit)
ci-smoke:
python -m tito.main dev preflight --quick --ci
# CI standard test (for PRs)
ci-standard:
python -m tito.main dev preflight --ci
python -m pytest tests/e2e/ -k quick --tb=short -q
# CI full test (for releases)
ci-full:
python -m tito.main dev preflight --full --ci
python -m pytest tests/ -v --ignore=tests/milestones --tb=short
# CI release validation (comprehensive)
ci-release:
python -m tito.main dev preflight --release --ci
# CI JSON output (for automation/parsing)
ci-json:
python -m tito.main dev preflight --json