-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
81 lines (65 loc) · 1.77 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
.PHONY: all
all: clear-all install-dev test-offline docs built upload coverage-offline
.PHONY: test
test: clear-all install-dev
pytest -k '' -q --cache-clear tests/
.PHONY: test-online
test-online: clear-all install-dev
pytest -k 'Online' -q --cache-clear tests/
.PHONY: test-offline
test-offline: clear-all install-dev
pytest -k 'not Online' -q --cache-clear tests/
.PHONY: lint
lint:
pycodestyle -r --statistics --count --show-source umbr_api/ tests/ examples/ setup.py
pep257 -s -e umbr_api/
pep257 -s -e tests/
pep257 -s -e examples/
pep257 -s -e setup.py
pylint umbr_api/ tests/*.py examples/ setup.py
# flake8 --statistics --count --exclude venv
.PHONY: install-dev
install-dev:
pip install -q -e .[dev]
.PHONY: install-doc
install-doc:
pip install -q -e .[doc]
.PHONY: coverage-offline
coverage-offline: clear-pyc clear-cov
coverage run -m pytest -k 'not Online' -q --cache-clear tests/
coverage report
coverage annotate
.PHONY: coverage
coverage: clear-pyc clear-cov
coverage run -m pytest
coverage report
coverage annotate
.PHONY: cov
cov: coverage
.PHONY: upload
upload: clear-all built
twine upload dist/*
.PHONY: docs
docs: clear-pyc install-dev install-doc
$(MAKE) -C docs html
.PHONY: built
built:
python3 setup.py sdist
.PHONY: clear-all
clear-all: clear-pyc clear-cov clear-build
.PHONY: clear-pyc
clear-pyc:
find . -type d -name '__pycache__' -exec rm -rf {} +
find . -type f -name '*.py[co]' -exec rm -f {} +
find . -type f -name '*~' -exec rm -f {} +
.PHONY: clear-cov
clear-cov:
find . -type f -name '*.py,cover' -exec rm -f {} +
rm -fr .pytest_cache
coverage erase
.PHONY: clear-build
clear-build:
rm -fr docs/_build/
rm -fr dist/
rm -fr .eggs/
rm -fr *.egg-info/