aboutsummaryrefslogtreecommitdiffhomepage
path: root/python/release/wheel/build_wheel_manylinux.sh
diff options
context:
space:
mode:
authorGravatar Paul Yang <TeBoring@users.noreply.github.com>2017-06-28 15:22:19 -0700
committerGravatar GitHub <noreply@github.com>2017-06-28 15:22:19 -0700
commit176bac6dac03f8dc728fd9c7a0fbc96aedfed7d1 (patch)
treede0d7b0b47ae40b86d0be74f62581fc32af63af1 /python/release/wheel/build_wheel_manylinux.sh
parent12acbc2678073c3439b427be0b713b97e2074bfb (diff)
Add scripts to build python wheel for linux. (#2693)
* Add scripts to build python wheel for linux. Followed PEP513. * Fix dist check for new added files. * Update README for usage example.
Diffstat (limited to 'python/release/wheel/build_wheel_manylinux.sh')
-rwxr-xr-xpython/release/wheel/build_wheel_manylinux.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/python/release/wheel/build_wheel_manylinux.sh b/python/release/wheel/build_wheel_manylinux.sh
new file mode 100755
index 00000000..39fd8c12
--- /dev/null
+++ b/python/release/wheel/build_wheel_manylinux.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+# Print usage and fail.
+function usage() {
+ echo "Usage: protobuf_optimized_pip.sh PROTOBUF_VERSION PYPI_USERNAME PYPI_PASSWORD" >&2
+ exit 1 # Causes caller to exit because we use -e.
+}
+
+# Validate arguments.
+if [ $0 != ./build_wheel_manylinux.sh ]; then
+ echo "Please run this script from the directory in which it is located." >&2
+ exit 1
+fi
+
+if [ $# -lt 3 ]; then
+ usage
+ exit 1
+fi
+
+PROTOBUF_VERSION=$1
+PYPI_USERNAME=$2
+PYPI_PASSWORD=$3
+
+docker rmi protobuf-python-wheel
+docker build . -t protobuf-python-wheel
+docker run --rm protobuf-python-wheel ./protobuf_optimized_pip.sh $PROTOBUF_VERSION $PYPI_USERNAME $PYPI_PASSWORD
+docker rmi protobuf-python-wheel