[Python Stub] Add version check to stubs generated by grpcio_tools#35906
Closed
XuanWang-Amos wants to merge 17 commits intogrpc:masterfrom
Closed
[Python Stub] Add version check to stubs generated by grpcio_tools#35906XuanWang-Amos wants to merge 17 commits intogrpc:masterfrom
XuanWang-Amos wants to merge 17 commits intogrpc:masterfrom
Conversation
gnossen
reviewed
Feb 15, 2024
gnossen
reviewed
Feb 15, 2024
tools/distrib/python/grpcio_tools/grpc_tools/_protoc_compiler.pyx
Outdated
Show resolved
Hide resolved
b3b5fd3 to
b0afa9a
Compare
gnossen
reviewed
Feb 23, 2024
gnossen
approved these changes
Mar 4, 2024
eugeneo
pushed a commit
to eugeneo/grpc
that referenced
this pull request
Mar 18, 2024
…rpc#35906) The stubs generated by grpcio_tools should always be used with [the same or higher version of grpcio](https://github.com/grpc/grpc/blob/master/tools/distrib/python/grpcio_tools/setup.py#L313), this change will add a run time check for this requirement inside the generated stubs and therefor enforce this requirement. Please note for now we're just printing a warning for incorrect usage, we'll **change it to an error** soon. Example warning message: ``` /usr/local/google/home/xuanwn/workspace/misc/grpc/examples/python/helloworld/helloworld_pb2_grpc.py:21: RuntimeWarning: The grpc package installed is at version 1.60.1, but the generated code in helloworld_pb2_grpc.py depends on grpcio>=1.63.0.dev0. Please upgrade your grpc module to grpcio>=1.63.0.dev0 or downgrade your generated code using grpcio-tools<=1.60.1. This warning will become an error in 1.64.0, scheduled for release on May 14,2024. ``` <!-- If you know who should review your pull request, please assign it to that person, otherwise the pull request would get assigned randomly. If your pull request is for a specific language, please add the appropriate lang label. --> Closes grpc#35906 PiperOrigin-RevId: 615659471
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The stubs generated by grpcio_tools should always be used with the same or higher version of grpcio, this change will add a run time check for this requirement inside the generated stubs and therefor enforce this requirement.
Please note for now we're just printing a warning for incorrect usage, we'll change it to an error soon.
Example warning message: