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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

test '<name>_test' target fails on 0.22 with --noexperimental_python_import_all_repositories set #1241

Closed
mark-thm opened this issue May 29, 2023 · 0 comments 路 Fixed by #1243

Comments

@mark-thm
Copy link
Contributor

mark-thm commented May 29, 2023

馃悶 bug report

Affected Rule

compile_pip_requirements

Is this a regression?

Yes, this problem was not present in 0.21.0.

Description

When test --noexperimental_python_import_all_repositories is configured in .bazelrc and when testing the <name>_test target results in the error:

Traceback (most recent call last):
  File "<snip>/execroot/_main/bazel-out/k8-fastbuild/bin/requirements_test.runfiles/rules_python~0.22.0/python/pip_install/tools/dependency_resolver/dependency_resolver.py", line 26, in <module>
    from python.runfiles import runfiles
ModuleNotFoundError: No module named 'python'

馃敩 Minimal Reproduction

Update examples/bzlmod/.bazelrc to include the line:

test --noexperimental_python_import_all_repositories

Run bazel test //:requirements_test.

馃敟 Exception or Error


Traceback (most recent call last):
  File "/execroot/_main/bazel-out/k8-fastbuild/bin/requirements_test.runfiles/rules_python~0.22.0/python/pip_install/tools/dependency_resolver/dependency_resolver.py", line 26, in 
    from python.runfiles import runfiles
ModuleNotFoundError: No module named 'python'

馃實 Your Environment

Operating System:

  
Linux
  

Output of bazel version:

  
Bazelisk version: v1.12.2
Build label: 6.2.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue May 9 18:33:08 2023 (1683657188)
Build timestamp: 1683657188
Build timestamp as int: 1683657188
  

Rules_python version:

  
0.22.0
  

Anything else relevant?

It looks like #1124 updated dependency_resolver.py to include a new dependency on python.runfiles.

We incorporated this option during our upgrade from 0.9.0 to 0.10.2 based on the guidance in #792 after running into some PYTHONPATH length problems -- the 0.10.x series added site-packages to the deps repository layouts which pushes the path a bit further. I believe we've changed how we use of all_requirements since/it appears we're able to remove the config flag, for now.

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