-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pythonPackages.pytest: fix .pytest_cache, again #45898
Conversation
@@ -29,7 +29,7 @@ buildPythonPackage rec { | |||
|
|||
# Remove .pytest_cache when using py.test in a Nix build | |||
setupHook = writeText "pytest-hook" '' | |||
postFixupHooks+=( | |||
postCheckHooks+=( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment we do not run this for most manual pytest check phases. Does this mean we have to add runHook
to every python package with pytest now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit boiler code one has to remember.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we would have to, unless we get NixOS/rfcs#32. The other option is to set PYTEST_ADDOPTS
again with nocacheprovider
. This will, however, break packages that require it, so in those cases we would have to unset PYTEST_ADDOPTS
.
Neither option is nice, but I prefer us to do what upstream documents, "the cache is created by default", even though it affects reproducibility and causes issues with python.buildEnv
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before NixOS/rfcs#32 the non-boilerplate option to add this to a custom phase instead and put that phase into $preInstallPhases
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the installPhases
are to early I added a preDistPhase
.
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.
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)