Remove Python 2.7 binary wheel generations (#26691)

* Remove Python 2.7 binary wheels

* Make sure pip won't pick-up newer versions

* Attempt to fix the distribtest

* Fallback to virtualenv==16.7.9 for 34 and 35

* Remove 34 from binary wheel distribtests
pull/26566/head^2
Lidi Zheng 4 years ago committed by GitHub
parent ee17927fce
commit 5820e152cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      setup.py
  2. 1
      src/python/grpcio_admin/setup.py
  3. 2
      src/python/grpcio_channelz/setup.py
  4. 1
      src/python/grpcio_csds/setup.py
  5. 2
      src/python/grpcio_health_checking/setup.py
  6. 2
      src/python/grpcio_reflection/setup.py
  7. 2
      src/python/grpcio_status/setup.py
  8. 2
      test/distrib/python/test_packages.sh
  9. 1
      tools/distrib/python/grpc_prefixed/templates/setup.py.template
  10. 5
      tools/distrib/python/grpcio_tools/setup.py
  11. 10
      tools/distrib/python/xds_protos/build_validate_upload.sh
  12. 3
      tools/distrib/python/xds_protos/setup.py
  13. 8
      tools/dockerfile/distribtest/python_arch_x64/Dockerfile
  14. 33
      tools/dockerfile/distribtest/python_centos6_x64/Dockerfile
  15. 3
      tools/dockerfile/distribtest/python_centos7_x64/Dockerfile
  16. 6
      tools/dockerfile/distribtest/python_dev_alpine3.7_x64/Dockerfile
  17. 8
      tools/dockerfile/distribtest/python_dev_arch_x64/Dockerfile
  18. 10
      tools/dockerfile/distribtest/python_dev_centos7_x64/Dockerfile
  19. 6
      tools/dockerfile/distribtest/python_dev_fedora23_x64/Dockerfile
  20. 6
      tools/dockerfile/distribtest/python_dev_jessie_x64/Dockerfile
  21. 6
      tools/dockerfile/distribtest/python_dev_jessie_x86/Dockerfile
  22. 6
      tools/dockerfile/distribtest/python_dev_ubuntu1604_x64/Dockerfile
  23. 6
      tools/dockerfile/distribtest/python_dev_ubuntu1804_x64/Dockerfile
  24. 6
      tools/dockerfile/distribtest/python_fedora34_x64/Dockerfile
  25. 8
      tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile
  26. 6
      tools/dockerfile/distribtest/python_stretch_x64/Dockerfile
  27. 6
      tools/dockerfile/distribtest/python_stretch_x86/Dockerfile
  28. 4
      tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile
  29. 4
      tools/dockerfile/distribtest/python_ubuntu1804_x64/Dockerfile
  30. 7
      tools/run_tests/artifacts/artifact_targets.py
  31. 7
      tools/run_tests/artifacts/distribtest_targets.py
  32. 13
      tools/run_tests/run_tests.py

@ -98,8 +98,6 @@ LICENSE = 'Apache License 2.0'
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',

@ -30,7 +30,6 @@ import grpc_version
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'License :: OSI Approved :: Apache Software License',
]

@ -47,8 +47,6 @@ class _NoOpCommand(setuptools.Command):
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',

@ -30,7 +30,6 @@ import grpc_version
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'License :: OSI Approved :: Apache Software License',
]

@ -46,8 +46,6 @@ class _NoOpCommand(setuptools.Command):
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',

@ -47,8 +47,6 @@ class _NoOpCommand(setuptools.Command):
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',

@ -46,8 +46,6 @@ class _NoOpCommand(setuptools.Command):
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',

@ -35,7 +35,7 @@ REFLECTION_ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio-reflection-[0-9
TESTING_ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio-testing-[0-9]*.tar.gz)
VIRTUAL_ENV=$(mktemp -d)
virtualenv "$VIRTUAL_ENV"
python3 -m virtualenv "$VIRTUAL_ENV"
PYTHON=$VIRTUAL_ENV/bin/python
"$PYTHON" -m pip install --upgrade six pip wheel

@ -20,7 +20,6 @@ import setuptools
CLASSIFIERS = [
'Development Status :: 7 - Inactive',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'License :: OSI Approved :: Apache Software License',
]

@ -55,12 +55,7 @@ _parallel_compile_patch.monkeypatch_compile_maybe()
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'License :: OSI Approved :: Apache Software License',
]

@ -23,21 +23,13 @@ rm -rf ${WORK_DIR}/dist
# Generate the package content then build the source wheel
python3 build.py
python3 setup.py sdist
python2 setup.py bdist_wheel
python3 setup.py bdist_wheel
# Run the tests to ensure all protos are importable, also avoid confusing normal
# imports with relative imports
pushd $(mktemp -d '/tmp/test_xds_protos.XXXXXX')
python2 -m virtualenv env
env/bin/python -m pip install ${WORK_DIR}/dist/xds-protos-*.tar.gz
cp ${WORK_DIR}/generated_file_import_test.py generated_file_import_test.py
env/bin/python generated_file_import_test.py
popd
pushd $(mktemp -d '/tmp/test_xds_protos.XXXXXX')
python3 -m virtualenv env
env/bin/python -m pip install ${WORK_DIR}/dist/xds-protos-*.tar.gz
env/bin/python -m pip install ${WORK_DIR}/dist/*.whl
cp ${WORK_DIR}/generated_file_import_test.py generated_file_import_test.py
env/bin/python generated_file_import_test.py
popd

@ -27,7 +27,6 @@ PACKAGES = setuptools.find_packages(where=".", exclude=EXCLUDE_PYTHON_FILES)
CLASSIFIERS = [
'Development Status :: 3 - Alpha',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'License :: OSI Approved :: Apache Software License',
]
@ -38,7 +37,7 @@ INSTALL_REQUIRES = [
SETUP_REQUIRES = INSTALL_REQUIRES + ['grpcio-tools']
setuptools.setup(
name='xds-protos',
version='0.0.8',
version='0.0.10',
packages=PACKAGES,
description='Generated Python code from envoyproxy/data-plane-api',
long_description_content_type='text/x-rst',

@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM base/archlinux
FROM archlinux:base
RUN pacman --noconfirm -Syy
RUN pacman --noconfirm -S openssl
RUN pacman --noconfirm -S python2
RUN pacman --noconfirm -S python2-pip
RUN pip2 install virtualenv
RUN pacman --noconfirm -S python
RUN pacman --noconfirm -S python-pip
RUN pip3 install virtualenv

@ -1,33 +0,0 @@
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM centos:6
RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
# Vanilla CentOS6 only has python 2.6 and we don't support that.
RUN yum -y install yum -y install https://centos6.iuscommunity.org/ius-release.rpm
RUN yum install -y python27
# Override python2.6
RUN ln -s /usr/bin/python2.7 /usr/local/bin/python
RUN ln -s /usr/bin/python2.7 /usr/local/bin/python2
# Install pip
RUN curl https://bootstrap.pypa.io/get-pip.py | python -
# "which" command required by python's run_distrib_test.sh
RUN yum install -y which
RUN pip install virtualenv

@ -17,4 +17,5 @@ FROM centos:7
RUN yum install -y python
RUN yum install -y epel-release
RUN yum install -y python-pip
RUN pip install virtualenv
RUN yum install -y python3
RUN python3 -m pip install virtualenv

@ -14,11 +14,11 @@
FROM alpine:3.11
RUN apk add --update build-base linux-headers python python2-dev py2-pip
RUN apk add --update build-base linux-headers python3 python3-dev py3-pip
RUN pip install --upgrade pip==19.3.1
RUN pip3 install --upgrade pip==19.3.1
RUN pip install virtualenv
RUN pip3 install virtualenv
# bash is required for our test script invocation
# ideally, we want to fix the invocation mechanism

@ -12,11 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM base/archlinux
FROM archlinux:base
RUN pacman --noconfirm -Syy
RUN pacman --noconfirm -S openssl
RUN pacman --noconfirm -S python2
RUN pacman --noconfirm -S python2-pip
RUN pip2 install virtualenv
RUN pacman --noconfirm -S python
RUN pacman --noconfirm -S python-pip
RUN pip3 install virtualenv
RUN pacman --noconfirm -S base-devel

@ -14,12 +14,12 @@
FROM centos:7
RUN yum install -y python
RUN yum install -y python-devel
RUN yum install -y python3
RUN yum install -y python3-devel
RUN yum install -y epel-release
RUN yum install -y python-pip
RUN pip install --upgrade pip==19.3.1
RUN pip install -U virtualenv
RUN yum install -y python3-pip
RUN pip3 install --upgrade pip==19.3.1
RUN pip3 install -U virtualenv
# The default gcc of CentOS 7 is gcc 4.8 which is older than gcc 4.9,
# the minimum supported gcc version for gRPC Core so let's upgrade to

@ -14,10 +14,10 @@
FROM fedora:23
RUN yum clean all && yum update -y && yum install -y python python-pip
RUN pip install virtualenv
RUN yum clean all && yum update -y && yum install -y python3 python3-pip
RUN pip3 install virtualenv==16.7.9
RUN yum groupinstall -y "Development Tools"
RUN yum install -y redhat-rpm-config
RUN yum install -y gcc-c++
RUN yum install -y python2-devel
RUN yum install -y python3-devel

@ -14,8 +14,8 @@
FROM debian:jessie
RUN apt-get update && apt-get install -y python python-pip
RUN pip install virtualenv
RUN apt-get update && apt-get install -y python3 python3-pip
RUN pip3 install virtualenv==16.7.9
RUN apt-get install -y build-essential
RUN apt-get install -y python-dev
RUN apt-get install -y python3-dev

@ -14,12 +14,12 @@
FROM i386/debian:jessie
RUN apt-get update && apt-get install -y python python-pip
RUN apt-get update && apt-get install -y python3 python3-pip
RUN pip install virtualenv
RUN pip3 install virtualenv==16.7.9
RUN apt-get install -y build-essential
RUN apt-get install -y python-dev
RUN apt-get install -y python3-dev
# docker is running on a 64-bit machine, so we need to
# override "uname -m" to report i686 instead of x86_64, otherwise

@ -14,9 +14,9 @@
FROM ubuntu:16.04
RUN apt-get update -y && apt-get install -y python python-pip
RUN apt-get update -y && apt-get install -y python3 python3-pip
RUN apt-get install -y build-essential
RUN apt-get install -y python-dev
RUN apt-get install -y python3-dev
RUN pip install virtualenv
RUN pip3 install virtualenv==16.7.9

@ -14,9 +14,9 @@
FROM ubuntu:18.04
RUN apt-get update -y && apt-get install -y python python-pip
RUN apt-get update -y && apt-get install -y python3 python3-pip
RUN apt-get install -y build-essential
RUN apt-get install -y python-dev
RUN apt-get install -y python3-dev
RUN pip install virtualenv
RUN pip3 install virtualenv

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM fedora:23
FROM fedora:34
RUN yum clean all && yum update -y && yum install -y python python-pip
RUN pip install virtualenv
RUN yum clean all && yum update -y && yum install -y python3 python3-pip
RUN pip3 install virtualenv

@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM opensuse:42.1
FROM opensuse/leap:latest
RUN zypper --non-interactive install python
RUN zypper --non-interactive install python-pip
RUN zypper --non-interactive install python3
RUN zypper --non-interactive install python3-pip
# "which" command required by python's run_distrib_test.sh
RUN zypper --non-interactive install which
@ -24,4 +24,4 @@ RUN zypper --non-interactive install which
# https://pypi.python.org/simple/
RUN zypper --non-interactive install ca-certificates-mozilla
RUN pip install virtualenv
RUN pip3 install virtualenv

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM debian:jessie
FROM debian:stretch
RUN apt-get update && apt-get install -y python python-pip
RUN pip install virtualenv
RUN apt-get update && apt-get install -y python3 python3-pip
RUN pip3 install virtualenv==16.7.9

@ -12,11 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM i386/debian:jessie
FROM i386/debian:stretch
RUN apt-get update && apt-get install -y python python-pip
RUN apt-get update && apt-get install -y python3 python3-pip
RUN pip install virtualenv
RUN pip3 install virtualenv==16.7.9
# docker is running on a 64-bit machine, so we need to
# override "uname -m" to report i686 instead of x86_64, otherwise

@ -14,10 +14,10 @@
FROM ubuntu:16.04
RUN apt-get update -y && apt-get install -y python python-pip
RUN apt-get update -y && apt-get install -y python3 python3-pip
# Necessary to fix virtualenv compatibility problems with python2.7
RUN pip install --upgrade pip==19.3.1
RUN pip3 install --upgrade pip==19.3.1
# Ubuntu's python-pip package installs pip to /usr/bin, whereas the upgraded
# pip lives at /usr/local/bin/pip. We'll use the absolute path for now, since

@ -14,6 +14,6 @@
FROM ubuntu:18.04
RUN apt-get update -y && apt-get install -y python python-pip
RUN apt-get update -y && apt-get install -y python3 python3-pip
RUN pip install virtualenv
RUN pip3 install virtualenv

@ -358,15 +358,11 @@ def targets():
PythonArtifact('manylinux2014', 'x86', 'cp37-cp37m'),
PythonArtifact('manylinux2014', 'x86', 'cp38-cp38'),
PythonArtifact('manylinux2014', 'x86', 'cp39-cp39'),
PythonArtifact('manylinux2010', 'x64', 'cp27-cp27m'),
PythonArtifact('manylinux2010', 'x64', 'cp27-cp27mu'),
PythonArtifact('manylinux2010', 'x64', 'cp35-cp35m'),
PythonArtifact('manylinux2010', 'x64', 'cp36-cp36m'),
PythonArtifact('manylinux2010', 'x64', 'cp37-cp37m'),
PythonArtifact('manylinux2010', 'x64', 'cp38-cp38'),
PythonArtifact('manylinux2010', 'x64', 'cp39-cp39'),
PythonArtifact('manylinux2010', 'x86', 'cp27-cp27m'),
PythonArtifact('manylinux2010', 'x86', 'cp27-cp27mu'),
PythonArtifact('manylinux2010', 'x86', 'cp35-cp35m'),
PythonArtifact('manylinux2010', 'x86', 'cp36-cp36m'),
PythonArtifact('manylinux2010', 'x86', 'cp37-cp37m'),
@ -380,19 +376,16 @@ def targets():
PythonArtifact('linux_extra', 'armv7', 'cp37-cp37m'),
PythonArtifact('linux_extra', 'armv7', 'cp38-cp38'),
PythonArtifact('linux_extra', 'armv7', 'cp39-cp39'),
PythonArtifact('macos', 'x64', 'python2.7'),
PythonArtifact('macos', 'x64', 'python3.5'),
PythonArtifact('macos', 'x64', 'python3.6'),
PythonArtifact('macos', 'x64', 'python3.7'),
PythonArtifact('macos', 'x64', 'python3.8'),
PythonArtifact('macos', 'x64', 'python3.9'),
PythonArtifact('windows', 'x86', 'Python27_32bit'),
PythonArtifact('windows', 'x86', 'Python35_32bit'),
PythonArtifact('windows', 'x86', 'Python36_32bit'),
PythonArtifact('windows', 'x86', 'Python37_32bit'),
PythonArtifact('windows', 'x86', 'Python38_32bit'),
PythonArtifact('windows', 'x86', 'Python39_32bit'),
PythonArtifact('windows', 'x64', 'Python27'),
PythonArtifact('windows', 'x64', 'Python35'),
PythonArtifact('windows', 'x64', 'Python36'),
PythonArtifact('windows', 'x64', 'Python37'),

@ -344,11 +344,10 @@ def targets():
CSharpDistribTest('windows', 'x86'),
CSharpDistribTest('windows', 'x64'),
# Python
PythonDistribTest('linux', 'x64', 'jessie'),
PythonDistribTest('linux', 'x86', 'jessie'),
PythonDistribTest('linux', 'x64', 'centos6'),
PythonDistribTest('linux', 'x64', 'stretch'),
PythonDistribTest('linux', 'x86', 'stretch'),
PythonDistribTest('linux', 'x64', 'centos7'),
PythonDistribTest('linux', 'x64', 'fedora23'),
PythonDistribTest('linux', 'x64', 'fedora34'),
PythonDistribTest('linux', 'x64', 'opensuse'),
PythonDistribTest('linux', 'x64', 'arch'),
PythonDistribTest('linux', 'x64', 'ubuntu1604'),

@ -775,6 +775,11 @@ class PythonLanguage(object):
minor='8',
bits=bits,
config_vars=config_vars)
python39_config = _python_config_generator(name='py39',
major='3',
minor='9',
bits=bits,
config_vars=config_vars)
pypy27_config = _pypy_config_generator(name='pypy',
major='2',
config_vars=config_vars)
@ -804,13 +809,9 @@ class PythonLanguage(object):
# NOTE(rbellevi): Testing takes significantly longer on
# MacOS, so we restrict the number of interpreter versions
# tested.
return (
python27_config,
python38_config,
)
return (python38_config,)
else:
return (
python27_config,
python35_config,
python37_config,
python38_config,
@ -825,6 +826,8 @@ class PythonLanguage(object):
return (python37_config,)
elif args.compiler == 'python3.8':
return (python38_config,)
elif args.compiler == 'python3.9':
return (python39_config,)
elif args.compiler == 'pypy':
return (pypy27_config,)
elif args.compiler == 'pypy3':

Loading…
Cancel
Save