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

Add support to protobuf5 #4206

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft

Conversation

emdneto
Copy link
Member

@emdneto emdneto commented Sep 30, 2024

Description

Follow-up of this thread #3958 and continue the work from this PR #3931

Steps to generate

  1. Update gen-requirements.txt
  2. run ./scripts/proto_codegen.sh

@emdneto emdneto requested a review from a team as a code owner September 30, 2024 15:20
@emdneto emdneto marked this pull request as draft September 30, 2024 15:23
@emdneto emdneto added the Approve Public API check This label shows that the public symbols added or changed in a PR are strictly necessary label Oct 1, 2024
tox.ini Show resolved Hide resolved
Copy link
Member

@aabmass aabmass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Emidio!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we should major version bump this package? It's possible the API of generated code has changed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. It does make sense to me. But I think we don't have an easy way to release the package individually, right?

Comment on lines +19 to +26
_version_not_supported = first_version_is_lower(
GRPC_VERSION, GRPC_GENERATED_VERSION
)
except ImportError:
_version_not_supported = True

if _version_not_supported:
warnings.warn(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any thoughts on how to protect users from this? Maybe we could use the oldest grpcio version supporting protobuf 5

Copy link
Member Author

@emdneto emdneto Oct 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet. I did some tests locally using a different version for runtime and got the warnings during the tests 😓

Copy link
Member Author

@emdneto emdneto Oct 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can re-generate the code using version 1.63.2 instead

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that would probably work. Apologies if you already know this, but IIRC you have to check what version of protoc and the grpc plugin are included in the grpcio-tools pypi package version.

$ python -m grpc_tools.protoc --version
libprotoc 26.1

And the version of libprotoc corresponds to the Python protobuf version in this table https://protobuf.dev/support/version-support/#python.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I did that. From 1.63.0 it starts to use libprotoc 26.1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generated with 1.63.2. But this thing is worrying me:EXPECTED_ERROR_RELEASE = "1.65.0".

tox.ini Show resolved Hide resolved
@emdneto emdneto mentioned this pull request Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approve Public API check This label shows that the public symbols added or changed in a PR are strictly necessary
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants