Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (43 loc) · 1.6 KB
/
Copy pathMakefile
File metadata and controls
59 lines (43 loc) · 1.6 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
PYTHON ?= python3.14
VENV := .venv
DATABASE_URL ?= postgresql+psycopg://records:records@localhost:54329/records
TEST_DATABASE_URL ?= postgresql+psycopg://records:records@localhost:54329/records_test
MOBILE_RUNTIME_TEST_PORT ?= 4174
.PHONY: venv db-up db-down dev migrate migrate-test migration test lint format check lock frontend-install frontend-dev frontend-check
venv:
$(PYTHON) -m venv $(VENV)
$(VENV)/bin/python -m pip install --upgrade pip
$(VENV)/bin/python -m pip install -r requirements.lock
db-up:
docker compose up -d --wait db
db-down:
docker compose down
dev:
DATABASE_URL="$(DATABASE_URL)" $(VENV)/bin/uvicorn app.main:app --reload
migrate:
DATABASE_URL="$(DATABASE_URL)" $(VENV)/bin/alembic upgrade head
migrate-test:
DATABASE_URL="$(TEST_DATABASE_URL)" ENVIRONMENT=test $(VENV)/bin/alembic upgrade head
migration:
@test -n "$(name)" || (echo "name is required" && exit 1)
DATABASE_URL="$(DATABASE_URL)" $(VENV)/bin/alembic revision --autogenerate -m "$(name)"
test:
DATABASE_URL="$(TEST_DATABASE_URL)" $(VENV)/bin/pytest
lint:
$(VENV)/bin/ruff check .
format:
$(VENV)/bin/ruff format .
check: migrate migrate-test lint test
lock:
$(VENV)/bin/python -m pip install -r requirements.in
$(VENV)/bin/python -m pip freeze > requirements.lock
frontend-install:
npm ci
frontend-dev:
npm run dev
frontend-check:
npm run check:runtime
npx tsc --noEmit
npm run build
# Spring-connected scenarios stay in the full npm run test:runtime suite.
MOBILE_RUNTIME_TEST_PORT="$(MOBILE_RUNTIME_TEST_PORT)" npx playwright test --grep-invert "responsive signup|notification preferences|cached assignments"