-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
63 lines (46 loc) · 1.38 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
# ============
# Main targets
# ============
# -------------
# Configuration
# -------------
$(eval venvpath := .venv_util)
$(eval pip := $(venvpath)/bin/pip)
$(eval python := $(venvpath)/bin/python)
$(eval pytest := $(venvpath)/bin/pytest)
$(eval bumpversion := $(venvpath)/bin/bumpversion)
$(eval twine := $(venvpath)/bin/twine)
$(eval sphinx := $(venvpath)/bin/sphinx-build)
# Setup Python virtualenv
setup-virtualenv:
@test -e $(python) || `command -v virtualenv` --python=python3 --no-site-packages $(venvpath)
# -------
# Release
# -------
# Release this piece of software
# Synopsis:
# make release bump=minor (major,minor,patch)
release: bumpversion push sdist pypi-upload
# ----
# Test
# ----
test: install-tests
$(pytest)
# ===============
# Utility targets
# ===============
bumpversion: install-releasetools
@$(bumpversion) $(bump)
push:
git push && git push --tags
sdist:
@$(python) setup.py sdist
pypi-upload: install-releasetools
twine upload --skip-existing --verbose dist/*.tar.gz
install-doctools: setup-virtualenv
@$(pip) install --quiet --requirement requirements-docs.txt --upgrade
install-releasetools: setup-virtualenv
@$(pip) install --quiet --requirement requirements-release.txt --upgrade
install-tests: setup-virtualenv
@$(pip) install --quiet --requirement requirements-dev.txt --upgrade
@$(pip) install --quiet -e.