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