forked from ExaWorks/psij-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (40 loc) · 1.2 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
# 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:${PYTHONPATH} ${PYTHON} -m pytest -v $(TESTARGS)
.PHONY: verbose-tests
verbose-tests:
PYTHONPATH=$(CWD)/src:${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: typecheck
typecheck:
mypy --config-file=.mypy --strict src tests
.PHONY: stylecheck
stylecheck:
flake8 src
flake8 tests
.PHONY: checks
checks: typecheck stylecheck
.PHONY: docs
docs:
rm -rf docs/.generated
sphinx-build -W -b html docs docs/.build/
.PHONY: style
style:
autopep8 -i -r src tests
.PHONY: launcher-scripts
launcher-scripts:
$(PYTHON) setup.py launcher_scripts
.PHONY: install
install:
$(PYTHON) setup.py install
.PHONY: develop
develop:
$(PYTHON) setup.py develop