-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathMakefile
59 lines (47 loc) · 1.19 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
PYTEST = pytest
TESTPATH = test
PYTESTOPTS =
COVERAGE = coverage
DOCKER = true
SLOW = true
CLEANUP = true
ISORT = isort
ISORTOPTS =
BLACK = black
BLACKOPTS =
CI = false
_PYTESTOPTS := -vv --durations=0 --html=pytest-report.html --self-contained-html
_ISORTOPTS :=
_BLACKOPTS :=
ifeq ($(DOCKER), false)
_PYTESTOPTS := $(_PYTESTOPTS) -m "not docker"
endif
ifeq ($(SLOW), false)
_PYTESTOPTS := $(_PYTESTOPTS) -m "not slow"
endif
ifeq ($(CLEANUP), false)
_PYTESTOPTS := $(_PYTESTOPTS) --nocleanup
endif
ifeq ($(CI), true)
_ISORTOPTS := --check --diff
_BLACKOPTS := --check --diff
endif
_PYTESTOPTS := $(_PYTESTOPTS) $(PYTESTOPTS)
.PHONY: test
test:
$(PYTEST) $(TESTPATH) $(_PYTESTOPTS)
testcov:
$(COVERAGE) run -m pytest $(TESTPATH) $(_PYTESTOPTS)
htmlcov: testcov
$(COVERAGE) html
.PHONY: docs
docs:
$(MAKE) -C docs html
tutorial:
cd docs/tutorial; \
zip -r tutorial.zip submissions demo.ipynb requirements.txt -x "*.DS_Store"; \
cp tutorial.zip ../_static; \
rm tutorial.zip
format:
$(ISORT) $(_ISORTOPTS) $(ISORTOPTS) .
$(BLACK) $(_BLACKOPTS) $(BLACKOPTS) .