From 861050f03ba9041bff5bf17813d491693e269ad6 Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 6 May 2025 00:11:02 +0200 Subject: [PATCH] python313Packages.ruffus: fix tests re.error is re.PatternError now and the testsuite checks for the exact exception that's thrown (by string/name, not by instance). patch the excepted message for python >=3.13 to make the assertion happy last commit to upstream master was 4 years ago, don't bother trying to fix there --- .../python-modules/ruffus/default.nix | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/ruffus/default.nix b/pkgs/development/python-modules/ruffus/default.nix index f7c96b10d3e1..06147e09686d 100644 --- a/pkgs/development/python-modules/ruffus/default.nix +++ b/pkgs/development/python-modules/ruffus/default.nix @@ -4,6 +4,7 @@ fetchFromGitHub, hostname, pytest, + pythonAtLeast, lib, stdenv, }: @@ -29,15 +30,21 @@ buildPythonPackage rec { # tests very flaky & hang often on darwin doCheck = !stdenv.hostPlatform.isDarwin; - # test files do indeed need to be executed separately - checkPhase = '' - pushd ruffus/test - rm test_with_logger.py # spawns 500 processes - for f in test_*.py ; do - HOME=$TMPDIR pytest -v --disable-warnings $f - done - popd - ''; + checkPhase = + # https://docs.python.org/3/whatsnew/3.13.html#re + lib.optionalString (pythonAtLeast "3.13") '' + substituteInPlace ruffus/test/test_ruffus_utility.py \ + --replace-fail re.error re.PatternError + '' + # test files do indeed need to be executed separately + + '' + pushd ruffus/test + rm test_with_logger.py # spawns 500 processes + for f in test_*.py ; do + HOME=$TMPDIR pytest -v --disable-warnings $f + done + popd + ''; pythonImportsCheck = [ "ruffus" ]; meta = with lib; {