-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
81 lines (59 loc) · 1.55 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
manage = poetry run python src/manage.py
test = poetry run pytest --capture=fd --verbosity=0
testinparallel = $(test) --numprocesses auto
testwithcoverage = $(test) \
--cov=apps --cov=core \
--cov-report=term-missing:skip-covered \
--cov-fail-under=90
PORT := 7070
server:
$(manage) runserver $(PORT)
s:
make server
prodserver:
poetry run gunicorn core.wsgi:application --chdir src --workers 2 -b localhost:$(PORT) -e DEBUG=false
shell:
$(manage) shell
sqldebugshell:
$(manage) debugsqlshell
static:
$(manage) collectstatic --no-input
build_static:
make build_frontend
make static
build_frontend:
./scripts/build-frontend.sh
build_backend:
./scripts/build-backend.sh
test:
$(testinparallel)
poetry run pytest --dead-fixtures
testwithcoverage:
$(testwithcoverage)
testwithcoveragehtml:
$(testwithcoverage) --cov-report=html:htmlcov
opencoverage:
open ./htmlcov/index.html
fmt:
poetry run ruff format src tests
poetry run ruff check --select I --fix # sort imports
poetry run toml-sort pyproject.toml
lint:
$(manage) makemigrations --check --no-input --dry-run
poetry run ruff format --check src tests
poetry run ruff check src tests
poetry run toml-sort pyproject.toml --check
poetry run mypy src
validate_schema:
$(manage) spectacular --file schema.yaml --validate
generate_schema:
$(manage) spectacular --color --file schema.yaml
# docker
celery_restart:
docker compose restart celery_beat celery_worker
up:
docker compose up -d
upbuild:
docker compose up -d --build
upbuildnocache:
docker compose up -d --build --force-recreate