buildPythonPackage: support nativeCheckInputs

This commit is contained in:
Guillaume Girol 2022-12-18 12:00:00 +00:00
parent f39abbc350
commit 339a5491bb

View file

@ -39,6 +39,7 @@
# Dependencies needed for running the checkPhase.
# These are added to buildInputs when doCheck = true.
, checkInputs ? []
, nativeCheckInputs ? []
# propagate build dependencies so in case we have A -> B -> C,
# C can import package A propagated by B
@ -114,7 +115,7 @@ let
name_ = name;
self = toPythonModule (stdenv.mkDerivation ((builtins.removeAttrs attrs [
"disabled" "checkPhase" "checkInputs" "doCheck" "doInstallCheck" "dontWrapPythonPrograms" "catchConflicts" "format"
"disabled" "checkPhase" "checkInputs" "nativeCheckInputs" "doCheck" "doInstallCheck" "dontWrapPythonPrograms" "catchConflicts" "format"
"disabledTestPaths" "outputs"
]) // {
@ -169,13 +170,14 @@ let
# Python packages don't have a checkPhase, only an installCheckPhase
doCheck = false;
doInstallCheck = attrs.doCheck or true;
installCheckInputs = [
nativeInstallCheckInputs = [
] ++ lib.optionals (format == "setuptools") [
# Longer-term we should get rid of this and require
# users of this function to set the `installCheckPhase` or
# pass in a hook that sets it.
setuptoolsCheckHook
] ++ checkInputs;
] ++ nativeCheckInputs;
installCheckInputs = checkInputs;
postFixup = lib.optionalString (!dontWrapPythonPrograms) ''
wrapPythonPrograms