-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.sh
60 lines (45 loc) · 1.72 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
#!/bin/sh
PACKAGE=`python setup.py --fullname`
echo Building $PACKAGE
if [ "$1" = "release" ]; then
echo "Making release, uploading to PyPi and Anaconda..."
# Python 2
source ~/anaconda2/bin/activate root
~/anaconda2/bin/conda config --set anaconda_upload yes
python setup.py sdist # Source
python setup.py bdist_egg # Binary
python setup.py --no-pkg-config bdist_conda # Conda binary
# Python 3 (source only needed once)
source ~/anaconda3/bin/activate root
~/anaconda3/bin/conda config --set anaconda_upload yes
python setup.py bdist_egg # Binary
python setup.py --no-pkg-config bdist_conda # Conda binary
# Upload using twine
twine upload dist/$PACKAGE-* --sign
# docs will be built automatically by readthedocs.org
else
echo "Dry run, not uploading anything..."
# Python 2
source ~/anaconda2/bin/activate root
~/anaconda2/bin/conda config --set anaconda_upload no
python setup.py sdist # Source
python setup.py bdist_egg # Binary
python setup.py --no-pkg-config bdist_conda # Conda binary
# Python 3 (source only needed once)
source ~/anaconda3/bin/activate root
~/anaconda3/bin/conda config --set anaconda_upload no
python setup.py bdist_egg # Binary
python setup.py --no-pkg-config bdist_conda # Conda binary
# Upload using twine
twine upload dist/$PACKAGE-* --sign -r pypitest
# List package
echo Created following packages
ls -1 dist/$PACKAGE-*
# Install & test
python setup.py check
python setup.py install
python setup.py test
# docs
python setup.py build_sphinx
sphinx-build -b doctest -d doc/build/doctrees/ doc/source/ doc/build/
fi