buildPythonPackage: redirect pre/postCheck to pre/postInstallCheck#379637
buildPythonPackage: redirect pre/postCheck to pre/postInstallCheck#379637ShamrockLee wants to merge 3 commits intoNixOS:stagingfrom
Conversation
06891d7 to
2d76e4a
Compare
|
I rebased the feature branch onto the merge base of |
2d76e4a to
72b6cda
Compare
|
@ofborg build python3Packages.accelerate |
72b6cda to
1993221
Compare
1993221 to
84b7c28
Compare
|
@ofborg build python3Packages.termcolor |
84b7c28 to
1cd1c85
Compare
1cd1c85 to
1920589
Compare
MattSturgeon
left a comment
There was a problem hiding this comment.
It feels like there may be a way to use the finalAttrs fixpoint to keep checkPhase and installCheckPhase in sync... Maybe in combination with using phases to exclude checkPhase? That way, it'd be possible to use/override finalAttrs.checkPhase via overrideAttrs (etc). That may be an alternative solution to #324124 too. That said, I think it'd only be possible as a one-way binding; a two-way binding would suffer infinite recursion.
Regardless, it feels correct that the installCheckPhase would run the {pre,post}InstallCheck hooks - so this PR SGTM in concept. The diff also looks good overall, but I've not tested anything.
| lib.replaceStrings | ||
| [ "runHook preCheck\n" "runHook postCheck\n" ] | ||
| [ "runHook preInstallCheck\n" "runHook postInstallCheck\n" ] |
There was a problem hiding this comment.
This doesn't feel particularly robust, but it should cover 99% of cases.
…tInstallCheck Goal: Unify the <pkg>.overrideAttrs interface for Python packages. Specify preInstallCheck/postInstallCheck as preCheck/postCheck if the latter is not specified. Use preInstallCheck/postInstallCheck in buildPython* setup hooks. When the checkPhase argument is specified, replace `runHook pre/postCheck` with `runHook pre/postInstallCheck` before assigning it to `installCheckPhase`.
…eckPhase Simplify implementation and ensure that pre/postInstallCheck only run once.
…llCheckPhase Simplify implementation and ensure that pre/postInstallCheck only run once.
1920589 to
e55131e
Compare
How about teaching |
This PR unifies the .overrideAttrs interface for Python packages regarding
preInstallCheckandpostInstallCheckin a compatible way.runHook pre/postCheckwithrunHook pre/postInstallCheckbefore assigning it toinstallCheckPhase.After this change,
pytestCheckPhasenow precedessphinxBuildPhaseif both invoked, and locale changes left bypytestCheckPhasecould trigger Sphinx's failure (sphinx-doc/sphinx#11739) (despite the topic of the linked issue, the error also occurs on Linux). As a result, this PR depends on a treewide locale cleanup:Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.