Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions python/release/wheel/Dockerfile-AArch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM quay.io/pypa/manylinux2014_aarch64

RUN yum install -y libtool gcc-c++ gcc
RUN /opt/python/cp36-cp36m/bin/pip install twine

COPY protobuf_optimized_pip.sh /
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM quay.io/pypa/manylinux1_x86_64

RUN yum install -y libtool
RUN /opt/python/cp27-cp27mu/bin/pip install twine
RUN /opt/python/cp36-cp36m/bin/pip install twine

COPY protobuf_optimized_pip.sh /
6 changes: 5 additions & 1 deletion python/release/wheel/build_wheel_manylinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ fi
PROTOBUF_VERSION=$1
PYPI_USERNAME=$2
PYPI_PASSWORD=$3
PLAT=x86_64
if [ `uname -m` = 'aarch64' ]; then
PLAT=AArch64
fi

docker rmi protobuf-python-wheel
docker build . -t protobuf-python-wheel
docker build . -f Dockerfile-${PLAT} -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
12 changes: 10 additions & 2 deletions python/release/wheel/protobuf_optimized_pip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ function build_wheel() {
PYTHON_VERSION=$1
PYTHON_BIN=/opt/python/${PYTHON_VERSION}/bin/python

PLAT=x86_64
if [ `uname -m` = 'aarch64' ]; then
PLAT=aarch64
fi

$PYTHON_BIN setup.py bdist_wheel --cpp_implementation --compile_static_extension
auditwheel repair dist/protobuf-${PROTOBUF_VERSION}-${PYTHON_VERSION}-linux_x86_64.whl
auditwheel repair dist/protobuf-${PROTOBUF_VERSION}-${PYTHON_VERSION}-linux_${PLAT}.whl
}

# Validate arguments.
Expand All @@ -36,6 +41,9 @@ PYPI_PASSWORD=$3

DIR=${PWD}/'protobuf-python-build'
PYTHON_VERSIONS=('cp27-cp27mu' 'cp33-cp33m' 'cp34-cp34m' 'cp35-cp35m' 'cp36-cp36m')
if [ `uname -m` = 'aarch64' ]; then
PYTHON_VERSIONS=('cp36-cp36m' 'cp37-cp37m' 'cp38-cp38')
fi

mkdir -p ${DIR}
cd ${DIR}
Expand Down Expand Up @@ -63,4 +71,4 @@ do
build_wheel $PYTHON_VERSION
done

/opt/python/cp27-cp27mu/bin/twine upload wheelhouse/*
/opt/python/cp36-cp36m/bin/twine upload wheelhouse/*