-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
102 lines (86 loc) · 1.78 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
.PHONY: build docs gh-pages
project = tloen
errors = E123,E203,E265,E266,E501,W503
origin := $(shell git config --get remote.origin.url)
formatPaths = ${project}/ tests/ *.py
testPaths = ${project}/ tests/
black-check:
black --target-version py36 --check --diff ${formatPaths}
black-reformat:
black --target-version py36 ${formatPaths}
build:
python setup.py sdist
clean:
find . -name '*.pyc' | xargs rm
find . -name '__pycache__' | xargs rm -Rif
rm -Rif *.egg-info/
rm -Rif .*cache/
rm -Rif .tox/
rm -Rif build/
rm -Rif dist/
rm -Rif htmlcov/
rm -Rif prof/
docs:
make -C docs/ html
docs-clean:
make -C docs/ clean html
flake8:
flake8 ${formatPaths}
gh-pages: docs-clean
rm -Rf gh-pages/
git clone $(origin) gh-pages/
cd gh-pages/ && \
git checkout gh-pages || git checkout --orphan gh-pages
rsync -rtv --del --exclude=.git docs/build/html/ gh-pages/
cd gh-pages && \
touch .nojekyll && \
git add --all . && \
git commit --allow-empty -m "Update docs" && \
git push -u origin gh-pages
rm -Rf gh-pages/
isort:
isort \
--case-sensitive \
--multi-line 3 \
--thirdparty supriya \
--thirdparty uqbar \
--trailing-comma \
--use-parentheses \
${formatPaths}
mypy:
mypy --ignore-missing-imports ${project}/
pytest:
rm -Rf htmlcov/
pytest \
--cov-config=.coveragerc \
--cov-report=html \
--cov-report=term \
--cov=${project}/ \
--durations=20 \
--timeout=60 \
${testPaths}
pytest-x:
rm -Rf htmlcov/
pytest \
-x \
--cov-config=.coveragerc \
--cov-report=html \
--cov-report=term \
--cov=${project} / \
--durations=20 \
--timeout=60 \
${testPaths}
reformat:
make isort
make black-reformat
release:
make test
make clean
make build
twine upload dist/*.tar.gz
make gh-pages
test:
make black-check
make flake8
make mypy
make pytest