diff options
author | Orivej Desh <orivej@gmx.fr> | 2017-12-10 20:10:35 +0000 |
---|---|---|
committer | Orivej Desh <orivej@gmx.fr> | 2017-12-10 20:10:35 +0000 |
commit | c86b19cb20f68e6b65af6ac884940ea125e4a8f8 (patch) | |
tree | 6136eeddaa2bb5bad936242a1d9bc2532e7e7e6f /pkgs/top-level | |
parent | 9630bd52323e335c422d4da208590abb535fda43 (diff) | |
download | nixlib-c86b19cb20f68e6b65af6ac884940ea125e4a8f8.tar nixlib-c86b19cb20f68e6b65af6ac884940ea125e4a8f8.tar.gz nixlib-c86b19cb20f68e6b65af6ac884940ea125e4a8f8.tar.bz2 nixlib-c86b19cb20f68e6b65af6ac884940ea125e4a8f8.tar.lz nixlib-c86b19cb20f68e6b65af6ac884940ea125e4a8f8.tar.xz nixlib-c86b19cb20f68e6b65af6ac884940ea125e4a8f8.tar.zst nixlib-c86b19cb20f68e6b65af6ac884940ea125e4a8f8.zip |
Python: simplify hasPythonModule
Diffstat (limited to 'pkgs/top-level')
-rw-r--r-- | pkgs/top-level/python-packages.nix | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d164b80279bb..bcc1bcd7d6b6 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -87,12 +87,11 @@ let in fetcher (builtins.removeAttrs attrs ["format"]) ); # Check whether a derivation provides a Python module. - hasPythonModule = drv: (hasAttr "pythonModule" drv) && ( (getAttr "pythonModule" drv) == python); + hasPythonModule = drv: drv?pythonModule && drv.pythonModule == python; # Get list of required Python modules given a list of derivations. requiredPythonModules = drvs: let - removeNull = list: filter (x: !isNull x) list; - modules = filter hasPythonModule (removeNull drvs); + modules = filter hasPythonModule drvs; in unique ([python] ++ modules ++ concatLists (catAttrs "requiredPythonModules" modules)); # Create a PYTHONPATH from a list of derivations. This function recurses into the items to find derivations |