python3.pkgs.buildPython*: allow overriding of the stdenv

With this change it is possible to pass in `stdenv` directly to
`buildPython*` or override it using e.g.

```
numpy.overridePythonAttrs(_: {
  stdenv = clangStdenv;
})
```
This commit is contained in:
Frederik Rietdijk 2022-05-17 17:41:27 +02:00 committed by toonn
parent 0526c109a7
commit 7a0d080298

View File

@ -102,13 +102,14 @@
, disabledTestPaths ? []
# Allow passing in a custom stdenv to buildPython*
, stdenv ? python.stdenv
, ... } @ attrs:
assert (pyproject != null) -> (format == null);
let
inherit (python) stdenv;
format' =
if pyproject != null then
if pyproject then
@ -194,7 +195,7 @@ let
# Keep extra attributes from `attrs`, e.g., `patchPhase', etc.
self = toPythonModule (stdenv.mkDerivation ((builtins.removeAttrs attrs [
"disabled" "checkPhase" "checkInputs" "nativeCheckInputs" "doCheck" "doInstallCheck" "dontWrapPythonPrograms" "catchConflicts" "pyproject" "format"
"disabledTestPaths" "outputs"
"disabledTestPaths" "outputs" "stdenv"
]) // {
name = namePrefix + name_;