-
Notifications
You must be signed in to change notification settings - Fork 6
/
makefile
73 lines (56 loc) · 1.81 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
ARGUMENTS = $(filter-out $@,$(MAKECMDGOALS)) $(filter-out --,$(MAKEFLAGS))
clean:
-find . -type f -name "*.pyc" -delete
-find . -type d -name "__pycache__" -delete
# configuration for black and isort is in pyproject.toml
autoformat:
isort $(PWD)
black $(PWD)
checks:
isort $(PWD) --check
black $(PWD) --check --verbose
flake8 .
pytest:
ENV_FILES='secrets-do-not-commit,test,dev' pytest $(ARGUMENTS)
pytest_codecov:
ENV_FILES='secrets-do-not-commit,test,dev' \
pytest \
--junitxml=test-reports/junit.xml \
--cov-config=.coveragerc \
--cov-report=term \
--cov=. \
--codecov \
$(ARGUMENTS)
# Usage: make pytest_single <path_to_file>::<method_name>
pytest_single:
ENV_FILES='secrets-do-not-commit,test,dev' \
pytest \
$(ARGUMENTS)
--junit-xml=./results/pytest_unit_report.xml \
--cov-config=.coveragerc \
--cov-report=html \
--cov=. \
manage:
ENV_FILES='secrets-do-not-commit,dev' ./manage.py $(ARGUMENTS)
webserver:
ENV_FILES='secrets-do-not-commit,dev' python manage.py runserver 0.0.0.0:8000 $(ARGUMENTS)
requirements:
pip-compile requirements.in
pip-compile requirements_test.in
install_requirements:
pip install -r requirements_test.txt
css:
./node_modules/.bin/gulp sass
secrets:
@if [ ! -f ./conf/env/secrets-do-not-commit ]; \
then sed -e 's/#DO NOT ADD SECRETS TO THIS FILE//g' conf/env/secrets-template > conf/env/secrets-do-not-commit \
&& echo "Created conf/env/secrets-do-not-commit"; \
else echo "conf/env/secrets-do-not-commit already exists. Delete it first to recreate it."; \
fi
worker:
ENV_FILES='secrets-do-not-commit,dev' celery -A conf worker -l info
beat:
ENV_FILES='secrets-do-not-commit,dev' celery -A conf beat -l info -S django
test:
flake8 && make pytest
.PHONY: clean autoformat checks pytest manage webserver requirements install_requirements css worker beat