Skip to content

<pkg>.overridePythonAttrs: take both checkPhase and installCheckPhase and pass installCheckPhase#469804

Draft
ShamrockLee wants to merge 4 commits intoNixOS:stagingfrom
ShamrockLee:build-python-install-check-compat
Draft

<pkg>.overridePythonAttrs: take both checkPhase and installCheckPhase and pass installCheckPhase#469804
ShamrockLee wants to merge 4 commits intoNixOS:stagingfrom
ShamrockLee:build-python-install-check-compat

Conversation

@ShamrockLee
Copy link
Contributor

This change makes buildPythonPackage and overridePythonAttrs take both checkPhase-related attributes and installCheckPhase-related attributes, and pass only the installCheckPhase-related ones to stdenv.mkDerivation, keeping the <pkg>.overrideAttrs interface clean and ordered.

This PR depends on:

After merging the depending PR, this PR should cause few or no rebuilds.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

…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.
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 6.topic: python Python is a high-level, general-purpose programming language. labels Dec 11, 2025
@ShamrockLee ShamrockLee force-pushed the build-python-install-check-compat branch from fc0cb84 to 9f06448 Compare December 11, 2025 04:22
@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant