forked from modern-python/litestar-sqlalchemy-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
69 lines (54 loc) · 1.98 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
57
58
59
60
61
62
63
64
65
66
67
68
69
## ---------------------------------------------------------------
## Quest Manager
## ---------------------------------------------------------------
## Local environment commands:
## ---------------------------------------------------------------
.DEFAULT_GOAL := run_tests
## run: start app in docker
run: down
docker-compose up
## pytest: run pytest (with down/up migrations before)
pytest:
docker-compose run app ./docker-entrypoint.sh pytest
## run_tests: run isort, black, pylint, mypy, pytest
run_tests:
docker-compose run app ./docker-entrypoint.sh tests
## migration: create alembic migration
migration:
docker-compose run app alembic revision --autogenerate
## upgrade: downgrade alembic migrations
upgrade:
docker-compose run app alembic upgrade head
## downgrade: downgrade alembic migrations
downgrade:
docker-compose run app alembic downgrade base
down:
docker-compose down --remove-orphans
## ---------------------------------------------------------------
## Requirements managing: pip-tools required to be installed and
## pip-compile command required to be available
## ---------------------------------------------------------------
## pip-compile: compile all requirements
# https://github.com/jazzband/pip-tools/issues/1092#issuecomment-632584777
pip-compile: prepare-constraints
pip-compile constraints.in
pip-compile requirements.in
pip-compile requirements.dev.in
## pip-upgrade: upgrade all requirements
pip-upgrade: prepare-constraints
rm -f constraints.txt requirements.txt requirements.dev.txt
touch constraints.txt
pip-compile constraints.in
pip-compile requirements.in
pip-compile requirements.dev.in
prepare-constraints: check-pip-compile
rm -f constraints.in
touch constraints.txt
cat requirements.*.in > constraints.in
## pip-sync: sync requirements in local environment
pip-sync: check-pip-compile
pip-sync requirements.txt requirements.dev.txt
check-pip-compile:
@which pip-compile > /dev/null
help:
@sed -ne '/@sed/!s/## //p' $(MAKEFILE_LIST)