-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
72 lines (54 loc) · 1.79 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
clean-pyc :
echo "######## CLEAN PY CACHE ########"
find . | grep -E "__pycache__" | xargs rm -rf
update_pip_tool :
echo "########## UPDATE PIP ##########"
pip3 install --upgrade pip pip-tools setuptools wheel
pip3 : update_pip_tool
echo "##### INSTALL REQUIREMENTS #####"
pip3 install -r requirements.txt
pip3-dev : update_pip_tool
echo "##### INSTALL REQUIREMENTS #####"
pip3 install -r requirements.txt -r requirements-dev.txt
update_pip3 : update_pip_tool
echo "##### UPDATE REQUIREMENTS ######"
rm requirements.txt requirements-dev.txt || true
pip-compile --output-file requirements.txt requirements.in
pip-compile --output-file requirements-dev.txt requirements-dev.in
pip-sync requirements.txt requirements-dev.txt
unittest :
echo "########### UNITTEST ###########"
venv/bin/nose2 -v
safety :
echo "############ SAFETY ############"
safety check
flake8 :
echo "############ FLAKE8 ############"
flake8
pycodestyle :
echo "########## PYCODESTYLE #########"
pycodestyle --show-source --statistics --count src
pylint :
echo "############ PYLINT ############"
pylint -j4 --rcfile .pylintrc src
mypy :
echo "############# MYPY #############"
mypy src
coverage : clean-coverage
echo "########### COVERAGE ###########"
nose2 --with-coverage && \
coverage xml
clean-coverage :
echo "######## CLEAN COVERAGE ########"
rm -rf .coverage coverage.xml .coverage_html || :
coverage-html : coverage
echo "######### COVERAGE HTML ########"
coverage html -d .coverage_html
python -c "import webbrowser, os; webbrowser.open('file://' + os.path.realpath('.coverage_html/index.html'))"
codecov :
echo "########### CODECOV ############"
codecov
clean : clean-pyc clean-coverage
quality : flake8 pycodestyle pylint mypy
pre-commit : update_pip3 quality unittest
.PHONY : clean, pre-commit quality