-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
82 lines (58 loc) · 1.17 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
75
76
77
78
79
80
81
82
#
# Settings
#
BUILD_DIR = build
SOURCE_DIRS = cryptobob
LINTER_CONFIGS = https://git.confirm.ch/confirm/guidelines/raw/master/configs
PYPI_INDEX = https://pypi.confirm.ch/
.PHONY: build
#
# Cleanup
#
clean: clean-cache clean-test clean-build clean-venv
clean-cache:
find . -name '__pycache__' -delete
clean-test:
rm -vf .coverage .coveragerc .isort.cfg .pylintrc tox.ini
clean-build:
rm -vrf $(BUILD_DIR) .eggs *.egg-info
clean-venv:
rm -vrf .venv
#
# Install
#
venv:
python3 -m venv .venv
develop:
pip3 install -i $(PYPI_INDEX) -e .[dev]
install:
pip3 install -i $(PYPI_INDEX) .
#
# Development
#
isort:
curl -sSfLo .isort.cfg $(LINTER_CONFIGS)/isort.cfg
isort $(SOURCE_DIRS)
#
# Test
#
test-isort:
curl -sSfLo .isort.cfg $(LINTER_CONFIGS)/isort.cfg
isort -c --diff $(SOURCE_DIRS)
test-pycodestyle:
curl -sSfLo tox.ini $(LINTER_CONFIGS)/tox.ini
pycodestyle $(SOURCE_DIRS)
test-pylint:
curl -sSfLo .pylintrc $(LINTER_CONFIGS)/pylintrc
pylint $(SOURCE_DIRS)
test-packages:
pip-audit
test: test-isort test-pycodestyle test-pylint test-packages
#
# Build
#
sdist:
./setup.py sdist -d $(BUILD_DIR)
wheel:
./setup.py bdist_wheel -d $(BUILD_DIR)
build: sdist wheel