Python: the pythonModule attribute
Python libraries or modules now have an attribute `pythonModule = interpreter;` to indicate they provide Python modules for the specified `interpreter`. The package set provides the following helper functions: - hasPythonModule: Check whether a derivation provides a Python module. - requiredPythonModules: Recurse into a list of Python modules, returning all Python modules that are required. - makePythonPath: Create a PYTHONPATH from a list of Python modules. Also included in this commit is: - disabledIf: Helper function for disabling non-buildPythonPackage functions.
This commit is contained in:
@@ -2,13 +2,14 @@
|
||||
, extraLibs ? []
|
||||
, extraOutputsToInstall ? []
|
||||
, postBuild ? ""
|
||||
, ignoreCollisions ? false }:
|
||||
, ignoreCollisions ? false
|
||||
, requiredPythonModules
|
||||
, }:
|
||||
|
||||
# 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
|
||||
paths = stdenv.lib.closePropagation (extraLibs ++ [ python recursivePthLoader ] ) ;
|
||||
paths = requiredPythonModules (extraLibs ++ [ python ] ) ;
|
||||
in buildEnv {
|
||||
name = "${python.name}-env";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user