From aa13fde017cc5f55fe8df8aa7c0c98ccd7ece386 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 3 Feb 2021 01:53:26 +0100 Subject: [PATCH] remove obsolete scripts for python wheels (#8250) Nowadays, this seems to be script where python wheels are being built: https://github.com/protocolbuffers/protobuf/blob/ac63e80/kokoro/release/python/linux/build_artifacts.sh Removing the obsolete scripts to avoid confusion. --- Makefile.am | 4 -- python/release/wheel/Dockerfile | 6 -- python/release/wheel/README.md | 17 ----- python/release/wheel/build_wheel_manylinux.sh | 27 -------- .../release/wheel/protobuf_optimized_pip.sh | 66 ------------------- 5 files changed, 120 deletions(-) delete mode 100644 python/release/wheel/Dockerfile delete mode 100644 python/release/wheel/README.md delete mode 100755 python/release/wheel/build_wheel_manylinux.sh delete mode 100755 python/release/wheel/protobuf_optimized_pip.sh diff --git a/Makefile.am b/Makefile.am index d8b9fda140a6..53b259480ab8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1397,10 +1397,6 @@ EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \ examples/pubspec.yaml \ protobuf.bzl \ protobuf_deps.bzl \ - python/release/wheel/build_wheel_manylinux.sh \ - python/release/wheel/Dockerfile \ - python/release/wheel/protobuf_optimized_pip.sh \ - python/release/wheel/README.md \ third_party/six.BUILD \ third_party/zlib.BUILD \ third_party/wyhash/LICENSE \ diff --git a/python/release/wheel/Dockerfile b/python/release/wheel/Dockerfile deleted file mode 100644 index f38ec2f5847a..000000000000 --- a/python/release/wheel/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM quay.io/pypa/manylinux1_x86_64 - -RUN yum install -y libtool -RUN /opt/python/cp27-cp27mu/bin/pip install twine - -COPY protobuf_optimized_pip.sh / diff --git a/python/release/wheel/README.md b/python/release/wheel/README.md deleted file mode 100644 index edda2cd701d9..000000000000 --- a/python/release/wheel/README.md +++ /dev/null @@ -1,17 +0,0 @@ -Description ------------------------------- -This directory is used to build released wheels according to PEP513 and upload -them to pypi. - -Usage ------------------------------- -For example, to release 3.3.0: - ./protobuf_optimized_pip.sh 3.3.0 PYPI_USERNAME PYPI_PASSWORD - -Structure ------------------------------- -| Source | Source | -|--------------------------------------|---------------------------------------------------| -| protobuf_optimized_pip.sh | Entry point. Calling Dockerfile and build_wheel_manylinux.sh | -| Dockerfile | Build docker image according to PEP513. | -| build_wheel_manylinux.sh | Build wheel packages in the docker container. | diff --git a/python/release/wheel/build_wheel_manylinux.sh b/python/release/wheel/build_wheel_manylinux.sh deleted file mode 100755 index 39fd8c127388..000000000000 --- a/python/release/wheel/build_wheel_manylinux.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/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 diff --git a/python/release/wheel/protobuf_optimized_pip.sh b/python/release/wheel/protobuf_optimized_pip.sh deleted file mode 100755 index 07c2a093bba7..000000000000 --- a/python/release/wheel/protobuf_optimized_pip.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env bash - -# DO NOT use this script manually! Called by docker. - -set -ex - -# Print usage and fail. -function usage() { - echo "Usage: protobuf_optimized_pip.sh PROTOBUF_VERSION" >&2 - exit 1 # Causes caller to exit because we use -e. -} - -# Build wheel -function build_wheel() { - PYTHON_VERSION=$1 - PYTHON_BIN=/opt/python/${PYTHON_VERSION}/bin/python - - $PYTHON_BIN setup.py bdist_wheel --cpp_implementation --compile_static_extension - auditwheel repair dist/protobuf-${PROTOBUF_VERSION}-${PYTHON_VERSION}-linux_x86_64.whl -} - -# Validate arguments. -if [ $0 != ./protobuf_optimized_pip.sh ]; then - echo "Please run this script from the directory in which it is located." >&2 - exit 1 -fi - -if [ $# -lt 1 ]; then - usage - exit 1 -fi - -PROTOBUF_VERSION=$1 -PYPI_USERNAME=$2 -PYPI_PASSWORD=$3 - -DIR=${PWD}/'protobuf-python-build' -PYTHON_VERSIONS=('cp27-cp27mu' 'cp33-cp33m' 'cp34-cp34m' 'cp35-cp35m' 'cp36-cp36m') - -mkdir -p ${DIR} -cd ${DIR} -curl -SsL -O https://github.com/protocolbuffers/protobuf/archive/v${PROTOBUF_VERSION}.tar.gz -tar xzf v${PROTOBUF_VERSION}.tar.gz -cd $DIR/protobuf-${PROTOBUF_VERSION} - -# Autoconf on centos 5.11 cannot recognize AC_PROG_OBJC. -sed -i '/AC_PROG_OBJC/d' configure.ac -sed -i 's/conformance\/Makefile//g' configure.ac - -# Use the /usr/bin/autoconf and related tools to pick the correct aclocal macros -export PATH="/usr/bin:$PATH" - -# Build protoc -./autogen.sh -CXXFLAGS="-fPIC -g -O2" ./configure -make -j8 -export PROTOC=$DIR/src/protoc - -cd python - -for PYTHON_VERSION in "${PYTHON_VERSIONS[@]}" -do - build_wheel $PYTHON_VERSION -done - -/opt/python/cp27-cp27mu/bin/twine upload wheelhouse/*