-
Notifications
You must be signed in to change notification settings - Fork 274
/
Copy pathMakefile
65 lines (47 loc) · 1.35 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
.PHONY: bootstrap venv deps dirs clean pytest test release mypy pylint flake8 bandit check build docs eradicate
SHELL := /bin/bash
FILES_CHECK_MYPY = grab tests
FILES_CHECK_ALL = $(FILES_CHECK_MYPY)
init: venv deps dirs
venv:
virtualenv -p python3 .env
deps:
.env/bin/pip install -r requirements_dev.txt
.env/bin/pip install -r requirements_backend.txt
.env/bin/pip install -e .[cssselect,pyquery]
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 -n30 -x --cov grab --cov-report term-missing
test: check pytest
tox -e python38-check
#release:
# git push \
# && git push --tags \
# && make build \
# && twine upload dist/*
mypy:
mypy --python-version=3.8 --strict $(FILES_CHECK_MYPY)
pylint:
pylint -j0 $(FILES_CHECK_ALL)
flake8:
flake8 -j auto --isolated --select CCR --max-cognitive-complexity=17 $(FILES_CHECK_ALL)
ruff:
ruff $(FILES_CHECK_ALL)
eradicate:
tox -e eradicate -- flake8 -j auto --eradicate-whitelist-extend="License:" $(FILES_CHECK_ALL)
bandit:
bandit -qc pyproject.toml -r $(FILES_CHECK_ALL)
check: ruff mypy pylint flake8 bandit
build:
rm -rf *.egg-info
rm -rf dist/*
python -m build --sdist
docs:
rm -rf docs/_build/html
sphinx-build -j auto docs docs/_build/html