forked from houtianze/bypy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.sh
executable file
·99 lines (87 loc) · 1.39 KB
/
release.sh
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
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/sh
set -o errexit
#set -x
py2venv="$HOME/Documents/t/venv27"
py3venv="$HOME/Documents/t/venv34"
if [ ! -d "$py2venv" ]
then
python2 -m virtualenv "$py2venv"
fi
if [ ! -d "$py3venv" ]
then
python3 -m virtualenv "$py3venv"
fi
actual=0
build=0
install=0
upload=0
testit=0
while getopts "abuit" opt; do
case "$opt" in
a)
actual=1
;;
b)
build=1
;;
u)
build=1
upload=1
testit=1
install=1
;;
i)
install=1
;;
t)
testit=1
;;
esac
done
if [ "$actual" -eq 0 ]
then
repoopt="-r testpypi"
indexopt="-i https://testpypi.python.org/simple/"
else
repoopt=""
indexopt=""
fi
if [ "$testit" -eq 1 ]
then
python2 -m pyflakes bypy.py test/test.py
python2 setup.py test
python2 -m doctest -v bypy.py
python3 -m pyflakes bypy.py test/test.py
python3 setup.py test
python3 -m doctest -v bypy.py
fi
if [ "$build" -eq 1 ]
then
rm -Rf dist/*
python3 setup.py sdist # bdist_wheel
fi
uploadcmd="twine upload dist/* $repoopt"
if [ "$upload" -eq 0 ]
then
echo "$uploadcmd"
else
eval "$uploadcmd"
fi
if [ "$install" -eq 1 ]
then
. "$py2venv/bin/activate"
pip install requests
pip install pypandoc
pip install -U bypy $indexopt
bypy -V
bypy quota
deactivate
. "$py3venv/bin/activate"
pip install requests
pip install pypandoc
pip install -U bypy $indexopt
bypy -V
bypy quota
deactivate
fi
# vim: tabstop=4 noexpandtab shiftwidth=4 softtabstop=4 ff=unix fileencoding=utf-8