Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Importing Python proto and gRPC targets from another module

19 views
Skip to first unread message

Haixin Tie

unread,
Apr 26, 2024, 1:09:00 AM4/26/24
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.

Regards,
HaiXin

Reply all
Reply to author
Forward
0 new messages