-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathMakefile
68 lines (50 loc) · 1.21 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
.PHONY: bootstrap venv deps dirs clean pytest test release mypy pylint flake8 bandit check build coverage
FILES_CHECK_MYPY = captcha_solver
FILES_CHECK_ALL = $(FILES_CHECK_MYPY) tests
bootstrap: venv deps dirs
venv:
virtualenv -p python3 .env
deps:
.env/bin/pip install -r requirements_dev.txt
.env/bin/pip install -e .
dirs:
if [ ! -e var/run ]; then mkdir -p var/run; fi
if [ ! -e var/log ]; then mkdir -p var/log; fi
clean:
find -name '*.pyc' -delete
find -name '*.swp' -delete
find -name '__pycache__' -delete
pytest:
pytest --cov captcha_solver --cov-report term-missing
test:
make check \
&& make pytest \
&& tox -e py37-check
release:
git push \
&& git push --tags \
&& make build \
&& twine upload dist/*
mypy:
mypy --strict $(FILES_CHECK_MYPY)
pylint:
pylint -j0 $(FILES_CHECK_ALL)
flake8:
flake8 -j auto --max-cognitive-complexity=17 $(FILES_CHECK_ALL)
bandit:
bandit -qc pyproject.toml -r $(FILES_CHECK_ALL)
check:
echo "mypy" \
&& make mypy \
&& echo "pylint" \
&& make pylint \
&& echo "flake8" \
&& make flake8 \
&& echo "bandit" \
&& make bandit
build:
rm -rf *.egg-info
rm -rf dist/*
python -m build --sdist
coverage:
pytest --cov captcha_solver --cov-report term-missing