-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathMakefile
67 lines (49 loc) · 1.41 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
-include Makefile.local
PYTEST?=py.test
PYTEST_OPTIONS+=-s
PYTEST_INPUT?=test
PYTEST_COVERAGE_OPTIONS+=--cov-report=term-missing --cov-report=html:test/coverage --cov=tracker
PYTEST_PDB?=0
PYTEST_PDB_OPTIONS?=--pdb --pdbcls=IPython.terminal.debugger:TerminalPdb
ISORT?=isort
ISORT_OPTIONS+=--skip .virtualenv --skip .venv
ISORT_CHECK_OPTIONS+=--check-only --diff
.PHONY: update test
all: update
ifeq (${PYTEST_PDB},1)
PYTEST_OPTIONS+= ${PYTEST_PDB_OPTIONS}
else
test-pdb: PYTEST_OPTIONS+= ${PYTEST_PDB_OPTIONS}
endif
test-pdb: test
setup: submodule
./trackerctl setup bootstrap
submodule:
git submodule update --recursive --init --rebase
update: setup
./trackerctl update env
user: setup
./trackerctl setup user
run: setup
./trackerctl run
shell: setup
./trackerctl shell
check: setup
./trackerctl db check
db-upgrade: setup
./trackerctl db upgrade
test: test-py test-isort
test-py coverage: setup
PYTHONPATH=".:${PYTHONPATH}" ${PYTEST} ${PYTEST_INPUT} ${PYTEST_OPTIONS} ${PYTEST_COVERAGE_OPTIONS}
test-isort:
@if [[ -n "$$(which colordiff 2>/dev/null)" ]]; then \
DIFF="$$(${ISORT} ${ISORT_OPTIONS} ${ISORT_CHECK_OPTIONS} .)"; EXIT=$$?; \
cat <<< $$DIFF|colordiff; if [[ 0 -ne "$$EXIT" ]]; then exit $$EXIT; fi; \
else \
${ISORT} ${ISORT_OPTIONS} ${ISORT_CHECK_OPTIONS} .; \
fi
@echo "Checking isort...ok"
open-coverage: coverage
${BROWSER} test/coverage/index.html
isort:
${ISORT} ${ISORT_OPTIONS} .