nixpkgs/pkgs/tools/misc/pre-commit/languages-use-the-hardcoded-path-to-python-binaries.patch
2023-02-24 11:00:59 +00:00

26 lines
1.2 KiB
Diff

diff --git a/pre_commit/languages/node.py b/pre_commit/languages/node.py
index 66d6136..e3f1bac 100644
--- a/pre_commit/languages/node.py
+++ b/pre_commit/languages/node.py
@@ -83,7 +83,7 @@ def install_environment(
# https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx?f=255&MSPPError=-2147217396#maxpath
if sys.platform == 'win32': # pragma: no cover
envdir = fr'\\?\{os.path.normpath(envdir)}'
- cmd = [sys.executable, '-mnodeenv', '--prebuilt', '--clean-src', envdir]
+ cmd = ['@nodeenv@/bin/nodeenv', '--prebuilt', '--clean-src', envdir]
if version != C.DEFAULT:
cmd.extend(['-n', version])
cmd_output_b(*cmd)
diff --git a/pre_commit/languages/python.py b/pre_commit/languages/python.py
index 976674e..485fe2d 100644
--- a/pre_commit/languages/python.py
+++ b/pre_commit/languages/python.py
@@ -203,7 +203,7 @@ def install_environment(
additional_dependencies: Sequence[str],
) -> None:
envdir = lang_base.environment_dir(prefix, ENVIRONMENT_DIR, version)
- venv_cmd = [sys.executable, '-mvirtualenv', envdir]
+ venv_cmd = ['@virtualenv@/bin/virtualenv', envdir]
python = norm_version(version)
if python is not None:
venv_cmd.extend(('-p', python))