-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
94 lines (72 loc) · 1.64 KB
/
Copy pathMakefile
File metadata and controls
94 lines (72 loc) · 1.64 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
ifeq (, $(ENV))
ENV := development
env := development
else ifeq (test, $(ENV))
env := testing
else
env := $(ENV)
endif
ifeq (, ${NODE_ENV})
NODE_ENV := development
endif
app = winterthur
# -- installation
setup:
pip install -e '.[${env}]' -c constraints.txt
.PHONY: setup
# -- database
db-init:
${app}_manage 'config/${env}.ini#${app}' db init
.PHONY: db-init
db-migrate:
${app}_manage 'config/${env}.ini#${app}' db migrate
.PHONY: db-migrate
db-rollback:
${app}_manage 'config/${env}.ini#${app}' db rollback
.PHONY: db-rollback
db-seed:
${app}_manage 'config/${env}.ini#${app}' db seed
.PHONY: db-seed
db-drop:
${app}_manage 'config/${env}.ini#${app}' db drop
.PHONY: db-drop
db-reset:
${app}_manage 'config/${env}.ini#${app}' db drop
${app}_manage 'config/${env}.ini#${app}' db init
${app}_manage 'config/${env}.ini#${app}' db migrate
ifneq (test, $(ENV))
${app}_manage 'config/${env}.ini#${app}' db seed
endif
.PHONY: db-reset
# -- application
# server (development)
serve:
./bin/serve -e ${env} -c config/${env}.ini --reload
.PHONY: serve
# -- testing
test:
ENV=test py.test -c 'config/testing.ini' -s -q
.PHONY: test
coverage:
ENV=test py.test -c 'config/testing.ini' -s -q --cov=${app} --cov-report \
term-missing:skip-covered
.PHONY: coverage
# -- utility
check:
flake8
.PHONY: check
lint:
pylint test ${app}
.PHONY: lint
vet: | check lint
.PHONY: vet
clean:
find . ! -readable -prune -o \
! -path "./.git/*" ! -path "./venv*" \
! -path "./doc/*" ! -path "./tmp/_cache*" \
! -path "./lib/*" | \
grep -E "(__pycache__|\.egg-info|\.pyc|\.pyo)" | \
xargs rm -rf
.PHONY: clean
.DEFAULT_GOAL = coverage
default: coverage