-
-
Notifications
You must be signed in to change notification settings - Fork 593
bazel run //:gazelle doesn't work with imports with format ("from x import y") #709
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
Comments
workaround is possible by changing |
We ended up finding that solution, but it only works sometimes. We ended up running into situations where it throws errors about importing |
Fixes bazel-contrib#709. Test case for pip imports using "from foo import bar". Test cases for imports of the form "from foo import bar". Remove unnecessary flag (replaced with continue's). Make sure from imports work with std modules. - Add test case with `from __future__ import print_function`. Guard python_interpreter_target workspace name on None type check. (bazel-contrib#755) Fix for requirements_lock with PEP440 direct references (bazel-contrib#756) Fix indentation error. - Make sure that `from foo import bar, baz` works. - Add test case for this.
Uh oh!
There was an error while loading. Please reload this page.
🐞 bug report
Affected Rule
The issue is caused by the rule:Is this a regression?
Unsure about this.
Description
When importing a google.cloud modules in the formar
from google.cloud import aiplatform
, we get the following error when runningbazel run //:gazelle
.But when we use the format
import google.cloud.aiplatform as aiplatform
, the commandbazel run //:gazelle
finishes successfully and the BUILD files are updated accordingly.🔬 Minimal Reproduction
Here is a link to a toy example where the issue can be reproduced: https://github.com/sramirezmartin/gazelle-toy-example
The commands to run are:
🔥 Exception or Error
🌍 Your Environment
Operating System:
Output of
bazel version
:Rules_python version:
The text was updated successfully, but these errors were encountered: