Skip to content

buildPythonPackage: Enable direct attribute overriding via overrideAttrs (the non-staging ones)#376372

Merged
mweinelt merged 7 commits intoNixOS:masterfrom
ShamrockLee:build-python-direct-overriding-simple
Oct 5, 2025
Merged

buildPythonPackage: Enable direct attribute overriding via overrideAttrs (the non-staging ones)#376372
mweinelt merged 7 commits intoNixOS:masterfrom
ShamrockLee:build-python-direct-overriding-simple

Conversation

@ShamrockLee
Copy link
Contributor

@ShamrockLee ShamrockLee commented Jan 24, 2025

This PR makes the following attributes overridable using overrideAttrs:

  • src
  • removePythonDeps
  • relaxPythonDeps
  • passthru.build-system
  • passthru.dependencies
  • passthru.pyproject

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 the 6.topic: python Python is a high-level, general-purpose programming language. label Jan 24, 2025
@ShamrockLee ShamrockLee force-pushed the build-python-direct-overriding-simple branch from 3e8185a to e46f723 Compare January 24, 2025 12:11
@ShamrockLee ShamrockLee mentioned this pull request Jan 24, 2025
12 tasks
@github-actions github-actions bot added 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. labels Jan 24, 2025
@ShamrockLee ShamrockLee force-pushed the build-python-direct-overriding-simple branch 3 times, most recently from d96b56d to f1bafe0 Compare January 24, 2025 14:01
@github-actions github-actions bot added 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 501-1000 This PR causes many rebuilds on Linux and should normally target the staging branches. and removed 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. labels Jan 24, 2025
@ShamrockLee ShamrockLee force-pushed the build-python-direct-overriding-simple branch from f1bafe0 to 6dd94cd Compare January 25, 2025 14:02
@github-actions github-actions bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. and removed 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 501-1000 This PR causes many rebuilds on Linux and should normally target the staging branches. labels Jan 25, 2025
@ShamrockLee ShamrockLee force-pushed the build-python-direct-overriding-simple branch 4 times, most recently from 583c7e1 to d886b55 Compare January 26, 2025 17:54
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/is-it-possible-to-override-cargosha256-in-buildrustpackage/4393/22

@ShamrockLee
Copy link
Contributor Author

Rebased to resolve merge conflicts after tree-wide formatting.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. and removed 2.status: merge conflict This PR has merge conflicts with the target branch 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. labels Aug 8, 2025
Copy link
Contributor

@RossSmyth RossSmyth left a comment

Choose a reason for hiding this comment

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

This looks great.

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Sep 22, 2025
@ShamrockLee
Copy link
Contributor Author

Pinging the Python people for inputs about the proposed <pkg>.overrideAttrs interface:
@Hexa @mweinelt @natsukium

This PR will enable <pkg>.overrideAttrs overriding src, removePythonDeps, and relaxPythonDeps directly; build-system, dependencies, and pyproject via passthru. Is it desirable?

@ShamrockLee ShamrockLee force-pushed the build-python-direct-overriding-simple branch from 2cca5ad to 2bd1e9e Compare September 28, 2025 09:40
@ShamrockLee
Copy link
Contributor Author

Add informative error message when passthru is emptied or overwritten during <pkg>.overrideAttrs overriding.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. and removed 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Sep 28, 2025
@ShamrockLee ShamrockLee force-pushed the build-python-direct-overriding-simple branch from 2bd1e9e to bc122a6 Compare September 28, 2025 17:55
@mweinelt mweinelt added this pull request to the merge queue Oct 5, 2025
Merged via the queue into NixOS:master with commit dbeacf1 Oct 5, 2025
29 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.severity: blocker This is preventing another PR or issue from being completed 6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants