-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
104 lines (75 loc) · 2.67 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
100
101
102
103
104
###############################################################################
## Helpful Definitions
###############################################################################
define \n
endef
ACTIVATE = . bin/activate
ifndef PYTHON
PYTHON = "python"
endif
###############################################################################
# Export the configuration to sub-makes
###############################################################################
export
all: test
virtualenv: bin/activate
lib: bin/activate
distclean: virtualenv-clean clean
virtualenv-clean:
rm -rf bin include local lib lib64 share src
clean:
find . \( -name \*\.pyc \) -delete
# git clean -f -d
bin/activate:
virtualenv -p $(PYTHON) .
-rm distribute*.tar.gz
freeze:
$(ACTIVATE) && pip freeze > requirements.txt
install-distribute: lib
$(ACTIVATE) && pip install distribute
install-ez_setup: lib
$(ACTIVATE) && pip install ez_setup
install-packages: requirements.txt
$(ACTIVATE) && pip install -r requirements.txt
$(ACTIVATE) && [ ! -f private/requirements.txt ] || pip install -r private/requirements.txt
install: install-ez_setup install-distribute install-packages
createinitialrevisions:
$(ACTIVATE) && python manage.py createinitialrevisions
prepare-serve:
$(ACTIVATE) && python manage.py collectstatic --noinput
$(ACTIVATE) && python manage.py migrate
$(ACTIVATE) && python manage.py loaddata site.json
$(ACTIVATE) && python manage.py loaddata manufacturer.json
#### Tests
test: parsertest clitest firefoxtest
parsertest:
$(ACTIVATE) && python edid_parser/tests.py
clitest:
$(ACTIVATE) && python manage.py test \
frontend.django_tests
firefoxtest:
$(ACTIVATE) && TEST_DISPLAY=1 python manage.py test \
frontend.selenium_tests
coverage:
$(ACTIVATE) && coverage run --source=edid_parser edid_parser/tests.py
$(ACTIVATE) && coverage run -a --source=frontend manage.py test \
frontend.django_tests
$(ACTIVATE) && TEST_DISPLAY=1 coverage run -a --source=frontend manage.py \
test frontend.selenium_tests
$(ACTIVATE) && coverage html -d coverage_report
$(ACTIVATE) && coverage erase
pep8:
-$(ACTIVATE) && pycodestyle --statistics *.py
-$(ACTIVATE) && pycodestyle --statistics edid_parser/
-$(ACTIVATE) && pycodestyle --statistics frontend/
lint:
@# C0303 - Disable "Trailing whitespace"
$(ACTIVATE) && pylint \
--disable=C0303 \
--reports=n \
--msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
*.py edid_parser/*.py frontend/*.py
###############################################################################
###############################################################################
serve: prepare-serve
$(ACTIVATE) && python manage.py runserver