-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
75 lines (56 loc) · 1.71 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
# =============
# Configuration
# =============
$(eval venv := .venv)
$(eval pip := $(venv)/bin/pip)
$(eval python := $(venv)/bin/python)
$(eval pytest := $(venv)/bin/pytest)
$(eval bumpversion := $(venv)/bin/bumpversion)
$(eval twine := $(venv)/bin/twine)
$(eval proselint := $(venv)/bin/proselint)
$(eval sphinx-autobuild := $(venv)/bin/sphinx-autobuild)
# ============
# Main targets
# ============
# Run software tests.
.PHONY: test
test:
$(pytest)
# Release this piece of software
# Synopsis:
# make release bump=minor (major,minor,patch)
release: bumpversion push build pypi-upload
# Build the documentation
docs-html: install-doctools
touch doc/index.rst
export SPHINXBUILD="`pwd`/$(venv)/bin/sphinx-build"; cd doc; make html
docs-autobuild: install-doctools
$(pip) install sphinx-autobuild
$(sphinx-autobuild) --open-browser doc doc/_build
docs-lint:
$(proselint) *.rst doc/*.rst doc/**/*.rst
.PHONY: check
check: install-package docs-lint test
# ===============
# Utility targets
# ===============
bumpversion: install-releasetools
@$(bumpversion) $(bump)
push:
git push && git push --tags
build:
@$(python) -m build
pypi-upload: install-releasetools
@$(twine) upload --skip-existing --verbose dist/{*.tar.gz,*.whl}
# =================
# Installer targets
# =================
install-package:
@test -e $(python) || python3 -m venv $(venv)
$(pip) install --prefer-binary --editable=.[test,develop,release,sql]
install-doctools:
@test -e $(python) || python3 -m venv $(venv)
$(pip) install --requirement doc/requirements.txt --upgrade
install-releasetools:
@test -e $(python) || python3 -m venv $(venv)
$(pip) install --requirement requirements-release.txt --upgrade