This repository has been archived by the owner on Feb 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
99 lines (62 loc) · 1.72 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
export DJANGO_SETTINGS_MODULE=zagrajmy.settings.development
export PYTHONPATH=app:stubs
# INSTALL
inst-prod:
pip install -r requirements.txt --use-feature=2020-resolver
inst-dev:
pip install -r requirements-dev.txt --use-feature=2020-resolver
inst-pip:
pip install -U pip --use-feature=2020-resolver
inst-upg:
upgrade-requirements
install-prod: inst-pip inst-prod
install-dev: inst-pip inst-prod inst-dev
upgrade: inst-upg install-dev
# TESTING
test-unit:
pytest
test-unit-cov:
pytest --cov=app --cov=tests/unit
test-behave:
django-admin behave tests/functional
test-behave-cov:
coverage run --source=app,tests/functional -m manage behave tests/functional
coverage report
test: test-behave test-unit
test-cov: test-behave-cov test-unit-cov
behave-dev:
django-admin behave --stop -vv tests/functional
pytest-dev:
pytest --cov -svvx
# FORMATTING
fmt-black:
black app tests stubs
fmt-isort:
isort app tests stubs
format: fmt-black fmt-isort
# LINTING
lint-check:
check-requirements
lint-black:
black --check app tests stubs
lint-isort:
isort --check-only --diff app tests stubs
lint-pylint:
pylint app/contrib app/notice_board app/common app/crowd app/chronology app/zagrajmy
pylint --rcfile=tests/.pylintrc tests
lint-pycodestyle:
pycodestyle app tests
lint-bandit:
bandit -r app
lint-mypy:
mypy app||true
lint: lint-check lint-black lint-isort lint-pycodestyle lint-bandit lint-mypy lint-pylint
# General
prcheck: install-dev format lint test-cov graph messages
# Docker
graph:
docker-compose exec -T web django-admin graph_models chronology crowd notice_board -g -o docs/models.png
messages:
docker-compose exec -T web django-admin makemessages -l pl
django:
docker-compose exec web django-admin $(cmd)