From 0d7647889c6701d8a0e6fa784e886012011ca2d8 Mon Sep 17 00:00:00 2001 From: Theodore Ni <3806110+tjni@users.noreply.github.com> Date: Thu, 27 Jul 2023 23:38:19 -0700 Subject: [PATCH] python3.pkgs.installer: move tests to passthru While installer is built using bootstrap packages, none of its test dependencies should be, so we must move out of the derivation. --- .../python-modules/installer/default.nix | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/installer/default.nix b/pkgs/development/python-modules/installer/default.nix index 02934550273b..d4f1e33ca606 100644 --- a/pkgs/development/python-modules/installer/default.nix +++ b/pkgs/development/python-modules/installer/default.nix @@ -4,6 +4,7 @@ , fetchFromGitHub , pytestCheckHook , flit-core +, installer , mock }: @@ -21,10 +22,26 @@ buildPythonPackage rec { nativeBuildInputs = [ flit-core ]; - nativeCheckInputs = [ - pytestCheckHook - mock - ]; + # We need to disable tests because this package is part of the bootstrap chain + # and its test dependencies cannot be built yet when this is being built. + doCheck = false; + + passthru.tests = { + pytest = buildPythonPackage { + pname = "${pname}-pytest"; + inherit version; + format = "other"; + + dontBuild = true; + dontInstall = true; + + nativeCheckInputs = [ + installer + mock + pytestCheckHook + ]; + }; + }; meta = with lib; { description = "A low-level library for installing a Python package from a wheel distribution";