pre-commit: cleanup (#414859)
This commit is contained in:
@@ -1,28 +1,33 @@
|
||||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
stdenv,
|
||||
python3Packages,
|
||||
cargo,
|
||||
coursier,
|
||||
dotnet-sdk,
|
||||
gitMinimal,
|
||||
go,
|
||||
nodejs,
|
||||
perl,
|
||||
cabal-install,
|
||||
fetchFromGitHub,
|
||||
julia,
|
||||
julia-bin,
|
||||
pre-commit,
|
||||
|
||||
# tests
|
||||
cabal-install,
|
||||
cargo,
|
||||
gitMinimal,
|
||||
go,
|
||||
perl,
|
||||
versionCheckHook,
|
||||
writableTmpDirAsHomeHook,
|
||||
coursier,
|
||||
dotnet-sdk,
|
||||
nodejs,
|
||||
|
||||
# passthru
|
||||
callPackage,
|
||||
pre-commit,
|
||||
}:
|
||||
|
||||
with python3Packages;
|
||||
let
|
||||
i686Linux = stdenv.buildPlatform.system == "i686-linux";
|
||||
julia' = if lib.meta.availableOn stdenv.hostPlatform julia then julia else julia-bin;
|
||||
in
|
||||
buildPythonApplication rec {
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "pre-commit";
|
||||
version = "4.2.0";
|
||||
pyproject = true;
|
||||
@@ -40,11 +45,11 @@ buildPythonApplication rec {
|
||||
./pygrep-pythonpath.patch
|
||||
];
|
||||
|
||||
build-system = [
|
||||
build-system = with python3Packages; [
|
||||
setuptools
|
||||
];
|
||||
|
||||
dependencies = [
|
||||
dependencies = with python3Packages; [
|
||||
cfgv
|
||||
identify
|
||||
nodeenv
|
||||
@@ -55,21 +60,22 @@ buildPythonApplication rec {
|
||||
|
||||
nativeCheckInputs =
|
||||
[
|
||||
cabal-install
|
||||
cargo
|
||||
gitMinimal
|
||||
go
|
||||
# libiconv # For rust tests on Darwin
|
||||
julia'
|
||||
perl
|
||||
versionCheckHook
|
||||
writableTmpDirAsHomeHook
|
||||
]
|
||||
++ (with python3Packages; [
|
||||
pytest-env
|
||||
pytest-forked
|
||||
pytest-xdist
|
||||
pytestCheckHook
|
||||
re-assert
|
||||
cabal-install
|
||||
julia'
|
||||
versionCheckHook
|
||||
writableTmpDirAsHomeHook
|
||||
]
|
||||
])
|
||||
++ lib.optionals (!i686Linux) [
|
||||
# coursier can be moved back to the main nativeCheckInputs list once we’re able to bootstrap a
|
||||
# JRE on i686-linux: <https://github.com/NixOS/nixpkgs/issues/314873>. When coursier gets
|
||||
@@ -90,9 +96,9 @@ buildPythonApplication rec {
|
||||
substituteInPlace pre_commit/resources/hook-tmpl \
|
||||
--subst-var-by pre-commit $out
|
||||
substituteInPlace pre_commit/languages/python.py \
|
||||
--subst-var-by virtualenv ${virtualenv}
|
||||
--subst-var-by virtualenv ${python3Packages.virtualenv}
|
||||
substituteInPlace pre_commit/languages/node.py \
|
||||
--subst-var-by nodeenv ${nodeenv}
|
||||
--subst-var-by nodeenv ${python3Packages.nodeenv}
|
||||
|
||||
patchShebangs pre_commit/resources/hook-tmpl
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user