forked from nimbis/cmsplugin-newsplus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (45 loc) · 1.11 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
.PHONY: test pep8 clean coverage doc check-venv check-reqs check-venv
# clean out potentially stale pyc files
clean:
@find . -name "*.pyc" -exec rm {} \;
# check that virtualenv is enabled
check-venv:
ifndef VIRTUAL_ENV
$(error VIRTUAL_ENV is undefined, try "workon" command)
endif
# check that requirements have been installed
check-reqs: check-venv
-piplint requirements.txt
# Install pip requirements.txt file
reqs: check-venv
pip install -r requirements.txt
PEP8_OPTS=--repeat --exclude=static,migrations,south_migrations,js,doc --show-source
pep8:
pep8 $(PEP8_OPTS) .
#
# flake8
#
FLAKE8_OPTS = --max-complexity 10 --exclude='doc,migrations,south_migrations'
flake8: check-venv
flake8 $(FLAKE8_OPTS) .
#
# unit tests
#
test: check-venv clean
./manage.py test
#
# doc
#
doc: check-reqs
cd doc; make html
@echo "See ./doc/_build/index.html for html documentation."
#
# code coverage
#
COVERAGE_INCLUDE='cmsplugin_newsplus/*'
coverage: check-reqs
coverage erase
-coverage run --include=$(COVERAGE_INCLUDE) ./manage.py test
coverage report
coverage html
@echo "See ./htmlcov/index.html for coverage report"