pre-commit: cleanup (#414859)

authored by Gaétan Lepage and committed by GitHub 738fc480 deb104f9

+26 -20
+26 -20
pkgs/by-name/pr/pre-commit/package.nix
··· 1 { 2 lib, 3 fetchFromGitHub, 4 - python3Packages, 5 cargo, 6 - coursier, 7 - dotnet-sdk, 8 gitMinimal, 9 go, 10 - nodejs, 11 perl, 12 - cabal-install, 13 - julia, 14 - julia-bin, 15 - pre-commit, 16 versionCheckHook, 17 writableTmpDirAsHomeHook, 18 }: 19 20 - with python3Packages; 21 let 22 i686Linux = stdenv.buildPlatform.system == "i686-linux"; 23 julia' = if lib.meta.availableOn stdenv.hostPlatform julia then julia else julia-bin; 24 in 25 - buildPythonApplication rec { 26 pname = "pre-commit"; 27 version = "4.2.0"; 28 pyproject = true; ··· 40 ./pygrep-pythonpath.patch 41 ]; 42 43 - build-system = [ 44 setuptools 45 ]; 46 47 - dependencies = [ 48 cfgv 49 identify 50 nodeenv ··· 55 56 nativeCheckInputs = 57 [ 58 cargo 59 gitMinimal 60 go 61 - # libiconv # For rust tests on Darwin 62 perl 63 pytest-env 64 pytest-forked 65 pytest-xdist 66 pytestCheckHook 67 re-assert 68 - cabal-install 69 - julia' 70 - versionCheckHook 71 - writableTmpDirAsHomeHook 72 - ] 73 ++ lib.optionals (!i686Linux) [ 74 # coursier can be moved back to the main nativeCheckInputs list once we’re able to bootstrap a 75 # JRE on i686-linux: <https://github.com/NixOS/nixpkgs/issues/314873>. When coursier gets ··· 90 substituteInPlace pre_commit/resources/hook-tmpl \ 91 --subst-var-by pre-commit $out 92 substituteInPlace pre_commit/languages/python.py \ 93 - --subst-var-by virtualenv ${virtualenv} 94 substituteInPlace pre_commit/languages/node.py \ 95 - --subst-var-by nodeenv ${nodeenv} 96 97 patchShebangs pre_commit/resources/hook-tmpl 98 '';
··· 1 { 2 lib, 3 + stdenv, 4 + python3Packages, 5 fetchFromGitHub, 6 + julia, 7 + julia-bin, 8 + 9 + # tests 10 + cabal-install, 11 cargo, 12 gitMinimal, 13 go, 14 perl, 15 versionCheckHook, 16 writableTmpDirAsHomeHook, 17 + coursier, 18 + dotnet-sdk, 19 + nodejs, 20 + 21 + # passthru 22 + callPackage, 23 + pre-commit, 24 }: 25 26 let 27 i686Linux = stdenv.buildPlatform.system == "i686-linux"; 28 julia' = if lib.meta.availableOn stdenv.hostPlatform julia then julia else julia-bin; 29 in 30 + python3Packages.buildPythonApplication rec { 31 pname = "pre-commit"; 32 version = "4.2.0"; 33 pyproject = true; ··· 45 ./pygrep-pythonpath.patch 46 ]; 47 48 + build-system = with python3Packages; [ 49 setuptools 50 ]; 51 52 + dependencies = with python3Packages; [ 53 cfgv 54 identify 55 nodeenv ··· 60 61 nativeCheckInputs = 62 [ 63 + cabal-install 64 cargo 65 gitMinimal 66 go 67 + julia' 68 perl 69 + versionCheckHook 70 + writableTmpDirAsHomeHook 71 + ] 72 + ++ (with python3Packages; [ 73 pytest-env 74 pytest-forked 75 pytest-xdist 76 pytestCheckHook 77 re-assert 78 + ]) 79 ++ lib.optionals (!i686Linux) [ 80 # coursier can be moved back to the main nativeCheckInputs list once we’re able to bootstrap a 81 # JRE on i686-linux: <https://github.com/NixOS/nixpkgs/issues/314873>. When coursier gets ··· 96 substituteInPlace pre_commit/resources/hook-tmpl \ 97 --subst-var-by pre-commit $out 98 substituteInPlace pre_commit/languages/python.py \ 99 + --subst-var-by virtualenv ${python3Packages.virtualenv} 100 substituteInPlace pre_commit/languages/node.py \ 101 + --subst-var-by nodeenv ${python3Packages.nodeenv} 102 103 patchShebangs pre_commit/resources/hook-tmpl 104 '';