-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
87 lines (57 loc) · 1.17 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
PROJ_PATH ?= app
TESTS_PATH ?= tests
MIGRATION_PATH ?= migrations
DC ?= docker compose
### linters ###
.PHONY: black
black:
black ${PROJ_PATH} ${TESTS_PATH} ${MIGRATION_PATH}
.PHONY: ruff
ruff:
ruff ${PROJ_PATH} ${TESTS_PATH} ${MIGRATION_PATH}
.PHONY: ruff_fix
ruff_fix:
ruff --fix ${PROJ_PATH} ${TESTS_PATH} ${MIGRATION_PATH}
.PHONY: mypy
mypy:
mypy ${PROJ_PATH} ${TESTS_PATH}
.PHONY: bandit
bandit:
bandit -c pyproject.toml --silent -r ${PROJ_PATH}
.PHONY: check
check: black ruff mypy bandit
### tests ###
.PHONY: tests
tests:
pytest --cov-report term-missing --cov=app --durations=3
pytest --dead-fixtures
### poerty wrappers ###
.PHONY: install
install:
poetry install
.PHONY: update
update:
poetry update
### local dev ###
.PHONY: up
up:
${DC} up --build -d
.PHONY: up_live
up_live:
${DC} up --build
.PHONY: up_db
up_db:
${DC} up --build -d mongo
.PHONY: down
down:
${DC} down
.PHONY: logs
logs:
${DC} logs -f -n 200
### migrations ###
.PHONY: migration_create
migration_create:
mongodb-migrate-create --description initial
.PHONY: migration_upgrade
migration_upgrade:
mongodb-migrate --url 'mongodb://localhost:27017/test'