I tried several different ways to embed the Python grpcio
module into my Bazel project but unfortunately, none of them works correctly.
As far as I know, Bazel does not support injection of plugins into the Python environment (so you can directly run import grpcio
). Note that Bazel does not support virtual-env and other tools (buildout...).
I found a way to include Pypi packages thanks to this proof of concept but unfortunately it does not work for grpc.io (environment variables are missing).
I am trying to debug the plugin, but I wonder if there is a better way to include grpcio
module since the code is based on Bazel?
As Nathaniel mentioned in the comments, bazel support for gRPC Python is still work in progress.
However, pubref https://github.com/pubref/rules_protobuf offers rules for bazel that support gRPC for all languages (including Python). I have used them for Java and they worked very well.
There is also a gRPC blog post about those rules: http://www.grpc.io/blog/bazel_rules_protobuf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With