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.
This commit is contained in:
Matt Sturgeon
2025-12-11 01:07:55 +00:00
parent 37655d3b36
commit 9d87f178ed
@@ -45,16 +45,16 @@ let
overrideStdenvCompat =
f:
lib.setFunctionArgs (
lib.mirrorFunctionArgs f (
args:
if !(lib.isFunction args) && (args ? stdenv) then
lib.warnIf (lib.oldestSupportedReleaseIsAtLeast 2511) ''
Passing `stdenv` directly to `buildPythonPackage` or `buildPythonApplication` is deprecated. You should use their `.override` function instead, e.g:
buildPythonPackage.override { stdenv = customStdenv; } { }
'' (f.override { stdenv = args.stdenv; } args)
'' (f.override { inherit (args) stdenv; } args)
else
f args
) (removeAttrs (lib.functionArgs f) [ "stdenv" ])
)
// {
# Intentionally drop the effect of overrideStdenvCompat when calling `buildPython*.override`.
inherit (f) override;