-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
104 lines (77 loc) · 2.83 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
SQLALCHEMY_DATABASE_URI_TESTING="sqlite+aiosqlite:///./instance/testing.db"
CELERY_BROKER_URL_TESTING="sqla+sqlite:///instance/testing-worker.db"
CELERY_RESULT_BACKEND_TESTING="db+sqlite:///instance/testing-worker.db"
show-routes:
@python app/cli.py route show
requirements-dev:
@pip install --upgrade pip
@pip install setuptools wheel
@pipenv install --dev
@pip install -e .
requirements:
@pip install --upgrade pip
@pip install setuptools wheel
@pipenv install
@pip install -e .
runserver-dev:
@uvicorn app.main:app --reload
runserver:
@uvicorn app.main:app
runcelery:
@celery -A app.worker.celery worker -E -B --loglevel=INFO --pool=prefork
runcelery-test:
@export TESTING=1 && \
export CELERY_BROKER_URL=$(CELERY_BROKER_URL_TESTING) && \
export CELERY_RESULT_BACKEND=$(CELERY_RESULT_BACKEND_TESTING) && \
celery -A app.worker.celery worker -E -B --loglevel=INFO --pool=prefork
runflower:
@celery -A app.worker.celery flower --port=5555
outdated:
@pip list --outdated
test:
@export SQLALCHEMY_DATABASE_URI=$(SQLALCHEMY_DATABASE_URI_TESTING) && \
export TESTING=1 && \
export CELERY_BROKER_URL=$(CELERY_BROKER_URL_TESTING) && \
export CELERY_RESULT_BACKEND=$(CELERY_RESULT_BACKEND_TESTING) && \
py.test --disable-pytest-warnings
test-matching:
@export SQLALCHEMY_DATABASE_URI=$(SQLALCHEMY_DATABASE_URI_TESTING) && \
export TESTING=1 && \
export CELERY_BROKER_URL=$(CELERY_BROKER_URL_TESTING) && \
export CELERY_RESULT_BACKEND=$(CELERY_RESULT_BACKEND_TESTING) && \
py.test -sk $(test)
test-matching-log:
@export SQLALCHEMY_DATABASE_URI=$(SQLALCHEMY_DATABASE_URI_TESTING) && \
export TESTING=1 && \
export CELERY_BROKER_URL=$(CELERY_BROKER_URL_TESTING) && \
export CELERY_RESULT_BACKEND=$(CELERY_RESULT_BACKEND_TESTING) && \
py.test -sk $(test) --log-cli-level=INFO
coverage:
@export SQLALCHEMY_DATABASE_URI=$(SQLALCHEMY_DATABASE_URI_TESTING) && \
export TESTING=1 && \
export CELERY_BROKER_URL=$(CELERY_BROKER_URL_TESTING) && \
export CELERY_RESULT_BACKEND=$(CELERY_RESULT_BACKEND_TESTING) && \
py.test --cov=app --cov-report=term-missing --cov-fail-under=80 tests/
migration-up:
@alembic upgrade head
migration-down:
@alembic downgrade -1
flake8:
@flake8 --show-source app tests alembic
check-import:
@isort app tests alembic --multi-line=3 --trailing-comma --force-grid-wrap=0 --use-parentheses --check-only
fix-import:
isort app tests alembic --multi-line=3 --trailing-comma --force-grid-wrap=0 --use-parentheses
check-black:
@black app tests alembic --line-length 79 --check
fix-black:
black app tests alembic --line-length 79
check-bandit:
@bandit -r -f custom -x tests app tests alembic
check-safety:
safety check --file=requirements/production.txt
check-dead-fixtures:
@pytest --dead-fixtures
lint: fix-import fix-black flake8
check-lint: check-import check-black check-bandit flake8 check-dead-fixtures