-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
buildPythonPackage
, buildPythonApplication
: take installCheck
-related attributes directly
#324124
buildPythonPackage
, buildPythonApplication
: take installCheck
-related attributes directly
#324124
Conversation
buildPythonPackage
, buildPythonApplication
: take installCheck
-related attributes directly
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.
Thanks for continuing the work on this, @ShamrockLee, please find below some minor suggestions…
055d61d
to
089cbc9
Compare
167f116
to
b922bfb
Compare
I believe to understand the distinction between This decision seems to date back to 2009. |
@mweinelt Thank you for finding out the history of the decision. The issue is that we are
It is not about choosing between |
Why then not move us into |
The manual notes that checkPhase is used instead of installCheckPhase.
|
I get that The frustrating thing here is, that we simplified the lingo to And then there is the matter of nix-community/nix-init#419 🫠 |
Build system and dependencies are essentially another layer on top. The underlying stdenv atttributes will always be needed for all other cases. I think motivation at the time was consistency. Probably it was not given much thought. |
Take attributes doInstallCheck, installCheckPhase, installCheckInputs, and their native companions directly. Make arguments doCheck, checkPhase, checkInputs, and their native companions, alias to the installCheck arguments. Co-authored-by: Martin Weinelt <[email protected]>
Change checkPhase to installCehckPhase, doCheck to doInstallCheck, ..., to reflect the fact that the specification goes to the installCheck-related attributes and that buildPython* build helpers now takes the installCheck-related attributes directly in addition to indirectly specify them thourgh the check-related arguments. Documentation about the preCheck and postCheck phases of *CheckHook's (pytestCheckHook, setuptoolsCheckHook, and unittestCheckHook) are deliberately kept unchanged, as they are not renamed to preInstallCheck and postInstallCheck yet. Co-authored-by: Alexis Hildebrandt <[email protected]>
In the previous implementation of buildPythonApplication, the doInstallCheck attribute was always specified by the doCheck argument. as `doCheck = false` was specified by this package, there's no effect to specify `doInstallCheck = true`, and the `installCheckPhase` specified doesn't get executed during build. After buildPythonApplication takes `doInstallCheck` directly, `doInstallCheck = true` starts to take effect. The `doCheck` argument, as an alias to `doInstallCheck`, lost its effect when `doInstallCheck` is presented. The setuphookCheckPhase are still supressed due to the fact that installCheckPhase is specified non-empty.
In the previous implementation of buildPythonApplication, the doInstallCheck attribute is always specified by the doCheck argument, which defaults to true. The doInstallCheck = false specification didn't take effect. It is the non-empty installCheckPhase attribute, specified by the checkPhase argument, that supress the setuphookCheckPhase. After `buildPythonPackage` starts taking doInstallCheck directly, the doInstallCheck = false specification starts to take effect, supressing the execution of the installCheckPhase attribute specified by the checkPhase argument. This patch removes the irrelevant doInstallCheck = false specifcation, keeping the attribute value true and installCheckPhase executed.
…attributes Co-authored-by: Martin Weinelt <[email protected]>
8091f9c
to
1ca8ebf
Compare
After some thought, I'm personally against the migration to Indeed, this change is correct and should be done to ensure consistency with the phase definition. Regarding |
Thank you for sharing your precious experiences about attribute renaming. Your right. The change wouldn't be helpful to the community if the pain caused by the mass renaming outweighs the benefits of the name correctness.
Delegating checks to If this is not the change we want to make now, should we close this pull request or mark it as a draft? |
Description of changes
This PR enables
buildPythonPackage
andbuildPythonApplicaiton
to directly take theinstallCheck
- related attribute instead of specifying it usingcheck
- associated arguments.This is the first and backward-compatible step toward simplifying the
installCheck
-related attribute specification for Python packages and applications.In the long run, we should deprecate the use of
checkPhase
to specifyinstallCheckPhase
, and useinstallCheckPhase
directly, as stated in themk-python-derivation
comment four years ago.Cc: @FRidh
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-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.