Skip to content

Commit

Permalink
Add check 'python-include-tests'
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcgibbo committed Jan 24, 2021
1 parent f83edd4 commit c64f442
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions overlays/python-include-tests.nix
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c64f442

Please sign in to comment.