-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (39 loc) · 944 Bytes
/
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
.DEFAULT_GOAL := all
DIRS = src/
pdm = pdm run
isort = isort
black = black
mypy = mypy
flake8 = flake8
pyupgrade = pyupgrade --py311-plus
.PHONY: format
format:
pre-commit run
$(pdm) ruff format $(DIRS)
$(pdm) ruff check $(DIRS)
$(pdm) mypy $(DIRS)
.PHONY: export-dependencies
export-dependencies:
pdm export -f requirements --output requirements/requirements.txt --prod
pdm export -f requirements --output requirements/requirements-dev.txt --dev
.PHONY: database
database:
docker compose up database -d
.PHONY: test
test:
$(pdm) pytest --cov=app --cov-report=html
.PHONY: migrate
migrate:
@read -p "Enter migration message: " message; \
$(pdm) alembic revision --autogenerate -m "$$message"
.PHONY: downgrade
downgrade:
$(pdm) alembic downgrade -1
.PHONY: upgrade
upgrade:
$(pdm) alembic upgrade +1
.PHONY: upgrade-offline
upgrade-offline:
$(pdm) alembic upgrade head --sql
.PHONY: all
all: format export-dependencies