From 5a4b0863a9fa378cec1c12ac4852b46aa66c2a73 Mon Sep 17 00:00:00 2001 From: "Brian J. Watson" Date: Fri, 2 Sep 2016 17:14:20 -0700 Subject: [PATCH] Make grpcio dep optional for Python googleapis-common-protos (#107) --- config/common_protos.yml | 2 +- config/dependencies.yml | 2 +- templates/commonpb/python/setup.py.mustache | 8 ++++++-- templates/python/setup.py.mustache | 2 +- test/fixtures/python/setup.py | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/config/common_protos.yml b/config/common_protos.yml index a81d4cb..353c581 100644 --- a/config/common_protos.yml +++ b/config/common_protos.yml @@ -33,4 +33,4 @@ packages: version: '' # semver is the semantic version of the common protos package. -semver: 1.3.1 +semver: 1.3.2 diff --git a/config/dependencies.yml b/config/dependencies.yml index eafc701..44ff431 100644 --- a/config/dependencies.yml +++ b/config/dependencies.yml @@ -67,7 +67,7 @@ protobuf: googleapis_common_protos: python: - version: '1.3.1' + version: '1.3.2' ruby: version: '1.2.0' diff --git a/templates/commonpb/python/setup.py.mustache b/templates/commonpb/python/setup.py.mustache index 89b0589..7079be1 100644 --- a/templates/commonpb/python/setup.py.mustache +++ b/templates/commonpb/python/setup.py.mustache @@ -10,10 +10,13 @@ import setuptools from setuptools import setup, find_packages install_requires = [ - 'protobuf>={{{dependencies.protobuf.python.version}}}', - 'grpcio>={{{dependencies.grpc.python.version}}}' + 'protobuf>={{{dependencies.protobuf.python.version}}}' ] +extras_require = { + 'grpc': ['grpcio>={{{dependencies.grpc.python.version}}}'] +} + setuptools.setup( name='{{{api.name}}}', version='{{{api.semantic_version}}}', @@ -31,6 +34,7 @@ setuptools.setup( description='Common protobufs used in Google APIs', long_description=open('README.rst').read(), install_requires=install_requires, + extras_require=extras_require, license='{{{api.license}}}', packages=find_packages(), namespace_packages=[{{#api.nsPackages}}'{{{.}}}', {{/api.nsPackages}}], diff --git a/templates/python/setup.py.mustache b/templates/python/setup.py.mustache index 336cba4..91aa7f1 100644 --- a/templates/python/setup.py.mustache +++ b/templates/python/setup.py.mustache @@ -12,7 +12,7 @@ from setuptools import setup, find_packages install_requires = [ 'oauth2client>={{{dependencies.auth.python.version}}}', 'grpcio>={{{dependencies.grpc.python.version}}}', - 'googleapis-common-protos>={{{dependencies.googleapis_common_protos.python.version}}}' + 'googleapis-common-protos[grpc]>={{{dependencies.googleapis_common_protos.python.version}}}' ] setuptools.setup( diff --git a/test/fixtures/python/setup.py b/test/fixtures/python/setup.py index 3743fce..a38e1ad 100644 --- a/test/fixtures/python/setup.py +++ b/test/fixtures/python/setup.py @@ -12,7 +12,7 @@ install_requires = [ 'oauth2client>=0.4.1', 'grpcio>=0.15.0', - 'googleapis-common-protos>=1.2.0' + 'googleapis-common-protos[grpc]>=1.2.0' ] setuptools.setup(