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

[REQUEST] Regenerate proto code to support protobuf 4 #130

Open
wolkenschieber opened this issue May 28, 2022 · 5 comments
Open

[REQUEST] Regenerate proto code to support protobuf 4 #130

wolkenschieber opened this issue May 28, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@wolkenschieber
Copy link

When using librespot-python in version 0.0.1 it pulls a dependency to package `protobuf´. If this dependency is updated to current version 4.20.1, the library ceases to work producing following error:

  File "/mnt/Development/python/virtualenv/librespot-demo/lib/python3.10/site-packages/librespot/proto/Metadata_pb2.py", line 30, in <module>
    _descriptor.EnumValueDescriptor(
  File "/mnt/Development/python/virtualenv/librespot-demo/lib/python3.10/site-packages/google/protobuf/descriptor.py", line 755, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
@wolkenschieber wolkenschieber added the enhancement New feature or request label May 28, 2022
@kokarare1212
Copy link
Owner

Temporarily forced to use requirements.txt version because proto2 is used in upstream repositories.

@van4oza
Copy link

van4oza commented May 10, 2023

Can protobuf be updated or changed? having conflicts with google api

    google-api-core 2.11.0 depends on protobuf!=3.20.0, !=3.20.1, !=4.21.0, !=4.21.1, !=4.21.2, !=4.21.3, !=4.21.4, !=4.21.5, <5.0.0dev and >=3.19.5
    librespot 0.0.8 depends on protobuf==3.20.1
    google-api-core 2.10.2 depends on protobuf!=3.20.0, !=3.20.1, !=4.21.0, !=4.21.1, !=4.21.2, !=4.21.3, !=4.21.4, !=4.21.5, <5.0.0dev and >=3.19.5
    librespot 0.0.8 depends on protobuf==3.20.1
    google-api-core 1.34.0 depends on protobuf!=3.20.0, !=3.20.1, !=4.21.0, !=4.21.1, !=4.21.2, !=4.21.3, !=4.21.4, !=4.21.5, <4.0.0dev and >=3.19.5
    librespot 0.0.8 depends on protobuf==3.20.1
    google-api-core 1.33.2 depends on protobuf!=3.20.0, !=3.20.1, !=4.21.0, !=4.21.1, !=4.21.2, !=4.21.3, !=4.21.4, !=4.21.5, <4.0.0dev and >=3.19.5

@kokarare1212
Copy link
Owner

It's difficult because proto2 is no longer supported in newer versions at the moment...

@ChanceHarrison
Copy link

Please excuse my lack of understanding, but it isn't clear to me what the path to resolution here might be.

Questions that arise from past past comments:

  • "proto2 is used in upstream repositories"
    • is that still the case? which dependencies/repositories? are they likely to get upgraded or do we have alternatives that are compatible with a newer version of protobuf?
  • "proto2 is no longer supported in newer versions "
    • the newer versions of what?
  • "Temporarily forced to use requirements.txt version"
    • as opposed to what other version?

I would definitely be curious as to if there are any workarounds for package maintainers such that other packages that depend on librespot-python don't run into the same error?

@kokarare1212
Copy link
Owner

This project is a port of librespot-java for Python.
The original repository now seems to have a mix of proto2 and proto3, but protobuf in Python cannot use proto2 above version 4.0, so versions 3.20.3 or lower must be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants