From 67f68d7e14674bf0ff4e1bea3c3f31ced52bfc4d Mon Sep 17 00:00:00 2001 From: Lidi Zheng Date: Tue, 9 Jun 2020 10:43:32 -0700 Subject: [PATCH 1/3] Add an "extras" dependency to grpcio package --- setup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup.py b/setup.py index 2379703eb7d..b36c7cc0351 100644 --- a/setup.py +++ b/setup.py @@ -355,6 +355,9 @@ INSTALL_REQUIRES = ( "futures>=2.2.0; python_version<'3.2'", "enum34>=1.0.4; python_version<'3.4'", ) +EXTRAS_REQUIRES = { + "protobuf": "protobuf>=3.5.0.post1", +} SETUP_REQUIRES = INSTALL_REQUIRES + ( 'Sphinx~=1.8.1', @@ -417,6 +420,7 @@ setuptools.setup( package_dir=PACKAGE_DIRECTORIES, package_data=PACKAGE_DATA, install_requires=INSTALL_REQUIRES, + extras_require=EXTRAS_REQUIRES, setup_requires=SETUP_REQUIRES, cmdclass=COMMAND_CLASS, ) From d98ecdb85c2fd35b08e627cba76281cf579a548d Mon Sep 17 00:00:00 2001 From: Lidi Zheng Date: Tue, 9 Jun 2020 15:46:36 -0700 Subject: [PATCH 2/3] Set version upper bound for protobuf; installs grpcio-tools instead --- requirements.bazel.txt | 2 +- requirements.txt | 2 +- setup.py | 2 +- tools/distrib/python/grpcio_tools/setup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements.bazel.txt b/requirements.bazel.txt index 0e2ecbe0907..cbe131c6846 100644 --- a/requirements.bazel.txt +++ b/requirements.bazel.txt @@ -2,7 +2,7 @@ coverage>=4.0 cython>=0.29.8 enum34>=1.0.4 -protobuf>=3.5.0.post1 +protobuf>=3.5.0.post1, < 4.0dev six>=1.10 wheel>=0.29 futures>=2.2.0 diff --git a/requirements.txt b/requirements.txt index 773e2c7c79b..f579aeda111 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ coverage>=4.0 cython>=0.29.8 enum34>=1.0.4 -protobuf>=3.5.0.post1 +protobuf>=3.5.0.post1, < 4.0dev six>=1.10 wheel>=0.29 # rsa 4.3 is the last version support Python 2 diff --git a/setup.py b/setup.py index b36c7cc0351..92c89c3bb69 100644 --- a/setup.py +++ b/setup.py @@ -356,7 +356,7 @@ INSTALL_REQUIRES = ( "enum34>=1.0.4; python_version<'3.4'", ) EXTRAS_REQUIRES = { - "protobuf": "protobuf>=3.5.0.post1", + 'grpcio-tools>={version}'.format(version=grpc_version.VERSION), } SETUP_REQUIRES = INSTALL_REQUIRES + ( diff --git a/tools/distrib/python/grpcio_tools/setup.py b/tools/distrib/python/grpcio_tools/setup.py index 90347b529ad..9cc024f87ee 100644 --- a/tools/distrib/python/grpcio_tools/setup.py +++ b/tools/distrib/python/grpcio_tools/setup.py @@ -219,7 +219,7 @@ setuptools.setup( ext_modules=extension_modules(), packages=setuptools.find_packages('.'), install_requires=[ - 'protobuf>=3.5.0.post1', + 'protobuf>=3.5.0.post1, < 4.0dev', 'grpcio>={version}'.format(version=grpc_version.VERSION), ], package_data=package_data(), From b5ec43e182264c01123a231f526e9e992c30c2af Mon Sep 17 00:00:00 2001 From: Lidi Zheng Date: Thu, 11 Jun 2020 14:08:36 -0700 Subject: [PATCH 3/3] Fix a typo in setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 92c89c3bb69..807d005899d 100644 --- a/setup.py +++ b/setup.py @@ -356,7 +356,7 @@ INSTALL_REQUIRES = ( "enum34>=1.0.4; python_version<'3.4'", ) EXTRAS_REQUIRES = { - 'grpcio-tools>={version}'.format(version=grpc_version.VERSION), + 'protobuf': 'grpcio-tools>={version}'.format(version=grpc_version.VERSION), } SETUP_REQUIRES = INSTALL_REQUIRES + (