Fail with non-hermetic python
When non-hermetic python is used after pre-commit hooks install
bazelisk run -- //hooks:install
running pre-commit
by git
, e.g.:
git commit
fails with:
Traceback (most recent call last):
File "/home/user/.cache/bazel/_bazel_user/5c...ca/execroot/_main/bazel-out/k8-opt-exec-ST-d51111111104/bin/external/pre-commit+/pre-commit/pre-commit", line 622, in <module>
Main()
File "/home/user/.cache/bazel/_bazel_user/5c...ca/execroot/_main/bazel-out/k8-opt-exec-ST-d51111111104/bin/external/pre-commit+/pre-commit/pre-commit", line 513, in Main
module_space = FindModuleSpace(main_rel_path)
File "/home/user/.cache/bazel/_bazel_user/5c...ca/execroot/_main/bazel-out/k8-opt-exec-ST-d51111111104/bin/external/pre-commit+/pre-commit/pre-commit", line 206, in FindModuleSpace
raise AssertionError('Cannot find .runfiles directory for %s' % sys.argv[0])
AssertionError: Cannot find .runfiles directory for /home/user/.cache/bazel/_bazel_user/5c...ca/execroot/_main/bazel-out/k8-opt-exec-ST-d51111111104/bin/external/pre-commit+/pre-commit/pre-commit