From 636b5c34da88e944af97facf652c72893db86d97 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 1 Sep 2018 11:57:08 +0200 Subject: [PATCH 1/2] pythonPackages.pytest.setupHook: run in correct phase It was reported that the 2nd solution wasn't working as expected because it was ran in the wrong phase. This commit creates a new phase, in between the installCheckPhase and distPhase. --- pkgs/development/python-modules/pytest/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/pytest/default.nix b/pkgs/development/python-modules/pytest/default.nix index 3770f62f1a5bc..6146159ad0ab2 100644 --- a/pkgs/development/python-modules/pytest/default.nix +++ b/pkgs/development/python-modules/pytest/default.nix @@ -29,9 +29,11 @@ buildPythonPackage rec { # Remove .pytest_cache when using py.test in a Nix build setupHook = writeText "pytest-hook" '' - postFixupHooks+=( - 'find $out -name .pytest_cache -type d -exec rm -rf {} +' - ) + pytestcachePhase() { + find $out -name .pytest_cache -type d -exec rm -rf {} + + } + + preDistPhases+=" pytestcachePhase" ''; meta = with stdenv.lib; { From ccabf5fab9059cf6065557cc4c70dcb158dd7abb Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 1 Sep 2018 11:57:31 +0200 Subject: [PATCH 2/2] pythonPackages.autobahn: run hooks --- pkgs/development/python-modules/autobahn/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/autobahn/default.nix b/pkgs/development/python-modules/autobahn/default.nix index 87a337a154dd4..04aa9411247ee 100644 --- a/pkgs/development/python-modules/autobahn/default.nix +++ b/pkgs/development/python-modules/autobahn/default.nix @@ -21,7 +21,9 @@ buildPythonPackage rec { (stdenv.lib.optionals (!isPy3k) [ trollius futures ]); checkPhase = '' + runHook preCheck USE_TWISTED=true py.test $out + runHook postCheck ''; meta = with stdenv.lib; {