-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
64 lines (52 loc) · 1.19 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
.PHONY: clean
clean:
@rm -f example.sqlite
@rm -Rf dist/
@rm -Rf build/
@rm -Rf indexes/
@rm -Rf __pycache__/
@rm -Rf ponyindexes/
@rm -Rf ponywhoosh.egg-info
@find . -name "*.pyc" -type f -delete
# ========= Python 2.7 =============================================
.PHONY: install-py2
install-py2 :
make clean
python2 setup.py install
.PHONY: test-py2
test-py2:
make install-py2
python2 -m unittest test
# ========= Python 3 ===============================================
.PHONY: install-py3
install-py3 :
make clean
python3 setup.py install
.PHONY: test-py3
test-py3 :
make install-py3
python3 -m unittest test
.PHONY : default
default :
test-py2
make clean
test-py3
.PHONY: pip-package
pip-package:
rm -Rf dist
rm -Rf build
python setup.py build
python setup.py sdist
python setup.py bdist_wheel --universal
twine upload dist/*
# pip install twine
.PHONY : deploy
deploy :
$(eval VERSION := $(shell bash -c 'read -p "Version: " pwd; echo $$pwd'))
echo
$(eval MSG := $(shell bash -c 'read -p "Comment: " pwd; echo $$pwd'))
git add .
git tag v$(VERSION)
git commit -am "[ v$(VERSION) ] new version: $(MSG)"
make pip-package
git push origin master --tags