From 06a4df7b600e6e8659ec499cfb5ddc368975d1b0 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Sun, 25 Jan 2026 15:37:04 +0100 Subject: [PATCH] python3Packages.osc-lib: disable broken test with Python 3.14+ See upstream issue: https://bugs.launchpad.net/python-openstackclient/+bug/2138684 --- .../python-modules/osc-lib/default.nix | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/osc-lib/default.nix b/pkgs/development/python-modules/osc-lib/default.nix index 73ed4068d829..a0f03b93ba4e 100644 --- a/pkgs/development/python-modules/osc-lib/default.nix +++ b/pkgs/development/python-modules/osc-lib/default.nix @@ -8,12 +8,14 @@ oslo-i18n, oslo-utils, pbr, + pythonAtLeast, requests, requests-mock, setuptools, stdenv, stestr, stevedore, + writeText, }: buildPythonPackage rec { @@ -56,15 +58,26 @@ buildPythonPackage rec { stestr ]; - checkPhase = '' - stestr run -e <(echo " - ${lib.optionalString stdenv.hostPlatform.isDarwin '' - osc_lib.tests.test_shell.TestShellCli.test_shell_args_cloud_public - osc_lib.tests.test_shell.TestShellCli.test_shell_args_precedence - osc_lib.tests.test_shell.TestShellCliPrecedence.test_shell_args_precedence_1 - osc_lib.tests.test_shell.TestShellCliPrecedence.test_shell_args_precedence_2 - ''}") - ''; + checkPhase = + let + disabledTests = + lib.optionals stdenv.hostPlatform.isDarwin [ + "osc_lib.tests.test_shell.TestShellCli.test_shell_args_cloud_public" + "osc_lib.tests.test_shell.TestShellCli.test_shell_args_precedence" + "osc_lib.tests.test_shell.TestShellCliPrecedence.test_shell_args_precedence_1" + "osc_lib.tests.test_shell.TestShellCliPrecedence.test_shell_args_precedence_2" + ] + ++ lib.optionals (pythonAtLeast "3.14") [ + # Disable test incompatible with Python 3.14+ + # See upstream issue: https://bugs.launchpad.net/python-openstackclient/+bug/2138684 + "osc_lib.tests.utils.test_tags.TestTagHelps" + ]; + in + '' + runHook preCheck + stestr run -e <(echo "${lib.concatStringsSep "\n" disabledTests}") + runHook postCheck + ''; pythonImportsCheck = [ "osc_lib" ];