-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
71 lines (62 loc) · 1.56 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
SHELL := /bin/bash
.PHONY: clean
clean:
@rm -f example.sqlite
@rm -Rf dist/
@rm -Rf build/
@rm -Rf indexes/
@rm -Rf __pycache__/
@rm -Rf ponywhoosh_indexes/
@rm -Rf flask_ponywhoosh.egg-info
@find . -name "*.pyc" -type f -delete
.PHONY : install-py2
install-py2:
make clean
python2.7 setup.py install
.PHONY : test-py2
test-py2: install-py2
make install-py2
python2.7 -m unittest test
.PHONY : install-py3
install-py3:
make clean
python3 setup.py install
.PHONY : test-py3
test-py3: install-py3
make install-py3
python3 -m unittest test
.PHONY : docs
docs:
rm -d -Rf docs/src/_build
rm -d -Rf docs/_sources
rm -d -Rf docs/_static
rm -f docs/*.html docs/*.js .buildinfo *.inv
pip install sphinx
cd docs/src && make html
zip -vr docs/html.zip docs/src/_build/html -x "*.DS_Store"
cp -R docs/src/_build/html/* docs/
git add docs/*
git commit -m "[ docs ] updated to lastest version."
git push origin master
.PHONY : TODO
TODO :
find . -type d \( -path './.git' -o -path './dist' \) -prune -o -print \
| xargs grep -I 'TODO' \
| sort
.PHONY : README.rst
README.rst :
pandoc --from=rst --to=rst --output=README.rst README.rst
.PHONY : deploy
deploy : test-py2 test-py3 README.rst docs
pip install twine
$(eval VERSION := $(shell bash -c 'read -p "Version: " pwd; echo $$pwd'))
echo
$(eval MSG := $(shell bash -c 'read -p "Comment: " pwd; echo $$pwd'))
make clean
git tag v$(VERSION)
git commit -am "[ v$(VERSION) ] new version: $(MSG)"
python setup.py build
python setup.py sdist
python setup.py bdist_wheel --universal
twine upload dist/*
make clean