Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 20.03 57 lines 1.2 kB view raw
1{ lib, fetchPypi, buildPythonApplication, pythonOlder 2, aspy-yaml 3, cached-property 4, cfgv 5, futures 6, identify 7, importlib-metadata 8, importlib-resources 9, nodeenv 10, python 11, six 12, toml 13, virtualenv 14}: 15 16buildPythonApplication rec { 17 pname = "pre-commit"; 18 version = "1.21.0"; 19 20 src = fetchPypi { 21 inherit version; 22 pname = "pre_commit"; 23 sha256 = "0l5qg1cw4a0670m96s0ryy5mqz5aslfrrnwpriqgmrnsgdixhj4g"; 24 }; 25 26 patches = [ 27 ./hook-tmpl-use-the-hardcoded-path-to-pre-commit.patch 28 ]; 29 30 propagatedBuildInputs = [ 31 aspy-yaml 32 cached-property 33 cfgv 34 identify 35 nodeenv 36 six 37 toml 38 virtualenv 39 importlib-metadata 40 ] ++ lib.optional (pythonOlder "3.7") importlib-resources 41 ++ lib.optional (pythonOlder "3.2") futures; 42 43 # slow and impure 44 doCheck = false; 45 46 preFixup = '' 47 substituteInPlace $out/${python.sitePackages}/pre_commit/resources/hook-tmpl \ 48 --subst-var-by pre-commit $out 49 ''; 50 51 meta = with lib; { 52 description = "A framework for managing and maintaining multi-language pre-commit hooks"; 53 homepage = https://pre-commit.com/; 54 license = licenses.mit; 55 maintainers = with maintainers; [ borisbabic ]; 56 }; 57}