feat: stop generating imports when not necessary#1335
feat: stop generating imports when not necessary#1335f0rmiga merged 2 commits intobazel-contrib:mainfrom
Conversation
|
I don't think the logic is correct, based on the changed tests. Could you elaborate, please? I may be missing something. |
|
Consider this workspace, where It's perfectly fine to run: This is because Bazel use the root of the workspace as PYTHONPATH by default, so the module pkg2/lib.py is imported as The tests are updated because Note that the new behavior only affects new targets generated by Gazelle. Existing Does this make sense? |
When gazelle:python_root is not set or is at the root of the repo, we don't need to set imports for python rules, because that's the Bazel's default. This would reduce unnecessary verbosity.