diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 1f425d60c63b..f6a43a49c19a 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -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