tdryer / hangups

the first third-party instant messaging client for Google Hangouts
https://hangups.readthedocs.io/
MIT License
1.71k stars 189 forks source link

Slew of deprecation warnings for protobuf descriptors #506

Closed Terrance closed 3 years ago

Terrance commented 4 years ago

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 commented 4 years ago

I can't reproduce those warnings.

Are they triggered when you run this command?

python -W default -c "import hangups"
tdryer commented 4 years ago

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 commented 4 years ago

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 commented 3 years ago

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 commented 3 years ago

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

Terrance commented 3 years ago

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