-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
93 lines (69 loc) · 1.76 KB
/
Copy pathjustfile
File metadata and controls
93 lines (69 loc) · 1.76 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
default:
@just --list
# Run the Flask development server
run:
python app.py
# Run cloudflaredtunnel
tunnel:
./start_tunnel.sh
# Run with auto-reload using flask run
dev:
flask --app app run --debug --host 0.0.0.0 --port 5000
# Run the RQ worker for ML inference (run in separate terminal)
rq-worker:
rq worker ml
# Database migrations
migrate:
flask db upgrade
migration message="":
flask db migrate -m "{{message}}"
migration-diff:
flask db migrate
db-rollback:
flask db downgrade
db-reset:
@echo "⚠️ This will DELETE all data in test_sessions, test_inputs, and esp32_devices tables!"
flask db downgrade
flask db upgrade
# Run tests
test:
pytest
test-watch:
ptw
test-coverage:
pytest --cov=. --cov-report=term-missing --cov-report=html
# Linting and formatting
lint:
ruff check .
format:
ruff check --fix . && isort .
typecheck:
pyright .
# Install dependencies
install:
pip install -r requirements.txt
install-dev:
pip install -r requirements-dev.txt
# Clean up
clean-pycache:
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete 2>/dev/null || true
clean-coverage:
rm -rf .coverage htmlcov/ .pytest_cache/ .hypothesis/ 2>/dev/null || true
clean: clean-pycache clean-coverage
@echo "Cleaned up"
# Health check
health:
curl http://localhost:5000/health
# Database console
db-console:
psql $(grep DATABASE_URL .env | cut -d= -f2-)
# Create initial migration after model changes
prepare-migration:
just db-rollback
just migration-diff
just migrate
# Full setup for fresh clone
setup: install install-dev migrate
@echo "✓ Project setup complete!"
@echo "Run 'just dev' to start the server"