Skip to content

Commit e830243

Browse files
makeOverridablePythonPackage: simplify implementation
Attach overridePythonAttrs by attribute set update instead of `stdenv.mkDerivation`'s `passthru`. Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
1 parent 1653d67 commit e830243

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

pkgs/development/interpreters/python/python-packages-base.nix

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,13 @@ let
1919
lib.mirrorFunctionArgs f (
2020
origArgs:
2121
let
22-
args = lib.fix (
23-
lib.extends (_: previousAttrs: {
24-
passthru = (previousAttrs.passthru or { }) // {
25-
overridePythonAttrs = newArgs: makeOverridablePythonPackage f (overrideWith newArgs);
26-
};
27-
}) (_: origArgs)
28-
);
29-
result = f args;
30-
overrideWith = newArgs: args // (if pkgs.lib.isFunction newArgs then newArgs args else newArgs);
22+
result = f origArgs;
23+
overrideWith = newArgs: origArgs // lib.toFunction newArgs origArgs;
3124
in
32-
if builtins.isAttrs result then
25+
if lib.isAttrs result then
3326
result
34-
else if builtins.isFunction result then
35-
{
27+
// {
3628
overridePythonAttrs = newArgs: makeOverridablePythonPackage f (overrideWith newArgs);
37-
__functor = self: result;
3829
}
3930
else
4031
result

0 commit comments

Comments
 (0)