Hi gRPC Python users,

We have decided to deprecate the gRPC repo's implementation of the 
py_proto_library 
Bazel rule 
<https://github.com/grpc/grpc/blob/9b3cedaf29e043e9c65370c894635b43b0fdb07b/bazel/python_rules.bzl#L161>
 
in favor of the official Protobuf implementation 
<https://github.com/protocolbuffers/protobuf/blob/ca1ee8339cd20a1305b99f61b8c6220dd1aac892/bazel/py_proto_library.bzl#L175>,
 
providing a single supported solution. This change affects how Python 
libraries are generated from Proto files in Bazel builds.

Key Changes and Timeline

   - 
   
   In our next 1.72 release (scheduled to release on April 15th), we're 
   adding a use_protobuf attribute to py_proto_library. This will be true 
   by default, setting this to false will switch the implementation to the 
   gRPC version.
   - 
   
   In 1.73 (scheduled to release on May 27th), we will remove the gRPC 
   implementation of py_proto_library. And py_proto_library rule will always 
   use the Protobuf implementation.
   

Key Differences Between Implementations

There are three key differences between the gRPC implementation and the 
Protobuf implementation that you need to be aware of:

   1. 
   
   .pyi File Generation: The Protobuf implementation does not generate .pyi 
   files for type hinting.
   2. 
   
   Import Attribute and PYTHONPATH:  The Protobuf implementation does not 
   support the import attribute for adding directories to the PYTHONPATH. 
   3. 
   
   Location of Generated _pb2.py Files: When a py_proto_library directly 
   depends on a proto_library in another Bazel package, the Protobuf 
   implementation generates the _pb2.py file in the same location as the 
   proto_library.  While the gPRC implementation will generate additional .py 
   files in the current package to import the generated code.
   


Please let us know if you have any questions or concerns.


Best,

gPRC Python Team

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/grpc-io/dacbaaee-bb06-4fc8-931c-7d44e8a50ec3n%40googlegroups.com.

Reply via email to