aboutsummaryrefslogtreecommitdiff
path: root/makefile
blob: 621e97a8aa6331293b43c6e6befffc6c4e3f884e (plain)
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
.PHONY: test

test:
	_virtualenv/bin/pyflakes mammoth tests
	sh -c '. _virtualenv/bin/activate; py.test tests'

.PHONY: test-all

test-all:
	tox

.PHONY: upload

upload: setup assert-converted-readme build-dist
	_virtualenv/bin/twine upload dist/*
	make clean

.PHONY: build-dist

build-dist:
	rm -rf dist
	_virtualenv/bin/pyproject-build

README: README.md
	pandoc --from=markdown --to=rst README.md > README || cp README.md README

.PHONY: assert-converted-readme

assert-converted-readme:
	test "`cat README`" != "`cat README.md`"

.PHONY: clean

clean:
	rm -f README
	rm -f MANIFEST
	rm -rf dist

.PHONY: bootstrap

bootstrap: _virtualenv setup
	_virtualenv/bin/pip install -e .
ifneq ($(wildcard test-requirements.txt),)
	_virtualenv/bin/pip install -r test-requirements.txt
endif
	make clean

.PHONY: setup

setup: README

_virtualenv:
	python3 -m venv _virtualenv
	_virtualenv/bin/pip install --upgrade pip
	_virtualenv/bin/pip install --upgrade setuptools
	_virtualenv/bin/pip install --upgrade wheel
	_virtualenv/bin/pip install --upgrade build twine