diff --git a/pkgs/development/python-modules/pre-commit/default.nix b/pkgs/development/python-modules/pre-commit/default.nix index 7739c33f7ca2..384544f82866 100644 --- a/pkgs/development/python-modules/pre-commit/default.nix +++ b/pkgs/development/python-modules/pre-commit/default.nix @@ -1,47 +1,47 @@ { lib -, fetchPypi , buildPythonPackage -, pythonOlder -, aspy-yaml -, cached-property , cfgv +, fetchPypi , identify , importlib-metadata , importlib-resources , nodeenv , python -, six +, pythonOlder +, pyyaml , toml , virtualenv }: buildPythonPackage rec { pname = "pre-commit"; - version = "2.15.0"; + version = "2.16.0"; + format = "setuptools"; + disabled = pythonOlder "3.6"; src = fetchPypi { inherit version; pname = "pre_commit"; - sha256 = "sha256-PCWt1429+2ooplF4DVwxGsQN0X8WDrOVSgxZ2kClBac="; + sha256 = "sha256-/piXysgwqnFk29AqTnuQyuSWMEUc6IRkvKc9tIa6n2U="; }; patches = [ - ./hook-tmpl-use-the-hardcoded-path-to-pre-commit.patch ./languages-use-the-hardcoded-path-to-python-binaries.patch ]; propagatedBuildInputs = [ - aspy-yaml - cached-property cfgv identify nodeenv - six + pyyaml toml virtualenv - ] ++ lib.optional (pythonOlder "3.8") importlib-metadata - ++ lib.optional (pythonOlder "3.7") importlib-resources; + ] ++ lib.optional (pythonOlder "3.8") [ + importlib-metadata + ] ++ lib.optional (pythonOlder "3.7") [ + importlib-resources + ]; # slow and impure doCheck = false; @@ -55,7 +55,9 @@ buildPythonPackage rec { --subst-var-by nodeenv ${nodeenv} ''; - pythonImportsCheck = [ "pre_commit" ]; + pythonImportsCheck = [ + "pre_commit" + ]; meta = with lib; { description = "A framework for managing and maintaining multi-language pre-commit hooks"; diff --git a/pkgs/development/python-modules/pre-commit/hook-tmpl-use-the-hardcoded-path-to-pre-commit.patch b/pkgs/development/python-modules/pre-commit/hook-tmpl-use-the-hardcoded-path-to-pre-commit.patch deleted file mode 100644 index 4c1b6421e090..000000000000 --- a/pkgs/development/python-modules/pre-commit/hook-tmpl-use-the-hardcoded-path-to-pre-commit.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/pre_commit/resources/hook-tmpl b/pre_commit/resources/hook-tmpl -index 299144e..6d12543 100755 ---- a/pre_commit/resources/hook-tmpl -+++ b/pre_commit/resources/hook-tmpl -@@ -25,8 +25,8 @@ ARGS.append('--') - ARGS.extend(sys.argv[1:]) - - DNE = '`pre-commit` not found. Did you forget to activate your virtualenv?' --if os.access(INSTALL_PYTHON, os.X_OK): -- CMD = [INSTALL_PYTHON, '-mpre_commit'] -+if os.access('@pre-commit@/bin/pre-commit', os.X_OK): -+ CMD = ['@pre-commit@/bin/pre-commit'] - elif which('pre-commit'): - CMD = ['pre-commit'] - else: