-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (39 loc) · 1.36 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
VENV = .venv
CODE = \
admin \
api \
db
JOBS ?= 4
makemigrations:
poetry run alembic revision --autogenerate
migrate:
poetry run alembic upgrade head
lint:
$(VENV)/bin/black --check $(CODE)
$(VENV)/bin/flake8 --jobs $(JOBS) --statistics $(CODE)
$(VENV)/bin/mypy --config-file mypy.ini $(CODE)
pretty:
$(VENV)/bin/black --target-version py311 --skip-string-normalization $(CODE)
$(VENV)/bin/isort $(CODE)
$(VENV)/bin/unify --in-place --recursive $(CODE)
lint_windows:
$(VENV)/Scripts/black --check $(CODE)
$(VENV)/Scripts/flake8 --jobs $(JOBS) --statistics $(CODE)
pretty_windows:
$(VENV)/Scripts/black --target-version py311 --skip-string-normalization $(CODE)
$(VENV)/Scripts/isort $(CODE)
$(VENV)/Scripts/unify --in-place --recursive $(CODE)
run_admin:
poetry run python -m admin.run_admin
run_celery:
poetry run celery -A api.tasks.tasks worker --loglevel=info
run_celery_windows:
poetry run celery -A api.tasks.tasks worker --loglevel=info --logfile=celery.log --pool=solo
run_celery_beat:
poetry run celery -A api.tasks.tasks beat
run_api:
poetry run uvicorn api.run_api:app --host 127.0.0.1 --port 8000
run_api_prod:
poetry run gunicorn api.run_api:app --workers 4 --preload --worker-class uvicorn.workers.UvicornWorker --bind=0.0.0.0:8000
run_admin_prod:
poetry run gunicorn admin.run_admin:app --workers 4 --preload --bind=0.0.0.0:5000