-
Notifications
You must be signed in to change notification settings - Fork 12
feat: demonstrate python grpc #58
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
base: main
Are you sure you want to change the base?
Conversation
I've managed to get this working in a different way. It requires some changes to grpc's python_rules which I have forked and modified here, and needs a release of grpc python plugin which I've put in the same repo. |
@amol-mandhane that's neat. I'm not keen on signing up for long-term maintainence of a fork of something so complex though. We could propose this to the grpc team, I doubt they'll accept PRs but it would be great if they did. My philosophy here is basically "why does Bazel have to be weird". proto/gRPC can work with other build tools, without the protobuf or gRPC teams owning special plugins. So I'd like to make design decisions that are motivated exclusively by "how does this work in the mainstream use case". |
As far as the bazel part goes, I reckon I can get it upstream in grpc since the patch is relatively small. However, it needs prebuilt plugins, which are not released by grpc properly, and I don't think that will change. Using protoc from grpcio-tools package as shown in the example repo above is a bit too breaking for non-Python things. How do you feel about users building and caching grpc plugins on their own? It's not a particularly great option, but I don't see anything better. |
In my testing (#60), it was able to run the protoc compiler from Python (grpcio_tools) and still pass. But I understand that it is indeed overriding the protoc for these other languages which is not desirable. |
Hi, Just stumbled upon this - thank you for all the hard work you're doing! Is there a roadmap / plan to when we expect this to land, or should we try to look for alternatives? |
I have an alternative (mentioned in the comment above) here, but don't have the time currently to merge it upstream in grpc repo. If you have a python-only workspace, you can use the solution created by Chris in the link above. |
Thank you for your comment! I will wait for a proper resolution, in the meanwhile I settles on a (hacky) solution of invoking the gRPC binary outside of bazel, but I will be on the lookout for a proper solution :) Thank you! |
Ported from https://github.com/chrisirhc/precompiled-grpc-in-bazel-python
FYI @chrisirhc - I haven't gotten it working here since it overrides the protoc toolchain for all languages, breaking the non-python ones.