Commit 18a7bb5
authored
fix: make
Because `--experimental_python_import_all_repositories` defaults to
true, every repository's directory is added to `sys.path`, which makes
`import python.runfiles` work.
However, we shouldn't rely on that behavior for a couple reasons:
* We recommend disabling it for fewer sys.path entries (even non-Python
related
repos get added to the path).
* Some users _must_ disable it because the resulting PYTHONPATH is too
long.
To fix, set the `imports` attribute on `//python/runfiles:runfiles` so
that `import python.runfiles` works. The net result is the
`rules_python` repo directory is added
to sys.path even if
`--experimental_python_import_all_repositories=false`.
Fixes #1241import python.runfiles work with --experimental_python_import_all_repositories=false (#1243)1 parent 62e95a4 commit 18a7bb5
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
| |||
0 commit comments