From 3ccba4c4075e501551b770532788a3c169954449 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 25 Jun 2025 02:50:22 +0200 Subject: [PATCH] python3Packages.numba: fix compat with Python 3.13.4 In python 3.13.4 the bytecode for list comprehension was changed, so numba needs to catch up. It was reversed in 3.13.5, so this workaround is only required temporarily. --- .../python-modules/numba/default.nix | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/numba/default.nix b/pkgs/development/python-modules/numba/default.nix index 467f33626080..4f90733b5cf7 100644 --- a/pkgs/development/python-modules/numba/default.nix +++ b/pkgs/development/python-modules/numba/default.nix @@ -4,6 +4,7 @@ pythonAtLeast, pythonOlder, fetchFromGitHub, + fetchpatch2, python, buildPythonPackage, setuptools, @@ -86,12 +87,20 @@ buildPythonPackage rec { llvmlite ]; - patches = lib.optionals cudaSupport [ - (replaceVars ./cuda_path.patch { - cuda_toolkit_path = cudatoolkit; - cuda_toolkit_lib_path = lib.getLib cudatoolkit; - }) - ]; + patches = + [ + (fetchpatch2 { + url = "https://github.com/numba/numba/commit/e2c8984ba60295def17e363a926d6f75e7fa9f2d.patch"; + includes = [ "numba/core/bytecode.py" ]; + hash = "sha256-HIVbp3GSmnq6W7zrRIirIbhGjJsFN3PNyHSfAE8fdDw="; + }) + ] + ++ lib.optionals cudaSupport [ + (replaceVars ./cuda_path.patch { + cuda_toolkit_path = cudatoolkit; + cuda_toolkit_lib_path = lib.getLib cudatoolkit; + }) + ]; nativeCheckInputs = [ pytestCheckHook