Skip to content

Commit

Permalink
python3.pkgs.buildPython*: allow overriding of the stdenv
Browse files Browse the repository at this point in the history
With this change it is possible to pass in `stdenv` directly to
`buildPython*` or override it using e.g.

```
numpy.overridePythonAttrs(_: {
  stdenv = clangStdenv;
})
```
  • Loading branch information
FRidh authored and toonn committed Oct 19, 2023
1 parent 0526c10 commit 7a0d080
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkgs/development/interpreters/python/mk-python-derivation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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_;
Expand Down

0 comments on commit 7a0d080

Please sign in to comment.