This repository was archived by the owner on Oct 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (54 loc) · 1.37 KB
/
Makefile
File metadata and controls
70 lines (54 loc) · 1.37 KB
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
.PHONY: travis-tests test pep8 clean coverage doc 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
# 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:
pycodestyle $(PEP8_OPTS) .
#
# flake8
#
FLAKE8_OPTS=--exclude=static,migrations,south_migrations,js,doc,travis_*
flake8: check-venv
flake8 $(FLAKE8_OPTS) .
#
# unit tests
#
test: check-venv clean
./manage.py test
#
# code coverage
#
COVERAGE_ARGS=--source=cmsplugin_forms_builder --omit=cmsplugin_forms_builder/tests.py
coverage:
coverage erase
-coverage run $(COVERAGE_ARGS) ./manage.py test
coverage report
coverage html
@echo "See ./htmlcov/index.html for coverage report"
#
# TravisCI
#
travis-tests: check-venv
@echo "travis_fold:start:flake8"
make flake8
@echo "travis_fold:end:flake8"
@echo "travis_fold:start:pip_freeze"
pip freeze -l
@echo "travis_fold:end:pip_freeze"
coverage erase
@echo "travis_fold:start:test"
coverage run $(COVERAGE_ARGS) ./manage.py test --keepdb -v 2
@echo "travis_fold:end:test"
@echo "travis_fold:start:coverage"
coverage report
coverage html
@echo "travis_fold:end:coverage"