3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/python-modules/pre-commit/default.nix

58 lines
1.2 KiB
Nix
Raw Normal View History

{ lib, fetchPypi, buildPythonApplication, pythonOlder
, aspy-yaml
, cached-property
, cfgv
, futures
, identify
, importlib-metadata
, importlib-resources
, nodeenv
, python
, six
, toml
, virtualenv
}:
buildPythonApplication rec {
pname = "pre-commit";
version = "1.21.0";
2018-07-31 00:19:24 +01:00
src = fetchPypi {
inherit version;
pname = "pre_commit";
sha256 = "0l5qg1cw4a0670m96s0ryy5mqz5aslfrrnwpriqgmrnsgdixhj4g";
2018-07-31 00:19:24 +01:00
};
patches = [
./hook-tmpl-use-the-hardcoded-path-to-pre-commit.patch
];
2018-07-31 00:19:24 +01:00
propagatedBuildInputs = [
aspy-yaml
cached-property
cfgv
identify
nodeenv
six
toml
virtualenv
importlib-metadata
] ++ lib.optional (pythonOlder "3.7") importlib-resources
++ lib.optional (pythonOlder "3.2") futures;
2018-07-31 00:19:24 +01:00
# slow and impure
2018-07-31 00:19:24 +01:00
doCheck = false;
preFixup = ''
substituteInPlace $out/${python.sitePackages}/pre_commit/resources/hook-tmpl \
--subst-var-by pre-commit $out
'';
meta = with lib; {
2018-07-31 00:19:24 +01:00
description = "A framework for managing and maintaining multi-language pre-commit hooks";
homepage = https://pre-commit.com/;
license = licenses.mit;
maintainers = with maintainers; [ borisbabic ];
};
}