1+ .PHONY : sec lint lint-apply test tests test-no-cov init pre-commit build install clean release
2+ .DEFAULT_GOAL := help
3+
4+ help :
5+ @echo " 🪄 PREPARE ENVIRONMENT"
6+ @echo " ---------------------------------------------------------------------"
7+ @echo " init Install all python requirements"
8+ @echo " pre-commit Install pre-commit hooks"
9+ @echo " "
10+ @echo " ⚙️ DEVELOPMENT"
11+ @echo " ---------------------------------------------------------------------"
12+ @echo " test Run all tests (pytest)"
13+ @echo " test-no-cov Run all tests (pytest) without coverage report"
14+ @echo " lint Check python syntax & style by black"
15+ @echo " lint-apply Apply black linter (autoformat)"
16+ @echo " sec Security linter (bandit)"
17+ @echo " "
18+ @echo " 📦 PACKAGE OPERATIONS"
19+ @echo " ---------------------------------------------------------------------"
20+ @echo " build Build whl package"
21+ @echo " install Install package to python lib"
22+ @echo " clean Clean install artifacts"
23+ @echo " release Build & release new package version to PYPI"
24+
25+ sec :
26+ @bandit -r yc_lockbox
27+
28+ lint :
29+ @black yc_lockbox tests --color --diff --check --extend-exclude " /.*(\.yml|\.yaml)/"
30+
31+ lint-apply :
32+ @black yc_lockbox tests --extend-exclude " /.*(\.yml|\.yaml)/"
33+
34+ test :
35+ @pytest -vv --cov=yc_lockbox --cov-report term --cov-report xml:coverage.xml
36+
37+ tests : test
38+
39+ test-no-cov :
40+ @pytest -vv --log-cli-level=INFO
41+
42+ pre-commit :
43+ @pre-commit run --all-files
44+
45+ init :
46+ @pip install -r requirements.txt
47+ @pip install -r requirements.aio.txt
48+ @pip install -r requirements.dev.txt
49+
50+ clean : clean-build clean-pyc
51+
52+ clean-build :
53+ rm -rf build/
54+ rm -rf dist/
55+ rm -rf .eggs/
56+ find . -name ' *.egg-info' -exec rm -rf {} +
57+ find . -name ' *.egg' -exec rm -rf {} +
58+ find . -name ' .DS_Store' -exec rm -f {} +
59+
60+ clean-pyc :
61+ find . -name ' *.pyc' -exec rm -f {} +
62+ find . -name ' *.pyo' -exec rm -f {} +
63+ find . -name ' *~' -exec rm -f {} +
64+ find . -name ' __pycache__' -exec rm -rf {} +
65+
66+ build :
67+ @python3 setup.py sdist bdist_wheel
68+
69+ install : clean
70+ @python3 setup.py install
71+
72+ release : build
73+ @make build
74+ @echo " not implemented"
0 commit comments