depot/third_party/nixpkgs/pkgs/tools/misc/pre-commit/pygrep-pythonpath.patch
Default email 60f07311b9 Project import generated by Copybara.
GitOrigin-RevId: f8e2ebd66d097614d51a56a755450d4ae1632df1
2024-02-06 17:22:34 -08:00

13 lines
511 B
Diff

diff --git a/pre_commit/languages/pygrep.py b/pre_commit/languages/pygrep.py
index ec55560..44e08a1 100644
--- a/pre_commit/languages/pygrep.py
+++ b/pre_commit/languages/pygrep.py
@@ -98,7 +98,7 @@ def run_hook(
color: bool,
) -> tuple[int, bytes]:
cmd = (sys.executable, '-m', __name__, *args, entry)
- return xargs(cmd, file_args, color=color)
+ return xargs(cmd, file_args, color=color, env={ "PYTHONPATH": ':'.join(sys.path) })
def main(argv: Sequence[str] | None = None) -> int: