-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
109 lines (85 loc) · 3.95 KB
/
Copy pathMakefile
File metadata and controls
109 lines (85 loc) · 3.95 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
# ============================================================
# Makefile — Developer shortcuts
# ============================================================
# Usage:
# make install Install all dependencies
# make run Start the API server (local)
# make docker-up Start the full stack with Docker
# make test Run the test suite
# make type-check Run mypy strict type checking
# make clean Remove build artifacts
# ============================================================
.PHONY: install run docker-up docker-down test type-check lint clean help
# ── Setup ─────────────────────────────────────────────────────
install:
@echo "Installing dependencies..."
pip install -r requirements.txt
@echo "✓ Done"
# ── Run ───────────────────────────────────────────────────────
run:
@echo "Starting API server on http://localhost:8000"
@echo "Swagger UI: http://localhost:8000/docs"
uvicorn api.main:app --reload --host 0.0.0.0 --port 8000
run-worker:
@echo "Starting standalone worker daemon..."
python worker_daemon.py
run-demo:
@echo "Running full demo (no HTTP, no Redis)..."
python main.py
# ── Docker ────────────────────────────────────────────────────
docker-up:
@echo "Starting full stack: Redis + API + Worker"
docker-compose up --build
docker-up-detached:
docker-compose up --build -d
@echo "Stack running in background."
@echo " API: http://localhost:8000/docs"
@echo " Redis UI: docker-compose --profile debug up"
docker-down:
docker-compose down -v
@echo "✓ Stack stopped and volumes removed"
docker-logs:
docker-compose logs -f api worker
docker-redis-cli:
docker exec -it tq-redis redis-cli
# ── Testing ───────────────────────────────────────────────────
test:
@echo "Running test suite..."
python -m pytest tests/ -v --tb=short
test-original:
@echo "Running original test suite (no pytest)..."
python -m unittest tests.test_system -v
test-api:
@echo "Running API integration tests..."
python -m pytest tests/test_api.py -v --tb=short
test-all:
@echo "Running ALL tests..."
python -m pytest tests/ -v --tb=short -x
# ── Quality ───────────────────────────────────────────────────
type-check:
@echo "Running mypy strict type checking..."
mypy . --ignore-missing-imports --exclude venv
lint:
@echo "Linting with ruff..."
ruff check . --fix
# ── Utilities ─────────────────────────────────────────────────
clean:
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -name "*.pyc" -delete 2>/dev/null || true
find . -name "*.pyo" -delete 2>/dev/null || true
find . -name ".mypy_cache" -exec rm -rf {} + 2>/dev/null || true
find . -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true
@echo "✓ Cleaned"
help:
@echo ""
@echo " Task Queue System — Make targets"
@echo " ─────────────────────────────────"
@echo " make install Install dependencies"
@echo " make run Start API server locally"
@echo " make run-demo Run the demo script (no HTTP)"
@echo " make docker-up Full stack via Docker"
@echo " make docker-down Stop Docker stack"
@echo " make test Run test suite"
@echo " make type-check mypy strict check"
@echo " make clean Remove build artifacts"
@echo ""