mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-16 18:37:04 +03:00
python.buildEnv: fix passthru
Python envs did not pass through any of the properties the Python interpreter has. That could be annoying, especially not having `python.interpreter` which is the path to the interpreter. This commit fixes the situation and inherit python.passthru.
This commit is contained in:
parent
07674788d6
commit
ea4121d225
@ -6,8 +6,7 @@
|
||||
# Create a python executable that knows about additional packages.
|
||||
let
|
||||
recursivePthLoader = import ../../python-modules/recursive-pth-loader/default.nix { stdenv = stdenv; python = python; };
|
||||
env = (
|
||||
let
|
||||
env = let
|
||||
paths = stdenv.lib.closePropagation (extraLibs ++ [ python recursivePthLoader ] ) ;
|
||||
in buildEnv {
|
||||
name = "${python.name}-env";
|
||||
@ -36,19 +35,21 @@ let
|
||||
done
|
||||
'' + postBuild;
|
||||
|
||||
passthru.env = stdenv.mkDerivation {
|
||||
name = "interactive-${python.name}-environment";
|
||||
nativeBuildInputs = [ env ];
|
||||
|
||||
buildCommand = ''
|
||||
echo >&2 ""
|
||||
echo >&2 "*** Python 'env' attributes are intended for interactive nix-shell sessions, not for building! ***"
|
||||
echo >&2 ""
|
||||
exit 1
|
||||
'';
|
||||
};
|
||||
}) // {
|
||||
inherit python;
|
||||
inherit (python) meta;
|
||||
|
||||
passthru = python.passthru // {
|
||||
interpreter = "${env}/bin/${python.executable}";
|
||||
env = stdenv.mkDerivation {
|
||||
name = "interactive-${python.name}-environment";
|
||||
nativeBuildInputs = [ env ];
|
||||
|
||||
buildCommand = ''
|
||||
echo >&2 ""
|
||||
echo >&2 "*** Python 'env' attributes are intended for interactive nix-shell sessions, not for building! ***"
|
||||
echo >&2 ""
|
||||
exit 1
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
in env
|
||||
|
Loading…
Reference in New Issue
Block a user