From cb445d527ba74e7e99fd6cbb21cda7bba9e30dfa Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Fri, 28 Oct 2022 15:54:07 +0200 Subject: [PATCH] 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. --- pkgs/development/interpreters/python/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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