Loading pkgs/development/interpreters/python/mk-python-derivation.nix +33 −9 Original line number Diff line number Diff line Loading @@ -12,8 +12,8 @@ , update-python-libraries , setuptools , flitBuildHook , pipBuildHook , pipInstallHook , pypaBuildHook , pypaInstallHook , pythonCatchConflictsHook , pythonImportsCheckHook , pythonNamespacesHook Loading Loading @@ -161,6 +161,16 @@ let in inputs: builtins.map (checkDrv) inputs; isBootstrapInstallPackage = builtins.elem (attrs.pname or null) [ "flit-core" "installer" ]; isBootstrapPackage = isBootstrapInstallPackage || builtins.elem (attrs.pname or null) ([ "build" "packaging" "pyproject-hooks" "wheel" ] ++ lib.optionals (python.pythonOlder "3.11") [ "tomli" ]); # Keep extra attributes from `attrs`, e.g., `patchPhase', etc. self = toPythonModule (stdenv.mkDerivation ((builtins.removeAttrs attrs [ "disabled" "checkPhase" "checkInputs" "nativeCheckInputs" "doCheck" "doInstallCheck" "dontWrapPythonPrograms" "catchConflicts" "format" Loading @@ -174,7 +184,10 @@ let wrapPython ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, flit, ...)? pythonRemoveTestsDirHook ] ++ lib.optionals catchConflicts [ ] ++ lib.optionals (catchConflicts && !isBootstrapPackage) [ # When building a package that is also part of the bootstrap chain, we # must ignore conflicts after installation, because there will be one with # the package in the bootstrap. pythonCatchConflictsHook ] ++ lib.optionals removeBinBytecode [ pythonRemoveBinBytecodeHook Loading @@ -184,15 +197,26 @@ let setuptoolsBuildHook ] ++ lib.optionals (format == "flit") [ flitBuildHook ] ++ lib.optionals (format == "pyproject") [ pipBuildHook ] ++ lib.optionals (format == "wheel") [ ] ++ lib.optionals (format == "pyproject") [( if isBootstrapPackage then pypaBuildHook.override { inherit (python.pythonForBuild.pkgs.bootstrap) build; wheel = null; } else pypaBuildHook )] ++ lib.optionals (format == "wheel") [ wheelUnpackHook ] ++ lib.optionals (format == "egg") [ eggUnpackHook eggBuildHook eggInstallHook ] ++ lib.optionals (!(format == "other") || dontUsePipInstall) [ pipInstallHook ] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ ] ++ lib.optionals (format != "other") [( if isBootstrapInstallPackage then pypaInstallHook.override { inherit (python.pythonForBuild.pkgs.bootstrap) installer; } else pypaInstallHook )] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ # This is a test, however, it should be ran independent of the checkPhase and checkInputs pythonImportsCheckHook ] ++ lib.optionals (python.pythonAtLeast "3.3") [ Loading Loading
pkgs/development/interpreters/python/mk-python-derivation.nix +33 −9 Original line number Diff line number Diff line Loading @@ -12,8 +12,8 @@ , update-python-libraries , setuptools , flitBuildHook , pipBuildHook , pipInstallHook , pypaBuildHook , pypaInstallHook , pythonCatchConflictsHook , pythonImportsCheckHook , pythonNamespacesHook Loading Loading @@ -161,6 +161,16 @@ let in inputs: builtins.map (checkDrv) inputs; isBootstrapInstallPackage = builtins.elem (attrs.pname or null) [ "flit-core" "installer" ]; isBootstrapPackage = isBootstrapInstallPackage || builtins.elem (attrs.pname or null) ([ "build" "packaging" "pyproject-hooks" "wheel" ] ++ lib.optionals (python.pythonOlder "3.11") [ "tomli" ]); # Keep extra attributes from `attrs`, e.g., `patchPhase', etc. self = toPythonModule (stdenv.mkDerivation ((builtins.removeAttrs attrs [ "disabled" "checkPhase" "checkInputs" "nativeCheckInputs" "doCheck" "doInstallCheck" "dontWrapPythonPrograms" "catchConflicts" "format" Loading @@ -174,7 +184,10 @@ let wrapPython ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, flit, ...)? pythonRemoveTestsDirHook ] ++ lib.optionals catchConflicts [ ] ++ lib.optionals (catchConflicts && !isBootstrapPackage) [ # When building a package that is also part of the bootstrap chain, we # must ignore conflicts after installation, because there will be one with # the package in the bootstrap. pythonCatchConflictsHook ] ++ lib.optionals removeBinBytecode [ pythonRemoveBinBytecodeHook Loading @@ -184,15 +197,26 @@ let setuptoolsBuildHook ] ++ lib.optionals (format == "flit") [ flitBuildHook ] ++ lib.optionals (format == "pyproject") [ pipBuildHook ] ++ lib.optionals (format == "wheel") [ ] ++ lib.optionals (format == "pyproject") [( if isBootstrapPackage then pypaBuildHook.override { inherit (python.pythonForBuild.pkgs.bootstrap) build; wheel = null; } else pypaBuildHook )] ++ lib.optionals (format == "wheel") [ wheelUnpackHook ] ++ lib.optionals (format == "egg") [ eggUnpackHook eggBuildHook eggInstallHook ] ++ lib.optionals (!(format == "other") || dontUsePipInstall) [ pipInstallHook ] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ ] ++ lib.optionals (format != "other") [( if isBootstrapInstallPackage then pypaInstallHook.override { inherit (python.pythonForBuild.pkgs.bootstrap) installer; } else pypaInstallHook )] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ # This is a test, however, it should be ran independent of the checkPhase and checkInputs pythonImportsCheckHook ] ++ lib.optionals (python.pythonAtLeast "3.3") [ Loading