-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
81 lines (62 loc) · 2.04 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
# This allows running things like "make tests -- -k local" to pass "-k local" as args to
# pytest in the test target
ifeq (tests, $(firstword $(MAKECMDGOALS)))
TESTARGS := $(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS))
$(eval $(TESTARGS):;@true)
endif
CWD = $(shell pwd)
PYTHON = $(shell if python --version 2>&1 | egrep -q 'Python 3\..*' ; then echo "python"; else echo "python3"; fi)
.PHONY: tests
tests:
PYTHONPATH=$(CWD)/src:$(CWD)/tests/plugins1:$(CWD)/tests/plugins2:${PYTHONPATH} \
${PYTHON} -m pytest -v $(TESTARGS)
.PHONY: coverage-tests
coverage-tests:
PYTHONPATH=$(CWD)/src:$(CWD)/tests/plugins1:$(CWD)/tests/plugins2:${PYTHONPATH} \
${PYTHON} -m pytest -v --cov $(TESTARGS)
.PHONY: html-coverage-report
html-coverage-report:
PYTHONPATH=$(CWD)/src:$(CWD)/tests/plugins1:$(CWD)/tests/plugins2:${PYTHONPATH} \
${PYTHON} -m pytest -v --cov --cov-report html
.PHONY: verbose-tests
verbose-tests:
PYTHONPATH=$(CWD)/src:$(CWD)/tests/plugins1:$(CWD)/tests/plugins2:${PYTHONPATH} \
${PYTHON} -m pytest -v --log-format="%(asctime)s %(levelname)s %(message)s" \
--log-date-format="%Y-%m-%d %H:%M:%S" --log-cli-level=DEBUG
.PHONY: ci-tests
ci-tests:
${PYTHON} tests/ci_runner.py
.PHONY: typecheck
typecheck:
mypy --config-file=.mypy --strict src tests
.PHONY: stylecheck
stylecheck:
flake8 src tests
.PHONY: checks
checks: typecheck stylecheck docs
.PHONY: docs
docs:
rm -rf docs/.generated
rm -rf docs/.build
sphinx-build --keep-going -n -W -b html docs docs/.build/
.PHONY: web-docs
web-docs:
rm -rf docs/.generated
rm -rf docs/.web-build
git fetch --all --tags
PSIJ_WEB_DOCS=1 sphinx-multiversion docs docs/.web-build
PSIJ_WEB_DOCS=1 sphinx-build --keep-going -n -W -b html docs docs/.web-build/v/dev
.PHONY: web-docs-dev
web-docs-dev:
rm -rf docs/.generated
rm -rf docs/.web-build
PSIJ_WEB_DOCS=1 sphinx-build --keep-going -n -W -b html docs docs/.web-build/v/dev
.PHONY: style
style:
autopep8 -i -r src tests
.PHONY: install
install:
$(PYTHON) setup.py install
.PHONY: develop
develop:
$(PYTHON) setup.py develop