Commit cb445d52 authored by Frederik Rietdijk's avatar Frederik Rietdijk Committed by Frederik Rietdijk
Browse files

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.
parent 5da48df9
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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