You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, the previous version in which this bug was not present was: ....
Unable to verify.
Description
A clear and concise description of the problem...
I realized an issue yesterday that many of the PIP dependencies cannot be used because of ModuleNotFoundError. I investigated a bit and found out that they are all "google.xxx" modules.
My investigation has led me here, I believe the implementation of py_proto_library might have caused all "import google.xxx" to be directed to a runfile path with just "google.protobuf".
/home/ubuntu/.cache/bazel/_bazel_ubuntu/9b2305b6489efaf56c30b637b3658310/execroot/rules_python_pip_parse_example/bazel-out/k8-fastbuild/bin/main.runfiles/com_github_protocolbuffers_protobuf/python/google/__init__.py
['/home/ubuntu/.cache/bazel/_bazel_ubuntu/9b2305b6489efaf56c30b637b3658310/execroot/rules_python_pip_parse_example/bazel-out/k8-fastbuild/bin/main.runfiles/com_github_protocolbuffers_protobuf/python/google']
/home/ubuntu/.cache/bazel/_bazel_ubuntu/9b2305b6489efaf56c30b637b3658310/execroot/rules_python_pip_parse_example/bazel-out/k8-fastbuild/bin/main.runfiles/com_github_protocolbuffers_protobuf/python/google/protobuf/__init__.py
Traceback (most recent call last):
File "/home/ubuntu/.cache/bazel/_bazel_ubuntu/9b2305b6489efaf56c30b637b3658310/execroot/rules_python_pip_parse_example/bazel-out/k8-fastbuild/bin/main.runfiles/rules_python_pip_parse_example/main.py", line 20, in
import google.auth
ModuleNotFoundError: No module named 'google.auth'
After more time spent, I was lucky enough to find a version of the rules_python that doesn't have this issue. After much regression testing, I found the change that introduced this issue: 6905e63
🐞 bug report
Affected Rule
The issue is caused by the rule:py_proto_library
Is this a regression?
Yes, the previous version in which this bug was not present was: ....Unable to verify.
Description
A clear and concise description of the problem...I realized an issue yesterday that many of the PIP dependencies cannot be used because of ModuleNotFoundError. I investigated a bit and found out that they are all "google.xxx" modules.
My investigation has led me here, I believe the implementation of py_proto_library might have caused all "import google.xxx" to be directed to a runfile path with just "google.protobuf".
🔬 Minimal Reproduction
I created a PR on a forked version of this repo:
yechuan51/rules_python_overriding_module#1
In additon, I have created a repo from scratch that reproduces this error:
https://github.com/yechuan51/proto_rule_overshadow
🔥 Exception or Error
🌍 Your Environment
Operating System:
Output of
bazel version
:Rules_python version:
Anything else relevant?
I asked the same question on Stackoverflow:
https://stackoverflow.com/questions/76746080/bazel-python-proto-rules-overriding-google-module
The text was updated successfully, but these errors were encountered: