diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index f3e5249c189e..473ea165e672 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -283,6 +283,14 @@ lib.extendMkDerivation { name = namePrefix + attrs.name or "${finalAttrs.pname}-${finalAttrs.version}"; + runtimeDepsCheckHook = + if isBootstrapPackage then + pythonRuntimeDepsCheckHook.override { + inherit (python.pythonOnBuildForHost.pkgs.bootstrap) packaging; + } + else + pythonRuntimeDepsCheckHook; + in { inherit name; @@ -330,17 +338,11 @@ lib.extendMkDerivation { else pypaBuildHook ) - ( - if isBootstrapPackage then - pythonRuntimeDepsCheckHook.override { - inherit (python.pythonOnBuildForHost.pkgs.bootstrap) packaging; - } - else - pythonRuntimeDepsCheckHook - ) + runtimeDepsCheckHook ] ++ optionals (format' == "wheel") [ wheelUnpackHook + runtimeDepsCheckHook ] ++ optionals (format' == "egg") [ eggUnpackHook