Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (49 loc) · 1.84 KB
/
Copy pathMakefile
File metadata and controls
64 lines (49 loc) · 1.84 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
.PHONY: help setup dev test lint format build docker-up docker-down migrate download-weights fetch-data demo wipe-data
PYTHON ?= python
NPM ?= npm
help:
@echo "OphthalmoAI Build and Development Automation"
@echo "Targets:"
@echo " setup Install backend and frontend dependencies"
@echo " dev Start local backend development server"
@echo " test Run all backend and frontend tests"
@echo " lint Run ruff and frontend linter"
@echo " format Format codebase using ruff"
@echo " build Build production frontend assets"
@echo " docker-up Launch system using Docker Compose v2"
@echo " docker-down Stop Docker Compose containers"
@echo " migrate Apply database migrations"
@echo " download-weights Verify and download model weight checkpoints"
@echo " fetch-data Verify dataset manifest and sources"
@echo " demo Run end-to-end API smoke test verification"
@echo " wipe-data Wipe local SQLite database fixtures"
setup:
$(PYTHON) -m pip install -e ".[dev]"
cd frontend && $(NPM) install
dev:
uvicorn backend.main:app --host 0.0.0.0 --port 8000 --reload
test:
$(PYTHON) -m pytest tests/
cd frontend && $(NPM) test -- --run
lint:
$(PYTHON) -m ruff check backend
$(PYTHON) -m mypy backend
cd frontend && $(NPM) run lint
format:
$(PYTHON) -m ruff format backend
build:
cd frontend && $(NPM) run build
docker-up:
docker compose up -d --build
docker-down:
docker compose down
migrate:
alembic upgrade head
download-weights:
$(PYTHON) scripts/download_weights.py
fetch-data:
$(PYTHON) scripts/fetch_dataset.py
demo:
$(PYTHON) scripts/smoke_test_api.py
wipe-data:
$(PYTHON) -c "import os; [os.remove(f) for f in ('ophthalmoai.db', 'test_ophthalmoai.db') if os.path.exists(f)]; print('Local development databases wiped.')"