Skip to content

Lightstep has undeclared dependency on protobuf >= 3.6.0 #58

Closed
@michael-booth

Description

@michael-booth

We came across an issue internally where we have services which had a declared dependency on protobuf==3.0.0. When the lightstep dependency was introduced and imported we received an exception TypeError: __init__() got an unexpected keyword argument 'serialized_options'

It would appear the lightstep protos have been compiled with protoc 3.6.0 or greater which introduced the serialised_options property which isn't available in earlier versions of protobuf.

Dependencies of the lightstep library which require protobuf declare a required version of 3.0.0 or greater. Lightstep does not have a dependency stated for protobuf==3.6.0

$ pipdeptree
lightstep==4.0.1
  - basictracer [required: >=3.0,<3.1, installed: 3.0.0]
    - opentracing [required: ==2.0.0, installed: 2.0.0]
    - protobuf [required: >=3.0.0b2.post2, installed: 3.0.0]
      - setuptools [required: Any, installed: 39.0.1]
      - six [required: >=1.9, installed: 1.11.0]
    - six [required: >=1.10.0,<2.0, installed: 1.11.0]
  - googleapis-common-protos [required: ==1.5.3, installed: 1.5.3]
    - protobuf [required: >=3.0.0, installed: 3.0.0]
      - setuptools [required: Any, installed: 39.0.1]
      - six [required: >=1.9, installed: 1.11.0]

Repo Steps:

pip install protobuf==3.0.0 lightstep

$ python
Python 3.6.6 (default, Oct 17 2018, 16:21:40)
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import lightstep
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/michaelb/basement/skyscanner/forks/lightstep-tracer-python/lightstep/__init__.py", line 3, in <module>
    from .tracer import Tracer  # noqa
  File "/Users/michaelb/basement/skyscanner/forks/lightstep-tracer-python/lightstep/tracer.py", line 17, in <module>
    from .recorder import Recorder
  File "/Users/michaelb/basement/skyscanner/forks/lightstep-tracer-python/lightstep/recorder.py", line 18, in <module>
    from lightstep.http_converter import HttpConverter
  File "/Users/michaelb/basement/skyscanner/forks/lightstep-tracer-python/lightstep/http_converter.py", line 1, in <module>
    from lightstep.collector_pb2 import Auth, ReportRequest, Span, Reporter, KeyValue, Reference, SpanContext
  File "/Users/michaelb/basement/skyscanner/forks/lightstep-tracer-python/lightstep/collector_pb2.py", line 26, in <module>
    dependencies=[google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,google_dot_api_dot_annotations__pb2.DESCRIPTOR,])
TypeError: __init__() got an unexpected keyword argument 'serialized_options'
>>>

For now we have forced dependencies to resolve to using protobuf==3.6.0 by adding it as a top level requirement in order to be able to import lightstep.
I would propose this be declared in this libraries setup.py instead though?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions