-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
51 lines (34 loc) · 1.08 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
# Always fail shell on all errors
SHELL := /bin/bash -euo pipefail
# BEGIN Disable in-built Makefile rules
MAKEFLAGS += --no-builtin-rules
.SUFFIXES:
# END Disable in-built Makefile rules
BUILD_DIR := build
# Make sure build dir exists
$(shell mkdir -p $(BUILD_DIR))
# Look in build dir for goal files like "wheels" and Docker image
# timestamp files
VPATH=$(BUILD_DIR) dist
VERSION=$(shell cat VERSION.txt)
SPRINGFIELD_WHEEL=springfield-$(VERSION)-py2.py3-none-any.whl
.PHONY: all
all: docs wheel
docs: $(shell find docs ! -path 'docs/_build/*' -type f) _README.rst
pip install -r docs/requirements.txt
cd docs && make html
.PHONY: wheel
wheel: $(SPRINGFIELD_WHEEL)
$(SPRINGFIELD_WHEEL): $(shell find src -type f ! -path '*.pyc') setup.py build-requirements.txt
pip install -r build-requirements.txt
python setup.py build
# Publish to pypi
publish: $(SPRINGFIELD_WHEEL)
python setup.py publish
.PHONY: test
test: $(SPRINGFIELD_WHEEL)
pip install -r test_requirements.txt ./dist/$(SPRINGFIELD_WHEEL)
cd src && python tests/runtests.py -v
.PHONY: clean
clean:
rm -Rf dist build