-
Notifications
You must be signed in to change notification settings - Fork 87
/
makefile
49 lines (36 loc) · 1.4 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
all: help
help:
@echo 'make test run tests and show coverage report'
@echo 'make clean clean up files'
dev-config:
mkdir -p envs/dev
echo django.core.mail.backends.console.EmailBackend > envs/dev/EMAIL_BACKEND
echo secret > envs/dev/SECRET_KEY
echo postgres://mygpo:mygpo@localhost/mygpo > envs/dev/DATABASE_URL
echo True > envs/dev/DEBUG
test: envs/dev/MEDIA_ROOT
# assume defined media root directory, empty before running tests
rm -rf $(shell cat envs/dev/MEDIA_ROOT)
mkdir -p $(shell cat envs/dev/MEDIA_ROOT)
envdir envs/dev/ python -Wd -m pytest --cov=mygpo/ --cov-branch
coverage report --show-missing
update-po:
envdir envs/dev python manage.py makemessages \
--ignore=doc/* --ignore=envs/* --ignore=media/* --ignore=venv/* \
--ignore=res/* --ignore=tools/* --ignore=mygpo/*/migrations/* \
--ignore=static/* --all
compilemessages:
envdir envs/dev/ python manage.py compilemessages
notebook:
envdir envs/dev/ python manage.py shell_plus --notebook
clean:
git clean -fX
install-deps:
sudo apt-get install libpq-dev libjpeg-dev zlib1g-dev libwebp-dev \
build-essential python3-dev virtualenv libffi-dev redis postgresql \
gettext
format-code:
black --target-version py38 --skip-string-normalization mygpo/
check-code-format:
black --check --target-version py38 --skip-string-normalization mygpo/
.PHONY: all help test clean unittest coverage install-deps format-code