-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (52 loc) · 1.45 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
# Python makefile https://krzysztofzuraw.com/blog/2016/makefiles-in-python-projects.html
# Delcare all non-file targets as phony
.PHONY: clean clean-build clean-data data isort lint test
TEST_PATH=./
help:
@echo " clean-pyc"
@echo " Remove python artifacts."
@echo " clean-build"
@echo " Remove build artifacts."
@echo " isort"
@echo " Sort import statements."
@echo " lint"
@echo " Check style with flake8."
@echo " test"
@echo " Run py.test"
@echo " test-warn"
@echo " Run py.test with warnings errored"
@echo " init"
@echo " Initalize by installing requirements"
@echo " init-dev"
@echo " Initalize by installing normal and dev requirements"
@echo " cov"
@echo " Produce coverage report"
@echo " mypy"
@echo " Run type checking with mypy"
clean-pyc:
find . -name '*.pyc' -exec rm --force {} +
find . -name '*.pyo' -exec rm --force {} +
find . -name '*~' -exec rm --force {} +
clean-build:
rm --force --recursive build/
rm --force --recursive dist/
rm --force --recursive *.egg-info
isort:
sh -c "isort --recursive . "
lint:
flake8 --exclude=.tox
test: clean-pyc
pytest --verbose --color=yes $(TEST_PATH)
test-warn: clean-pyc
pytest --verbose --color=yes $(TEST_PATH) -o "filterwarnings=error"
init:
pip install -r requirements.txt
init-dev:
pip install -r requirements.txt
pip install -r requirements_dev.txt
cov: $(module)/*
py.test --cov=$(module)
coverage html
mypy:
# py.test --mypy
mypy --ignore-missing-imports .