Insert ppton grpcio module into Bazel project

I tried several different ways to embed the Python grpcio module in my Bazel project, but unfortunately none of them work correctly.

As far as I know, Bazel does not support injecting plugins into the Python environment (so you can directly run import grpcio ). Please note: Bazel does not support virtual and other tools (buildout ...).

I found a way to enable Pypi packages thanks to this proof of concept , but unfortunately it does not work for grpc.io (there are no environment variables).

I am trying to debug a plugin, but I am wondering if there is a better way to enable the grpcio module since the code is based on Bazel?

+6
source share
1 answer

As Nathaniel mentioned in the comments, support for the Python gRPC base is still ongoing.

However pubref https://github.com/pubref/rules_protobuf offers bazel rules that support gRPC for all languages ​​(including Python). I used them for Java and they worked very well.

There is also a gRPC blog post about these rules: http://www.grpc.io/blog/bazel_rules_protobuf

+1
source

Source: https://habr.com/ru/post/1014156/


All Articles