From 339a5491bbab587d6cb84a960377f88546ffb535 Mon Sep 17 00:00:00 2001 From: Guillaume Girol Date: Sun, 18 Dec 2022 12:00:00 +0000 Subject: [PATCH] buildPythonPackage: support nativeCheckInputs --- .../interpreters/python/mk-python-derivation.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index bdb4969bf164..971eacb71d9c 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -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