Importing a proto_py_library fails to resolve with gazelle
Hello, apologies if there's a better way to raise this / this could very well be a user error, but I've been struggling to make automatic resolution of generated python targets work with gazelle.
https://github.com/michael-christen/toolbox/pull/50 demonstrates how to reproduce the issue.
Essentially I have a proto_py_library hello_py_library with src hello_pb2.py; these are all located in directory examples/basic. If I don't add a resolve line # gazelle:resolve py examples.basic.hello_pb2 //examples/basic:hello_py_library to my top-level BUILD file then any py_library that tries to import from examples.basic import hello_pb2 will fail to resolve with gazelle, eg)
gazelle: ERROR: failed to validate dependencies for target "@mchristen//examples/basic:client": "examples.basic.hello_pb2" at line 6 from "examples/basic/client.py" is an invalid dependency: possible solutions:
Is there something I can do with gazelle or stackb_rules_proto to make gazelle aware of this mapping without having to manually annotate it each time a .proto is added?
Any help would be greatly appreciated.
Asking in https://bazelbuild.slack.com/archives/C01HMGN77Q8/p1716352687137069 as well.
Closing due to age. If you still need help with this, will re-open.
@pcj, I'd still appreciate some help, if you have the time? Do you see a similar issue with gazelle generation of proto rules or am I misconfigured?