Skip to content
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

Python: Add overrideAttrs attribute aliasing overridePythonAttrs #82772

Open
wants to merge 2 commits into
base: master
from

Conversation

@adisbladis
Copy link
Member

adisbladis commented Mar 17, 2020

Motivation for this change

This will make lib.makeOverridable use overridePythonAttrs by default.

Overriding Python packages has some surprising properties unless you use overridePythonAttrs and it can be incredibly frustrating to try and find out why that is.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
This will make lib.makeOverridable use overridePythonAttrs by default.
@adisbladis adisbladis requested review from FRidh and jonringer as code owners Mar 17, 2020
@adisbladis
Copy link
Member Author

adisbladis commented Mar 17, 2020

@FRidh What kind of tests do you have in mind?

@ofborg ofborg bot added the 6.topic: python label Mar 17, 2020
@FRidh
Copy link
Member

FRidh commented Mar 17, 2020

Testing that buildPythonPackage is indeed invoked again. One way to assert this is by adding to propagatedBuildInputs and testing it has an affect on requiredPythonModules, which serves as input to python.buildEnv.

@FRidh
Copy link
Member

FRidh commented Mar 17, 2020

cc @alyssais because of #46842.

That discussion was already a year and a half ago...time flies.

@adisbladis
Copy link
Member Author

adisbladis commented Mar 17, 2020

@FRidh I added a test. Since it's not actually building anything but only asserts attributes I made a new type of test.

@adisbladis adisbladis force-pushed the adisbladis:python-overrideattrs branch from 4e3f282 to d117f06 Mar 17, 2020
@FRidh
Copy link
Member

FRidh commented Mar 17, 2020

@GrahamcOfBorg build python2.tests python3.tests python38.tests

@FRidh
Copy link
Member

FRidh commented Mar 17, 2020

@GrahamcOfBorg build pypy2.tests pypy3.tests

@FRidh
FRidh approved these changes Mar 17, 2020
@FRidh
Copy link
Member

FRidh commented Mar 17, 2020

Let's wait a bit with merging this.

@alyssais
Copy link
Member

alyssais commented Mar 17, 2020

@FRidh yiu don’t think this needs an RFC any more?

@FRidh
Copy link
Member

FRidh commented Mar 17, 2020

Right, I wrote that. I do think it is best we standardize interfaces like these and I see you asked matthewbauer at the time to help with it. Let's write a small RFC and see where that takes us.

@FRidh
Copy link
Member

FRidh commented Mar 17, 2020

RFC proposal #46842 (comment)

FRidh added a commit that referenced this pull request Apr 26, 2020
…oCheck (#86051)"

For disabling tests when overriding, use `.overridePythonAttrs`.

Discussion about aliasing `.overridePythonAttrs` to `.overrideAttrs`.
#82772

This reverts commit 3581287.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.