Skip to content

Commit

Permalink
Add check 'python-explicit-check-phase'
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcgibbo committed Jan 24, 2021
1 parent 2c5566a commit f83edd4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions overlays/python-explicit-check-phase.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{ builtAttrs
, packageSet
, namePositions
}@attrs:

final: prev:
let
inherit (prev) lib;
inherit (import ../lib { inherit lib; }) checkBuildPytonPackageFor;
regex = "[[:space:]]*pytest[[:space:]]*";

checkDerivation = drv:
lib.singleton {
name = "python-explicit-check-phase";
cond = (drv ? checkPhase) && (builtins.match regex drv.checkPhase) != null;
msg = ''
Consider using pytestCheckHook in checkInputs rather than checkPhase="pytest".
'';
locations = [
(builtins.unsafeGetAttrPos "checkPhase" drv)
];
};
in
checkBuildPytonPackageFor checkDerivation attrs final prev

0 comments on commit f83edd4

Please sign in to comment.