-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
blender: allow functional declaration within withPackages #264292
blender: allow functional declaration within withPackages #264292
Conversation
9a0d959
to
2a395ab
Compare
While rebasing the other PR onto this I noticed I forgot to remove |
7aba915
to
3fe85a3
Compare
That should be everything, mostly the breaking changes part. |
3fe85a3
to
96c880a
Compare
Failing checks may be related to #264290, rebasing... |
Result of 2 packages blacklisted:
|
bpycv test is working fine |
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.
LGTM, mainly nits from me
96c880a
to
67b66f1
Compare
Oh dear |
67b66f1
to
9d73d9d
Compare
Should be alright now Additionally -
|
9d73d9d
to
a8ac511
Compare
a8ac511
to
b60862a
Compare
Sorry about the quick changes, but since you folks made some points to clarify the documentation, I've updated both the documentation and aliases.nix to clarify the new function better. |
b030893
to
5b20db7
Compare
Alright, no more |
5b20db7
to
327dbdf
Compare
I think a refactor of wrapper.nix is required, but I think that should be done later, not with this PR. |
pkgs/top-level/aliases.nix
Outdated
@@ -92,6 +92,7 @@ mapAliases ({ | |||
bird2 = bird; # Added 2022-02-21 | |||
bitwig-studio1 = throw "bitwig-studio1 has been removed, you can upgrade to 'bitwig-studio'"; # Added 2023-01-03 | |||
bitwig-studio2 = throw "bitwig-studio2 has been removed, you can upgrade to 'bitwig-studio'"; # Added 2023-01-03 | |||
blender-with-packages = args: lib.warn "blender-with-packages is deprecated in favor of blender.withPackages, which behaves similarly to python3.withPackages" (blender.withPackages (_: args.packages)).overrideAttrs (lib.optionalAttrs (args ? name) { pname = "blender-" + args.name; }); # Added 2023-10-30 |
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.
Maybe add some line breaks here? This line really feels like a lot.
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 worry about it. Also, the message should probably refer people to blender.withPackages.
told ya. I'll do something about it
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.
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.
Definitely more readable, yeah. Also, I'd probably drop the python3.withPackages
bit entirely and just provide an example - something like "...deprecated in favor of blender.withPackages
, e.g. blender.withPackages(ps: [ ps.honk ])
"
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.
Definitely more readable, yeah. Also, I'd probably drop the
python3.withPackages
bit entirely and just provide an example - something like "...deprecated in favor ofblender.withPackages
, e.g.blender.withPackages(ps: [ ps.honk ])
"
I just feel iffy about referring to a specific package for a general example
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 really see a problem with that personally. If you really wanted to be fancy about it, you could generate the expression from the passed-in package names, I guess (but I feel like this would be trying way too hard lmao)
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.
Ah, I know what to do!
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.
nixpkgs/pkgs/top-level/aliases.nix
Line 96 in fe4c776
lib.warn "blender-with-packages is deprecated in favor of blender.withPackages, e.g. `blender.withPackages(ps: [ ps.foobar ])`" |
How's that?
327dbdf
to
521cd5a
Compare
Based on NixOS#257780, separated since it introduces significant changes. bpycv: update passthru.tests.render blender-with-packages: deprecated it is still backwards compatible, but no longer preferred.
521cd5a
to
fe4c776
Compare
Description of changes
Originally included in #257780, separated since it used to introduce breaking changes.
(not anymore, now
blender-with-packages
is being deprecated.)This allows the following syntax to be used
instead of
Allowing
withPackages
to use the pythonPackages from theblender
package.I've updated
passthru.tests.render
for bpycv to use the new implementation.blender-with-packages is deprecated, as the new implementation breaks the currently used syntax, and it would have trouble integrating with #257780, where multiple versioned variants of blender would be involved.
Also passed through pythonPackages to pass thorugh any overrides applied to blender's current
python310Packages
, and without splicing issues (discussed in #257780)*to test, enter
nix-build -I nixpkgs=./ -E 'with (import <nixpkgs> {}); blender.withPackages(ps: [ps.bpycv])'
, then openingblender-wrapped
, go to the "scripting" workplace (top tabs), and try importingbpycv
through the python terminal`or try
nix-build -A blender.pythonPackages.bpycv.tests.render
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/
)