Importing Python proto and gRPC targets from another module

Skip to first unread message

Haixin Tie

Apr 26, 2024, 1:09:00 AMApr 26
to bazel-discuss
Hi Bazel experts,

What's the right way to import Python proto/gRpc targets defined in an external module in Bazel? This is a simple setup to demonstrate this;

1. This is the simple Git (schema) repo line that contains the proto schema and gRpc targets;

2. This is the Git (server) repo line that attempts to use the proto schema and gRPC targets;

2 builds successfully, but `bazel run server` would return the following error:

ModuleNotFoundError: No module named 'bazel_demo_schema'

What's the right way to refer to imported Python targets from external modules? BTW, when they are in the same mono-repo, everything works fine. Here is the working example. I'd appreciate your guidance.


Reply all
Reply to author
0 new messages