Skip to content
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

Importing a proto_py_library fails to resolve with gazelle #375

Open
michael-christen opened this issue May 25, 2024 · 1 comment
Open

Comments

@michael-christen
Copy link

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.

michael-christen/toolbox#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant