From c64f44257447ed29cd70b729cb814f50ff3504a5 Mon Sep 17 00:00:00 2001 From: "Robert T. McGibbon" Date: Sat, 23 Jan 2021 21:00:40 -0500 Subject: [PATCH] Add check 'python-include-tests' --- overlays/python-include-tests.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 overlays/python-include-tests.nix diff --git a/overlays/python-include-tests.nix b/overlays/python-include-tests.nix new file mode 100644 index 0000000..d0d5dba --- /dev/null +++ b/overlays/python-include-tests.nix @@ -0,0 +1,26 @@ +{ builtAttrs +, packageSet +, namePositions +}@attrs: + +final: prev: +let + inherit (prev) lib; + inherit (import ../lib { inherit lib; }) checkBuildPytonPackageFor; + + checkDerivation = drv: + lib.singleton { + name = "python-include-tests"; + cond = let + hasCheckPhase = drv ? checkPhase; + hasDoCheckFalse = (drv ? doCheck) && (drv.doCheck == false); + hasPytestCheckHook = drv ? checkInputs && lib.any (map (n: n.name == "pytest-check-hook") drv.checkInputs); + hasPythonImportsCheck = drv ? pythonImportsCheck; + in + ((! hasCheckPhase) || hasDoCheckFalse) && (! hasPytestCheckHook) && (! hasPythonImportsCheck); + msg = '' + Add a checkPhase for tests, or at least pythonImportsCheck. + ''; + }; + in +checkBuildPytonPackageFor checkDerivation attrs final prev