python3Packages: stdenv does not have to be a Python module
stdenv is included in the package set. It does not provide a Python module however and was therefore catched by the test. Because we do need it we provide an exception for it.
This commit is contained in:
parent
5da48df91e
commit
cb445d527b
@ -33,9 +33,12 @@
|
||||
}: let
|
||||
pythonPackages = let
|
||||
ensurePythonModules = items: let
|
||||
exceptions = [
|
||||
stdenv
|
||||
];
|
||||
providesSetupHook = lib.attrByPath [ "provides" "setupHook"] false;
|
||||
notValid = value: (lib.isDerivation value) && !((pythonPackages.hasPythonModule value) || (providesSetupHook value));
|
||||
func = name: value: if !(notValid value) then value else throw "${name} should use `buildPythonPackage` or `toPythonModule` if it is to be part of the Python packages set.";
|
||||
valid = value: !((lib.isDerivation value) && !((pythonPackages.hasPythonModule value) || (providesSetupHook value))) || (lib.elem value exceptions);
|
||||
func = name: value: if (valid value) then value else throw "${name} should use `buildPythonPackage` or `toPythonModule` if it is to be part of the Python packages set.";
|
||||
in lib.mapAttrs func items;
|
||||
in ensurePythonModules (callPackage
|
||||
# Function that when called
|
||||
|
Loading…
Reference in New Issue
Block a user