From ea4121d225e6b3a7bebad1f6686d952a3e5f0e13 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Tue, 1 Aug 2017 16:25:53 +0200 Subject: [PATCH] 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. --- .../interpreters/python/wrapper.nix | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/pkgs/development/interpreters/python/wrapper.nix b/pkgs/development/interpreters/python/wrapper.nix index 65b949661b0..71e9e614352 100644 --- a/pkgs/development/interpreters/python/wrapper.nix +++ b/pkgs/development/interpreters/python/wrapper.nix @@ -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