Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PubSub protobuf dependency requirements incorrect #6128

Closed
aarontp opened this issue Sep 27, 2018 · 1 comment
Closed

PubSub protobuf dependency requirements incorrect #6128

aarontp opened this issue Sep 27, 2018 · 1 comment
Assignees
Labels
api: pubsub Issues related to the Pub/Sub API. packaging priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@aarontp
Copy link

aarontp commented Sep 27, 2018

I think the minimum version for the protobuf package dependency is not correct. google-cloud-python has the version requirements as protobuf>=3.0.0, but it fails to import when using version up to and including protobuf==3.3.0. I'm not sure what the exact correct version is, but the last version of google-cloud-pubsub to work with protobuf==3.3.0 is google-cloud-pubsub==0.35.4. I believe after this commit (371333a#diff-29280288794caf553b0b008084a0e854), a protobuf version >3.3.0 is required:

Python version

$ python --version
Python 2.7.15rc1

Package versions:

$ pip list | grep -E '(cloud|protobuf)'
google-cloud-core                  0.28.1      
google-cloud-datastore             1.7.0       
google-cloud-pubsub                0.38.0      
google-cloud-storage               1.12.0      
protobuf                           3.3.0 

Getting a stack track just importing pubsub (in ipython here)

In [1]: from google.cloud import pubsub
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-8fba37b708ad> in <module>()
----> 1 from google.cloud import pubsub

/home/aaronpeterson/.local/share/virtualenvs/turbinia-docs-oOHvuNoj/local/lib/python2.7/site-packages/google/cloud/pubsub.py in <module>()
     17 from __future__ import absolute_import
     18 
---> 19 from google.cloud.pubsub_v1 import PublisherClient
     20 from google.cloud.pubsub_v1 import SubscriberClient
     21 from google.cloud.pubsub_v1 import types

/home/aaronpeterson/.local/share/virtualenvs/turbinia-docs-oOHvuNoj/local/lib/python2.7/site-packages/google/cloud/pubsub_v1/__init__.py in <module>()
     15 from __future__ import absolute_import
     16 
---> 17 from google.cloud.pubsub_v1 import types
     18 from google.cloud.pubsub_v1 import publisher
     19 from google.cloud.pubsub_v1 import subscriber

/home/aaronpeterson/.local/share/virtualenvs/turbinia-docs-oOHvuNoj/local/lib/python2.7/site-packages/google/cloud/pubsub_v1/types.py in <module>()
     28 
     29 from google.api_core.protobuf_helpers import get_messages
---> 30 from google.cloud.pubsub_v1.proto import pubsub_pb2
     31 
     32 

/home/aaronpeterson/.local/share/virtualenvs/turbinia-docs-oOHvuNoj/local/lib/python2.7/site-packages/google/cloud/pubsub_v1/proto/pubsub_pb2.py in <module>()
     45       message_type=None, enum_type=None, containing_type=None,
     46       is_extension=False, extension_scope=None,
---> 47       options=None, file=DESCRIPTOR),
     48   ],
     49   extensions=[

TypeError: __new__() got an unexpected keyword argument 'file'

Snipped the pubsub section from pipdeptree output showing the protobuf requirement is >=3.0.0:

 - google-cloud-pubsub [required: Any, installed: 0.38.0]
    - enum34 [required: Any, installed: 1.1.6]
    - google-api-core [required: >=1.1.0,<2.0.0dev, installed: 1.4.0]
      - futures [required: >=3.2.0, installed: 3.2.0]
      - google-auth [required: >=0.4.0,<2.0.0dev, installed: 1.5.1]
        - cachetools [required: >=2.0.0, installed: 2.1.0]
        - pyasn1-modules [required: >=0.2.1, installed: 0.2.2]
          - pyasn1 [required: >=0.4.1,<0.5.0, installed: 0.4.4]
        - rsa [required: >=3.1.4, installed: 4.0]
          - pyasn1 [required: >=0.1.3, installed: 0.4.4]
        - six [required: >=1.9.0, installed: 1.11.0]
      - googleapis-common-protos [required: >=1.5.3,<2.0dev, installed: 1.5.3]
        - protobuf [required: >=3.0.0, installed: 3.3.0]
          - setuptools [required: Any, installed: 40.4.3]
          - six [required: >=1.9, installed: 1.11.0]
      - protobuf [required: >=3.0.0, installed: 3.3.0]
        - setuptools [required: Any, installed: 40.4.3]
        - six [required: >=1.9, installed: 1.11.0]
@JustinBeckwith JustinBeckwith added the triage me I really want to be triaged. label Sep 28, 2018
@tseaver tseaver added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. packaging api: pubsub Issues related to the Pub/Sub API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. and removed triage me I really want to be triaged. labels Sep 28, 2018
@tseaver tseaver self-assigned this Sep 28, 2018
@tseaver
Copy link
Contributor

tseaver commented Sep 28, 2018

@aarontp Thanks for the analysis and report. We should be making a new google.api_core release today with an updated pin on protobuf>=3.4.0, which I verified is the lowest version needed by google-cloud-protobuf google-cloud-pubsub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API. packaging priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants