nixpkgs/pkgs/tools/misc/pre-commit/languages-use-the-hardcoded-path-to-python-binaries.patch

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
1.2 KiB
Diff
Raw Normal View History

2020-05-20 20:24:52 +00:00
diff --git a/pre_commit/languages/node.py b/pre_commit/languages/node.py
2023-02-09 02:58:07 +00:00
index 66d6136..e3f1bac 100644
2020-05-20 20:24:52 +00:00
--- a/pre_commit/languages/node.py
+++ b/pre_commit/languages/node.py
2023-02-09 02:58:07 +00:00
@@ -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
2020-05-20 20:24:52 +00:00
envdir = fr'\\?\{os.path.normpath(envdir)}'
2023-02-09 02:58:07 +00:00
- 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)
2020-05-20 20:24:52 +00:00
diff --git a/pre_commit/languages/python.py b/pre_commit/languages/python.py
2023-02-09 02:58:07 +00:00
index 976674e..485fe2d 100644
2020-05-20 20:24:52 +00:00
--- a/pre_commit/languages/python.py
+++ b/pre_commit/languages/python.py
2023-02-09 02:58:07 +00:00
@@ -203,7 +203,7 @@ def install_environment(
2021-03-09 00:56:06 +00:00
additional_dependencies: Sequence[str],
2020-05-20 20:24:52 +00:00
) -> None:
2023-02-09 02:58:07 +00:00
envdir = lang_base.environment_dir(prefix, ENVIRONMENT_DIR, version)
2021-03-09 00:56:06 +00:00
- venv_cmd = [sys.executable, '-mvirtualenv', envdir]
+ venv_cmd = ['@virtualenv@/bin/virtualenv', envdir]
2020-05-20 20:24:52 +00:00
python = norm_version(version)
2021-03-09 00:56:06 +00:00
if python is not None:
venv_cmd.extend(('-p', python))