From 2682b98a527f6dd31bdfa9b77b5f534bae3a4cf0 Mon Sep 17 00:00:00 2001 From: Austin Butler Date: Mon, 8 Mar 2021 16:56:06 -0800 Subject: [PATCH] pre-commit: 2.7.1 -> 2.11.0 --- .../python-modules/pre-commit/default.nix | 5 ++--- ...use-the-hardcoded-path-to-python-binaries.patch | 14 +++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/pre-commit/default.nix b/pkgs/development/python-modules/pre-commit/default.nix index 88fb6e3abf91..1b5af02dca0d 100644 --- a/pkgs/development/python-modules/pre-commit/default.nix +++ b/pkgs/development/python-modules/pre-commit/default.nix @@ -2,7 +2,6 @@ , aspy-yaml , cached-property , cfgv -, futures , identify , importlib-metadata , importlib-resources @@ -16,13 +15,13 @@ buildPythonPackage rec { pname = "pre-commit"; - version = "2.7.1"; + version = "2.11.0"; disabled = isPy27; src = fetchPypi { inherit version; pname = "pre_commit"; - sha256 = "0w2a104yhbw1z92rcwpq0gdjsxvr2bwx5ry5xhlf2psnfkjx6ky5"; + sha256 = "15f1chxrbmfcajk1ngk3jvf6jjbigb5dg66wnn7phmlywaawpy06"; }; patches = [ diff --git a/pkgs/development/python-modules/pre-commit/languages-use-the-hardcoded-path-to-python-binaries.patch b/pkgs/development/python-modules/pre-commit/languages-use-the-hardcoded-path-to-python-binaries.patch index c1bead48b345..6d274aae3c07 100644 --- a/pkgs/development/python-modules/pre-commit/languages-use-the-hardcoded-path-to-python-binaries.patch +++ b/pkgs/development/python-modules/pre-commit/languages-use-the-hardcoded-path-to-python-binaries.patch @@ -12,15 +12,15 @@ index 26f4919..4885ec1 100644 if version != C.DEFAULT: cmd.extend(['-n', version]) diff --git a/pre_commit/languages/python.py b/pre_commit/languages/python.py -index e17376e..0c1d2ab 100644 +index 43b7280..f0f2338 100644 --- a/pre_commit/languages/python.py +++ b/pre_commit/languages/python.py -@@ -204,7 +204,7 @@ def install_environment( +@@ -192,7 +192,7 @@ def install_environment( + additional_dependencies: Sequence[str], ) -> None: envdir = prefix.path(helpers.environment_dir(ENVIRONMENT_DIR, version)) +- venv_cmd = [sys.executable, '-mvirtualenv', envdir] ++ venv_cmd = ['@virtualenv@/bin/virtualenv', envdir] python = norm_version(version) -- venv_cmd = (sys.executable, '-mvirtualenv', envdir, '-p', python) -+ venv_cmd = ('@virtualenv@/bin/virtualenv', envdir, '-p', python) - install_cmd = ('python', '-mpip', 'install', '.', *additional_dependencies) - - with clean_path_on_failure(envdir): + if python is not None: + venv_cmd.extend(('-p', python))