From 20a4a4b5933db55b769d48c532b6bf906738b821 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 1 Sep 2018 11:57:08 +0200 Subject: [PATCH] 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 3770f62f1a5b..6146159ad0ab 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; {