-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
111 lines (70 loc) · 1.92 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#
source_dir := ./src
tests_dir := ./test
.DEFAULT_GOAL := editable
.PHONY: editable
editable:
python -m pip install --editable '.[dev-package,dev-test]'
.PHONY: package
package: sdist wheel zapp
.PHONY: sdist
sdist:
python -m build --sdist
python -m twine check dist/*.tar.gz
.PHONY: wheel
wheel:
python -m build --wheel
python -m twine check dist/*.whl
.PHONY: zapp
zapp:
python setup.py bdist_zapp
.PHONY: format
format:
python -m yapf --in-place --parallel --recursive setup.py $(source_dir) $(tests_dir)
.PHONY: lint
lint:
python -m pytest --pycodestyle --pydocstyle --pylint --yapf -m 'pycodestyle or pydocstyle or pylint or yapf'
.PHONY: mypy
mypy:
python -m pytest --mypy -m mypy
.PHONY: pycodestyle
pycodestyle:
python -m pytest --pycodestyle -m pycodestyle
.PHONY: pydocstyle
pydocstyle:
python -m pytest --pydocstyle -m pydocstyle
.PHONY: pylint
pylint:
python -m pytest --pylint -m pylint
.PHONY: yapf
yapf:
python -m pytest --yapf -m yapf
.PHONY: test
test: pytest
.PHONY: pytest
pytest:
python -m pytest
.PHONY: review
review:
python -m pytest --mypy --pycodestyle --pydocstyle --pylint --yapf
.PHONY: clean
clean:
$(RM) --recursive ./.eggs/
$(RM) --recursive ./.pytest_cache/
$(RM) --recursive ./build/
$(RM) --recursive ./dist/
$(RM) --recursive ./.mypy_cache/
$(RM) --recursive ./__pycache__/
find $(source_dir) -name '*.dist-info' -type d -exec $(RM) --recursive {} +
find $(source_dir) -name '*.egg-info' -type d -exec $(RM) --recursive {} +
find $(source_dir) -name '*.pyc' -type f -exec $(RM) {} +
find $(tests_dir) -name '*.pyc' -type f -exec $(RM) {} +
find $(source_dir) -name '__pycache__' -type d -exec $(RM) --recursive {} +
find $(tests_dir) -name '__pycache__' -type d -exec $(RM) --recursive {} +
#
# Options
#
# Disable default rules and suffixes (improve speed and avoid unexpected behaviour)
MAKEFLAGS := --no-builtin-rules --warn-undefined-variables
.SUFFIXES:
# EOF