-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
74 lines (59 loc) · 2.16 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
73
74
.PHONY: sec lint lint-apply test tests test-no-cov init pre-commit build install clean release
.DEFAULT_GOAL := help
help:
@echo "🪄 PREPARE ENVIRONMENT"
@echo "---------------------------------------------------------------------"
@echo " init Install all python requirements"
@echo " pre-commit Install pre-commit hooks"
@echo ""
@echo "⚙️ DEVELOPMENT"
@echo "---------------------------------------------------------------------"
@echo " test Run all tests (pytest)"
@echo " test-no-cov Run all tests (pytest) without coverage report"
@echo " lint Check python syntax & style by black"
@echo " lint-apply Apply black linter (autoformat)"
@echo " sec Security linter (bandit)"
@echo ""
@echo "📦 PACKAGE OPERATIONS"
@echo "---------------------------------------------------------------------"
@echo " build Build whl package"
@echo " install Install package to python lib"
@echo " clean Clean install artifacts"
@echo " release Build & release new package version to PYPI"
sec:
@bandit -r yc_lockbox
lint:
@black yc_lockbox tests --color --diff --check --extend-exclude "/.*(\.yml|\.yaml)/"
lint-apply:
@black yc_lockbox tests --extend-exclude "/.*(\.yml|\.yaml)/"
test:
@pytest -vv --cov=yc_lockbox --cov-report term --cov-report xml:coverage.xml
tests: test
test-no-cov:
@pytest -vv --log-cli-level=INFO
pre-commit:
@pre-commit run --all-files
init:
@pip install -r requirements.txt
@pip install -r requirements.aio.txt
@pip install -r requirements.dev.txt
clean: clean-build clean-pyc
clean-build:
rm -rf build/
rm -rf dist/
rm -rf .eggs/
find . -name '*.egg-info' -exec rm -rf {} +
find . -name '*.egg' -exec rm -rf {} +
find . -name '.DS_Store' -exec rm -f {} +
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -rf {} +
build:
@python3 setup.py sdist bdist_wheel
install: clean
@python3 setup.py install
release: build
@make build
@python3 -m twine upload --repository pypi dist/*