-
Notifications
You must be signed in to change notification settings - Fork 115
/
Makefile
64 lines (48 loc) · 1.71 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
VERSION=2.0.0
BUILDDIR=${PWD}/~build
BINDIR=${PWD}/~build/bin
PYTHONPATH:=${PWD}/tests/:${PWD}
DJANGO?='3.1.x'
define PRINT_HELP_PYSCRIPT
import re, sys
for line in sys.stdin:
match = re.match(r'^([a-zA-Z0-9_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("\033[93m%-10s\033[0m %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT
help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
.mkbuilddir:
mkdir -p ${BUILDDIR}
develop:
CRYPTOGRAPHY_DONT_BUILD_RUST=1 pip install -e .[dev,docs]
demo:
PYTHONPATH=${PWD}:${PWD}/tests:${PWD}/src django-admin.py migrate --settings=demo.settings --noinput
PYTHONPATH=${PWD}:${PWD}/tests:${PWD}/src django-admin.py loaddata adminactions.json demoproject.json --settings=demo.settings
PYTHONPATH=${PWD}:${PWD}/tests:${PWD}/src django-admin.py runserver --settings=demo.settings
lint:
@flake8 src/ tests/
@isort -c src/
clean:
rm -fr ${BUILDDIR} dist *.egg-info .coverage coverage.xml pytest.xml .cache MANIFEST
find . -name __pycache__ | xargs rm -rf
find . -name "*.py?" -o -name "*.orig" -prune | xargs rm -rf
find adminactions/locale -name django.mo | xargs rm -f
fullclean:
rm -fr .tox .cache
rm -fr *.sqlite
$(MAKE) clean
mysql -e 'DROP DATABASE IF EXISTS adminactions;';
psql -c 'DROP DATABASE IF EXISTS adminactions;' -U postgres;
mysql -e 'DROP DATABASE IF EXISTS test_adminactions;';
psql -c 'DROP DATABASE IF EXISTS test_adminactions;' -U postgres;
coverage:
py.test src tests -vv --capture=no --doctest-modules --cov=adminactions --cov-report=html --cov-config=tests/.coveragerc
docs: .mkbuilddir
mkdir -p ${BUILDDIR}/docs
sphinx-build -aE docs/source ${BUILDDIR}/docs
ifdef BROWSE
open ${BUILDDIR}/docs/index.html
endif