-
Notifications
You must be signed in to change notification settings - Fork 0
/
util.mk
55 lines (39 loc) · 986 Bytes
/
util.mk
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
# ============
# Main targets
# ============
# -------------
# Configuration
# -------------
$(eval venvpath := .venv)
$(eval pip := $(venvpath)/bin/pip)
$(eval python := $(venvpath)/bin/python)
$(eval bumpversion := $(venvpath)/bin/bumpversion)
$(eval poe := $(venvpath)/bin/poe)
# Setup Python virtualenv
setup-virtualenv:
@test -e $(python) || `command -v python3` -m venv $(venvpath)
# -------
# Testing
# -------
# Run the main test suite
test:
$(poe) check
test-refresh: install-tests test
# -------
# Release
# -------
# Release this piece of software
# Synopsis:
# make release bump=minor (major,minor,patch)
release: setup-sandbox bumpversion push build-and-upload
# ===============
# Utility targets
# ===============
bumpversion:
@$(bumpversion) $(bump)
push:
git push && git push --tags
build-and-upload:
$(poe) release
setup-sandbox: setup-virtualenv
@$(pip) install --quiet --upgrade --editable='.[develop,docs,test]'