Merge pull request #39464 from oxij/stdenv/docheck-infra

stdenv: implement most of #33599
This commit is contained in:
Michael Raskin
2018-04-30 17:17:24 +00:00
committed by GitHub
6 changed files with 123 additions and 63 deletions

View File

@@ -2,6 +2,7 @@
# and can build packages that use distutils, setuptools or flit.
{ lib
, config
, python
, wrapPython
, setuptools
@@ -19,7 +20,7 @@ let
wheel-specific = import ./build-python-package-wheel.nix { };
common = import ./build-python-package-common.nix { inherit python bootstrapped-pip; };
mkPythonDerivation = import ./mk-python-derivation.nix {
inherit lib python wrapPython setuptools unzip ensureNewerSourcesForZipFilesHook toPythonModule namePrefix;
inherit lib config python wrapPython setuptools unzip ensureNewerSourcesForZipFilesHook toPythonModule namePrefix;
};
in

View File

@@ -1,6 +1,7 @@
# Generic builder.
{ lib
, config
, python
, wrapPython
, setuptools
@@ -53,7 +54,7 @@
, passthru ? {}
, doCheck ? false
, doCheck ? config.doCheckByDefault or false
, ... } @ attrs:
@@ -74,7 +75,6 @@ toPythonModule (python.stdenv.mkDerivation (builtins.removeAttrs attrs [
buildInputs = [ wrapPython ]
++ lib.optional (lib.hasSuffix "zip" (attrs.src.name or "")) unzip
++ lib.optionals doCheck checkInputs
++ lib.optional catchConflicts setuptools # If we no longer propagate setuptools
++ buildInputs
++ pythonPath;
@@ -85,6 +85,7 @@ toPythonModule (python.stdenv.mkDerivation (builtins.removeAttrs attrs [
# Python packages don't have a checkPhase, only an installCheckPhase
doCheck = false;
doInstallCheck = doCheck;
installCheckInputs = checkInputs;
postFixup = lib.optionalString (!dontWrapPythonPrograms) ''
wrapPythonPrograms