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

Slew of deprecation warnings for protobuf descriptors #506

Closed
Terrance opened this issue Nov 9, 2020 · 6 comments
Closed

Slew of deprecation warnings for protobuf descriptors #506

Terrance opened this issue Nov 9, 2020 · 6 comments

Comments

@Terrance
Copy link
Contributor

Terrance commented Nov 9, 2020

When using protobuf==3.13.0 on Python 3.9:

hangups/hangouts_pb2.py:19: DeprecationWarning: Call to deprecated create function FileDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
hangups/hangouts_pb2.py:33: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
(one for each declaration)

@tdryer
Copy link
Owner

tdryer commented Nov 17, 2020

I can't reproduce those warnings.

Are they triggered when you run this command?

python -W default -c "import hangups"

@tdryer
Copy link
Owner

tdryer commented Nov 17, 2020

The warnings are only showing up with Python 3.9 because there's no protobuf wheel for Python 3.9 yet, so it defaults to the Python implementation instead of the C++ implementation. Only the Python implementation raises DeprecationWarning.

We can eliminate the warnings by recompiling the proto files using a newer version of protoc (at least 3.12), but this will also require increasing the minimum protobuf package version.

@Terrance
Copy link
Contributor Author

Yes, I'm using -X dev, which implies -W default. Looks like the unlinked descriptors were deprecated back in April, but there's no obvious timescale for their removal (e.g. they're still there in the 4.0 RC).

Looks like we can put up with the warnings for now, and we're waiting on protocolbuffers/protobuf#7978 for a supported C++ build.

@steveoh
Copy link

steveoh commented Jan 8, 2021

with pytest i can ignore these in my setup.cfg with

filterwarnings =
    ignore:Call to deprecated create function FieldDescriptor
    ignore:Call to deprecated create function Descriptor
    ignore:Call to deprecated create function EnumDescriptor
    ignore:Call to deprecated create function EnumValueDescriptor
    ignore:Call to deprecated create function FileDescriptor
    ignore:Call to deprecated create function OneofDescriptor

@Terrance
Copy link
Contributor Author

protobuf v3.15 has been released with py39 wheels -- can we get a requirements bump to <3.16?

tdryer added a commit that referenced this issue Feb 28, 2021
@Terrance
Copy link
Contributor Author

We've got v0.4.13 with the requirements bump now, so I think we're good to close this. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants