Skip to content

Commit 9d87f17

Browse files
committed
buildPython*: switch overrideStdenvCompat to mirrorFunctionArgs
The underlying `mk-python-derivation.nix` functions do not have `stdenv` in their functionArgs, so it was redundant to explicitly remove it.
1 parent 37655d3 commit 9d87f17

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ let
4545

4646
overrideStdenvCompat =
4747
f:
48-
lib.setFunctionArgs (
48+
lib.mirrorFunctionArgs f (
4949
args:
5050
if !(lib.isFunction args) && (args ? stdenv) then
5151
lib.warnIf (lib.oldestSupportedReleaseIsAtLeast 2511) ''
5252
Passing `stdenv` directly to `buildPythonPackage` or `buildPythonApplication` is deprecated. You should use their `.override` function instead, e.g:
5353
buildPythonPackage.override { stdenv = customStdenv; } { }
54-
'' (f.override { stdenv = args.stdenv; } args)
54+
'' (f.override { inherit (args) stdenv; } args)
5555
else
5656
f args
57-
) (removeAttrs (lib.functionArgs f) [ "stdenv" ])
57+
)
5858
// {
5959
# Intentionally drop the effect of overrideStdenvCompat when calling `buildPython*.override`.
6060
inherit (f) override;

0 commit comments

Comments
 (0)