about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pre-commit-hooks/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pre-commit-hooks/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/pre-commit-hooks/default.nix22
1 files changed, 16 insertions, 6 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pre-commit-hooks/default.nix b/nixpkgs/pkgs/development/python-modules/pre-commit-hooks/default.nix
index 212fdf6a721a..eae35b5bac6d 100644
--- a/nixpkgs/pkgs/development/python-modules/pre-commit-hooks/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/pre-commit-hooks/default.nix
@@ -1,27 +1,30 @@
 { lib
+, stdenv
 , buildPythonPackage
 , fetchFromGitHub
 , git
-, pythonOlder
 , pytestCheckHook
-, ruamel_yaml
+, pythonOlder
+, ruamel-yaml
 , toml
 }:
 
 buildPythonPackage rec {
   pname = "pre-commit-hooks";
-  version = "4.0.1";
+  version = "4.1.0";
+  format = "setuptools";
+
   disabled = pythonOlder "3.6";
 
   src = fetchFromGitHub {
     owner = "pre-commit";
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256-Rg2I79r0Pp3AUgT6mD+kEdm+5CEGgdmFn6G3xcU6fnk=";
+    sha256 = "sha256-nxJp7LkCUkJj77RCeWedBusue3x0lZYatSidbueZqfo=";
   };
 
   propagatedBuildInputs = [
-    ruamel_yaml
+    ruamel-yaml
     toml
   ];
 
@@ -30,6 +33,10 @@ buildPythonPackage rec {
     pytestCheckHook
   ];
 
+  # Note: this is not likely to ever work on Darwin
+  # https://github.com/pre-commit/pre-commit-hooks/pull/655
+  doCheck = !stdenv.isDarwin;
+
   # the tests require a functional git installation which requires a valid HOME
   # directory.
   preCheck = ''
@@ -37,9 +44,12 @@ buildPythonPackage rec {
 
     git config --global user.name "Nix Builder"
     git config --global user.email "nix-builder@nixos.org"
+    git init .
   '';
 
-  pythonImportsCheck = [ "pre_commit_hooks" ];
+  pythonImportsCheck = [
+    "pre_commit_hooks"
+  ];
 
   meta = with lib; {
     description = "Some out-of-the-box hooks for pre-commit";