-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
python3Packages: fix Python overriding to make <pkg>.overridePythonAttrs
work after <pkg>.overrideAttrs
#267296
base: master
Are you sure you want to change the base?
Conversation
<pkg>.overridePythonAttrs
work after <pkg>.overrideAttrs
<pkg>.overridePythonAttrs
work after <pkg>.overrideAttrs
205c377
to
2cf1c3c
Compare
e16c5f0
to
ac74756
Compare
ac74756
to
971cac5
Compare
@ofborg build tests.overriding |
if builtins.isAttrs result then result | ||
// lib.optionalAttrs (result ? overrideAttrs) { overrideAttrs = fdrv: overrideResult (drv: drv.overrideAttrs fdrv); } |
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.
Don't we need () here or are the redundant?
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.
I don't quite get it.
result?overrideAttrs
would be true only when result
is an attribute. Maybe it would be more readable this way:
if builtins.isAttrs result then
result // lib.optionalAttrs (result?overrideAttrs) {
overrideAttrs =...;
}
else if ...
If you are talking about the let-in construct above the if-then-else construct, it surely doesn't need parenthesis.
nix-repl> let in if 2 + 2 == 5 then "y" else "n"
"n"
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.
Don't we need () here or are the redundant?
Or do you mean that set?attr
has higher precedence over function application and the parenthesis around it is redundant?
b2ebd09
to
7928373
Compare
7928373
to
40ad5e6
Compare
I rebased the feature branch and resolved the merge conflict. |
40ad5e6
to
13aafb0
Compare
13aafb0
to
d77a5ff
Compare
Test with pip, which is less likely to fail. Modularize the transforming function and testing function. Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Make it possible to mix overridePythonAttrs and overrideAttrs, i.e. ((<pkg>.overrideAttrs (_: { foo = "a"; })).overridePythonAttrs (_: { })).foo now works
d77a5ff
to
9cca688
Compare
Description of changes
This patch updates the
<pkg>.overrideAttrs
insidemakeOverridablePythonPackage
(the function that adds<pkg>.overridePythonAttrs
). If applied,<pkgs>.overridePythonAttrs
will work after applying<pkg>.overrideAttrs
to override a Python package built withbuildPythonPackage
orbuildPythonApplication
.This patch also adds corresponding test cases to
tests.overriding
.Closes #267293.
Initial effort for #271387.
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/
)