forked from pabigot/pyxb
-
Notifications
You must be signed in to change notification settings - Fork 2
/
pypi.sh
executable file
·37 lines (35 loc) · 954 Bytes
/
pypi.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
#! /usr/bin/env bash
if [[ $# -ne 1 ]]
then
echo "usage ./pypi.sh <release>"
exit
fi
# sudo python3 pip install -U twine wheel setuptools
bdir=$(pwd)
wdir=$(mktemp -d)
version=${1}
echo "tempdir: ${wdir}"
echo "version: ${version}"
cd $wdir
# No, this gets the release from github so that what is in this branch is not
# what is pushed to pypi. In essence, multiple runs of this script with same
# version produces same results.
wget https://github.com/al-niessner/pyxb/archive/${version}.tar.gz
tar --strip-components=1 -xzf ${version}.tar.gz
PYTHONPATH="." python3 <<EOF
import setup
import sys
if "${version}" != setup.version:
print ("Versions are not the same")
print (" CMD ARG: ${version}")
print (" setup.verion:", setup.version)
sys.exit(-1)
uv = setup.update_version(None)
uv.run()
EOF
[[ $? -ne 0 ]] && exit $?
python3 setup.py sdist
twine check dist/*
twine upload --verbose dist/*
cd ${bdir}
rm -rf ${wdir}