summary refs log tree commit diff
path: root/pkgs/development/interpreters/python/wrapper.nix
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2017-05-28 09:20:47 +0200
committerFrederik Rietdijk <fridh@fridh.nl>2017-11-23 15:11:02 +0100
commit40851a4d26daabf1613c9a79e638aaf9f94b476c (patch)
treedcc1ea11ed1207e4e3de91e8a4bd7eb929c57c50 /pkgs/development/interpreters/python/wrapper.nix
parenta30fa6d9a255288a4f8a1ca77a058bf650ed75ee (diff)
downloadnixpkgs-40851a4d26daabf1613c9a79e638aaf9f94b476c.tar
nixpkgs-40851a4d26daabf1613c9a79e638aaf9f94b476c.tar.gz
nixpkgs-40851a4d26daabf1613c9a79e638aaf9f94b476c.tar.bz2
nixpkgs-40851a4d26daabf1613c9a79e638aaf9f94b476c.tar.lz
nixpkgs-40851a4d26daabf1613c9a79e638aaf9f94b476c.tar.xz
nixpkgs-40851a4d26daabf1613c9a79e638aaf9f94b476c.tar.zst
nixpkgs-40851a4d26daabf1613c9a79e638aaf9f94b476c.zip
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.
Diffstat (limited to 'pkgs/development/interpreters/python/wrapper.nix')
-rw-r--r--pkgs/development/interpreters/python/wrapper.nix7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkgs/development/interpreters/python/wrapper.nix b/pkgs/development/interpreters/python/wrapper.nix
index f42caf92c17..fc521828ffc 100644
--- a/pkgs/development/interpreters/python/wrapper.nix
+++ b/pkgs/development/interpreters/python/wrapper.nix
@@ -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";