Skip to content

Commit

Permalink
mkPythonPackage, mkPythonApplication: handle passthru with `stdenv.…
Browse files Browse the repository at this point in the history
…mkDerivation` instead of `lib.extendDerivation` (NixOS#347130)
  • Loading branch information
natsukium authored Oct 14, 2024
2 parents 1e4e9d4 + 21a1cf9 commit 0a77110
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions pkgs/development/interpreters/python/mk-python-derivation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -215,23 +215,6 @@ let

isSetuptoolsDependency = isSetuptoolsDependency' (attrs.pname or null);

passthru =
attrs.passthru or { }
// {
updateScript = let
filename = head (splitString ":" self.meta.position);
in attrs.passthru.updateScript or [ update-python-libraries filename ];
}
// optionalAttrs (dependencies != []) {
inherit dependencies;
}
// optionalAttrs (optional-dependencies != {}) {
inherit optional-dependencies;
}
// optionalAttrs (build-system != []) {
inherit build-system;
};

# Keep extra attributes from `attrs`, e.g., `patchPhase', etc.
self = toPythonModule (stdenv.mkDerivation ((cleanAttrs attrs) // {

Expand Down Expand Up @@ -324,7 +307,21 @@ let

outputs = outputs ++ optional withDistOutput "dist";

inherit passthru;
passthru = attrs.passthru or { }
// {
updateScript = let
filename = head (splitString ":" self.meta.position);
in attrs.passthru.updateScript or [ update-python-libraries filename ];
}
// optionalAttrs (dependencies != []) {
inherit dependencies;
}
// optionalAttrs (optional-dependencies != {}) {
inherit optional-dependencies;
}
// optionalAttrs (build-system != []) {
inherit build-system;
};

meta = {
# default to python's platforms
Expand All @@ -351,5 +348,5 @@ let

in extendDerivation
(disabled -> throw "${name} not supported for interpreter ${python.executable}")
passthru
{ }
self

0 comments on commit 0a77110

Please sign in to comment.