summaryrefslogtreecommitdiff
path: root/Makefile
blob: 250e6e289fa089b94f2e7d959128556f25f691bb (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
PATH := build/python/bin:$(PATH)
VERSION = $(shell python setup.py --version)
ALLFILES = $(shell echo bottle.py test/*.py test/views/*.tpl)

.PHONY: release coverage install docs intl test test_all test_25 test_26 test_27 test_31 test_32 test_33 2to3 clean

release: test_all
	python setup.py --version | egrep -q -v '[a-zA-Z]' # Fail on dev/rc versions
	git commit -e -m "Release of $(VERSION)"           # Fail on nothing to commit
	git tag -a -m "Release of $(VERSION)" $(VERSION)   # Fail on existing tags
	git push origin HEAD                               # Fail on out-of-sync upstream
	git push origin tag $(VERSION)                     # Fail on dublicate tag
	python setup.py sdist bdist_wheel register upload  # Release to pypi

coverage:
	-mkdir build/
	coverage erase
	COVERAGE_PROCESS_START=.coveragerc test/testall.py
	coverage combine
	coverage report
	coverage html

push: test_all
	git push origin HEAD

install:
	python setup.py install

docs:
	# Generates documentation for all versions
	# EN: build/docs/html/
	# <langs>: build/docs/html/<langs>
	sphinx-build -b html -d build/docs/doctrees docs build/docs/html/;
	for lang in $(LANGS); do \
		sphinx-build -b html -d build/docs/doctrees/$$lang -D language=$$lang docs build/docs/html/$$lang; \
	done

intl:
	./docs/_locale/update.sh

test:
	python test/testall.py

test_all: test_25 test_26 test_27 test_31 test_32 test_33 test_34

test_25:
	python2.5 test/testall.py

test_26:
	python2.6 test/testall.py

test_27:
	python2.7 test/testall.py

test_31:
	python3.1 test/testall.py

test_32:
	python3.2 test/testall.py

test_33:
	python3.3 test/testall.py

test_34:
	python3.4 test/testall.py

test_35:
	python3.5 test/testall.py

test_setup:
	bash test/build_python.sh 2.5 build/python
	bash test/build_python.sh 2.6 build/python
	bash test/build_python.sh 2.7 build/python
	bash test/build_python.sh 3.1 build/python
	bash test/build_python.sh 3.2 build/python
	bash test/build_python.sh 3.3 build/python
	bash test/build_python.sh 3.4 build/python
	bash test/build_python.sh 3.5 build/python

clean:
	rm -rf build/ dist/ MANIFEST 2>/dev/null || true
	find . -name '__pycache__' -exec rm -rf {} +
	find . -name '*.pyc' -exec rm -f {} +
	find . -name '*.pyo' -exec rm -f {} +
	find . -name '*~' -exec rm -f {} +
	find . -name '._*' -exec rm -f {} +