python-betterproto
python-betterproto copied to clipboard
warnings package not imported for deprecated warning.
Hi there, thanks for the great project!
My environment: betterproto: v2.0.0b3 python: v3.8.5 OS: Ubuntu 20.04
I use deprecated option in a message definition. betterproto generates a warnings.warn properly, but the warnings package is not imported, so it throws NameError: name 'warnings' is not defined. I manually add the line for now, but it'd be great if it can be fixed in the package.
Thanks!
To reprodue
syntax = "proto3";
message Foo {
option deprecated = true;
string old_field = 1;
}
seems like https://github.com/danielgtaylor/python-betterproto/blob/496eba27506a2fe18df409c4cd34a47d8ce04ffe/src/betterproto/plugin/models.py#L280 needs a case for if message.deprecated