-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
56 lines (43 loc) · 1.16 KB
/
Makefile
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
all:
# docker
up:
@echo "bringing up project...."
docker compose up
down:
@echo "bringing down project...."
docker compose down
bash:
@echo "connecting to container...."
docker compose exec backend bash
# alembic
alembic-scaffold:
@echo "scaffolding migrations folder..."
docker compose exec backend alembic init -t async migrations
alembic-init:
@echo "initializing first migration...."
docker compose exec backend alembic revision --autogenerate -m "init"
alembic-make-migrations:
@echo "creating migration file...."
docker compose exec backend alembic revision --autogenerate -m "add year"
alembic-migrate:
@echo "applying migration...."
docker compose exec backend alembic upgrade head
# lint
# test:
# @echo "running pytest...."
# docker compose exec backend pytest --cov-report xml --cov=src tests/
lint:
@echo "running ruff...."
docker compose exec backend ruff src
black:
@echo "running black...."
docker compose exec backend black .
mypy:
@echo "running mypy...."
docker compose exec backend mypy src/
# misc
check: BREW-exists
BREW-exists: ; @which brew > /dev/null
hooks: check
@echo "installing pre-commit hooks...."
pre-commit install