-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
78 lines (59 loc) · 1.67 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
PYTHON_MAJOR_MINOR := $(shell python -c "import sys; print('{0}{1}'.format(*sys.version_info))")
REQUIREMENTS_TXT = requirements$(PYTHON_MAJOR_MINOR).txt
.PHONY: core-requirements
core-requirements:
pip install pip setuptools pip-tools
.PHONY: update-requirements
update-requirements: core-requirements
pip install -U pip setuptools pip-tools
pip-compile -U requirements.in -o $(REQUIREMENTS_TXT)
.PHONY: requirements
requirements: core-requirements
pip-sync $(REQUIREMENTS_TXT)
.PHONY: clean-pyc
clean-pyc: requirements
find . -iname "*.pyc" -delete
find . -iname "__pycache__" -delete
.PHONY: develop
develop: requirements
python setup.py develop
reports:
mkdir -p $@
.PHONY: pycodestyle
pycodestyle: reports
set -o pipefail && $@ setuptools_twine | tee reports/$@.report
.PHONY: flake8
flake8: reports
set -o pipefail && $@ setuptools_twine | tee reports/$@.report
.PHONY: check8
check8: develop pycodestyle flake8
.PHONY: dev-build
dev-build: clean-pyc
python setup.py dev_build
.PHONY: release-build
release-build: clean-pyc
python setup.py release_build
.PHONY: clean-test-project
clean-test-project:
rm -rf test_project/*.egg-info test_project/.eggs test_project/build test_project/dist
.PHONY: clean-tox
clean-tox: clean-test-project
rm -rf .tox
.PHONY: tox
tox: clean-pyc
tox
.PHONY: clean-all
clean-all: clean-pyc clean-tox
rm -rf *.dist-info *.egg-info .eggs .cache build dist reports
.PHONY: bump-major
bump-major: requirements
bumpversion major
.PHONY: bump-minor
bump-minor: requirements
bumpversion minor
.PHONY: bump-patch
bump-patch: requirements
bumpversion patch
.PHONY: pypi-upload
pypi-upload: requirements clean-pyc
python setup.py pypi_upload