Skip to content

buildPython*: simplify check-related attribute inheritance#386489

Merged
ShamrockLee merged 1 commit intoNixOS:stagingfrom
ShamrockLee:build-python-check-args-simplify
Mar 9, 2025
Merged

buildPython*: simplify check-related attribute inheritance#386489
ShamrockLee merged 1 commit intoNixOS:stagingfrom
ShamrockLee:build-python-check-args-simplify

Conversation

@ShamrockLee
Copy link
Contributor

@ShamrockLee ShamrockLee commented Mar 2, 2025

This PR simplifies the inheritance of check-related attributes. It essentially pass these arguments directly whenever attrs.doCheck is true or unspecified.

This PR is implemented with a local helper function getExistingAttrs, which is like getAttrs but ignores non-existing attributes. This helps reduce boilerplate codes, and subsequent PRs will also utilize such helper function.

This can be seen as the non-controvertial, backward-compatible part of #376060.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. labels Mar 2, 2025
@ShamrockLee ShamrockLee force-pushed the build-python-check-args-simplify branch from fdcfa71 to 8729bfc Compare March 6, 2025 23:07
@ShamrockLee ShamrockLee marked this pull request as ready for review March 6, 2025 23:08
@nix-owners nix-owners bot requested review from mweinelt and natsukium March 6, 2025 23:10
@ShamrockLee ShamrockLee force-pushed the build-python-check-args-simplify branch from 8729bfc to 55d08bb Compare March 7, 2025 08:48
Copy link
Contributor

@wolfgangwalther wolfgangwalther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just read through it, didn't build, but LGTM.

@ShamrockLee
Copy link
Contributor Author

@ofborg build python3Packages.pytestCheckHook.tests

@ShamrockLee
Copy link
Contributor Author

OfBorg's Linux machines build python3Packages.pytestCheckHook.tests successfully, while x86_64-darwin times out after 3600 seconds.

I'll merge this PR.

@ShamrockLee ShamrockLee merged commit 25c03bd into NixOS:staging Mar 9, 2025
30 of 31 checks passed
@ShamrockLee ShamrockLee deleted the build-python-check-args-simplify branch March 9, 2025 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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-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.

2 participants