Skip to content

Commit

Permalink
Add python_requires field to grpcio-* packages (grpc#27495)
Browse files Browse the repository at this point in the history
- Update the run_tests.py and distrib tests
- Update the Dockerfiles
  • Loading branch information
lidizheng authored Sep 28, 2021
1 parent 50a79d6 commit 9978223
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 27 deletions.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ def cython_extensions_and_necessity():
packages=list(PACKAGES),
package_dir=PACKAGE_DIRECTORIES,
package_data=PACKAGE_DATA,
python_requires='>=3.6',
install_requires=INSTALL_REQUIRES,
extras_require=EXTRAS_REQUIRES,
setup_requires=SETUP_REQUIRES,
Expand Down
1 change: 1 addition & 0 deletions src/python/grpcio_admin/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@
url='https://grpc.io',
package_dir=PACKAGE_DIRECTORIES,
packages=setuptools.find_packages('.'),
python_requires='>=3.6',
install_requires=INSTALL_REQUIRES,
setup_requires=SETUP_REQUIRES)
1 change: 1 addition & 0 deletions src/python/grpcio_channelz/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def run(self):
url='https://grpc.io',
package_dir=PACKAGE_DIRECTORIES,
packages=setuptools.find_packages('.'),
python_requires='>=3.6',
install_requires=INSTALL_REQUIRES,
setup_requires=SETUP_REQUIRES,
cmdclass=COMMAND_CLASS)
1 change: 1 addition & 0 deletions src/python/grpcio_csds/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@
url='https://grpc.io',
package_dir=PACKAGE_DIRECTORIES,
packages=setuptools.find_packages('.'),
python_requires='>=3.6',
install_requires=INSTALL_REQUIRES,
setup_requires=SETUP_REQUIRES)
1 change: 1 addition & 0 deletions src/python/grpcio_health_checking/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def run(self):
classifiers=CLASSIFIERS,
package_dir=PACKAGE_DIRECTORIES,
packages=setuptools.find_packages('.'),
python_requires='>=3.6',
install_requires=INSTALL_REQUIRES,
setup_requires=SETUP_REQUIRES,
cmdclass=COMMAND_CLASS)
1 change: 1 addition & 0 deletions src/python/grpcio_reflection/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def run(self):
url='https://grpc.io',
package_dir=PACKAGE_DIRECTORIES,
packages=setuptools.find_packages('.'),
python_requires='>=3.6',
install_requires=INSTALL_REQUIRES,
setup_requires=SETUP_REQUIRES,
cmdclass=COMMAND_CLASS)
1 change: 1 addition & 0 deletions src/python/grpcio_status/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,6 @@ def run(self):
classifiers=CLASSIFIERS,
package_dir=PACKAGE_DIRECTORIES,
packages=setuptools.find_packages('.'),
python_requires='>=3.6',
install_requires=INSTALL_REQUIRES,
cmdclass=COMMAND_CLASS)
1 change: 1 addition & 0 deletions tools/distrib/python/grpcio_tools/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ def extension_modules():
classifiers=CLASSIFIERS,
ext_modules=extension_modules(),
packages=setuptools.find_packages('.'),
python_requires='>=3.6',
install_requires=[
'protobuf>=3.5.0.post1, < 4.0dev',
'grpcio>={version}'.format(version=grpc_version.VERSION),
Expand Down
1 change: 1 addition & 0 deletions tools/distrib/python/xds_protos/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
author_email='[email protected]',
url='https://grpc.io',
license='Apache License 2.0',
python_requires='>=3.6',
install_requires=INSTALL_REQUIRES,
setup_requires=SETUP_REQUIRES,
classifiers=CLASSIFIERS)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM debian:jessie
FROM debian:buster

RUN apt-get update && apt-get install -y python3 python3-pip
RUN pip3 install virtualenv==16.7.9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM i386/debian:jessie
FROM i386/debian:buster

RUN apt-get update && apt-get install -y python3 python3-pip

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015 gRPC authors.
# Copyright 2021 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -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 python3 python3-pip
RUN pip3 install virtualenv==16.7.9
Expand Down
6 changes: 3 additions & 3 deletions tools/run_tests/artifacts/distribtest_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,10 @@ def targets():
PythonDistribTest('linux', 'x64', 'ubuntu1804'),
PythonDistribTest('linux', 'aarch64', 'python38_buster'),
PythonDistribTest('linux', 'x64', 'alpine3.7', source=True),
PythonDistribTest('linux', 'x64', 'jessie', source=True),
PythonDistribTest('linux', 'x86', 'jessie', source=True),
PythonDistribTest('linux', 'x64', 'buster', source=True),
PythonDistribTest('linux', 'x86', 'buster', source=True),
PythonDistribTest('linux', 'x64', 'centos7', source=True),
PythonDistribTest('linux', 'x64', 'fedora23', source=True),
PythonDistribTest('linux', 'x64', 'fedora34', source=True),
PythonDistribTest('linux', 'x64', 'arch', source=True),
PythonDistribTest('linux', 'x64', 'ubuntu1804', source=True),
# Ruby
Expand Down
21 changes: 1 addition & 20 deletions tools/run_tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,9 +675,7 @@ def dockerfile_dir(self):

def _python_manager_name(self):
"""Choose the docker image to use based on python version."""
if self.args.compiler in [
'python2.7', 'python3.5', 'python3.6', 'python3.7', 'python3.8'
]:
if self.args.compiler in ['python3.6', 'python3.7', 'python3.8']:
return 'stretch_' + self.args.compiler[len('python'):]
elif self.args.compiler == 'python_alpine':
return 'alpine'
Expand Down Expand Up @@ -729,16 +727,6 @@ def _get_pythons(self, args):
builder_prefix_arguments,
venv_relative_python, toolchain, runner,
test_command, args.iomgr_platform)
python27_config = _python_config_generator(name='py27',
major='2',
minor='7',
bits=bits,
config_vars=config_vars)
python35_config = _python_config_generator(name='py35',
major='3',
minor='5',
bits=bits,
config_vars=config_vars)
python36_config = _python_config_generator(name='py36',
major='3',
minor='6',
Expand Down Expand Up @@ -791,14 +779,9 @@ def _get_pythons(self, args):
return (python38_config,)
else:
return (
python35_config,
python37_config,
python38_config,
)
elif args.compiler == 'python2.7':
return (python27_config,)
elif args.compiler == 'python3.5':
return (python35_config,)
elif args.compiler == 'python3.6':
return (python36_config,)
elif args.compiler == 'python3.7':
Expand All @@ -815,8 +798,6 @@ def _get_pythons(self, args):
return (python38_config,)
elif args.compiler == 'all_the_cpythons':
return (
python27_config,
python35_config,
python36_config,
python37_config,
python38_config,
Expand Down

0 comments on commit 9978223

Please sign in to comment.