From 129c5a5cb4776397bb2f900ce756423ed0eefccdb4a7c9938b73689b35b7776b Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 1 Jan 2023 13:32:23 +0000 Subject: [PATCH 1/4] WIP upgrade OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-numba?expand=0&rev=59 --- allow-numpy-1.24.patch | 15 +++++++++++++++ numba-0.56.2.tar.gz | 3 --- numba-0.56.4.tar.gz | 3 +++ python-numba.changes | 14 ++++++++++++++ python-numba.spec | 9 ++++++--- skip-failing-tests.patch | 23 ++++++++++++----------- update-tbb-backend-calls-2021.6.patch | 10 ++++++---- 7 files changed, 56 insertions(+), 21 deletions(-) create mode 100644 allow-numpy-1.24.patch delete mode 100644 numba-0.56.2.tar.gz create mode 100644 numba-0.56.4.tar.gz diff --git a/allow-numpy-1.24.patch b/allow-numpy-1.24.patch new file mode 100644 index 0000000..5175d5a --- /dev/null +++ b/allow-numpy-1.24.patch @@ -0,0 +1,15 @@ +--- + setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/setup.py ++++ b/setup.py +@@ -23,7 +23,7 @@ min_python_version = "3.7" + max_python_version = "3.11" # exclusive + min_numpy_build_version = "1.11" + min_numpy_run_version = "1.18" +-max_numpy_run_version = "1.24" ++max_numpy_run_version = "1.25" + min_llvmlite_version = "0.39.0dev0" + max_llvmlite_version = "0.40" + diff --git a/numba-0.56.2.tar.gz b/numba-0.56.2.tar.gz deleted file mode 100644 index ba809fb..0000000 --- a/numba-0.56.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3492f0a5d09e257fc521f5377a6c6b907eec1920d14739f0b2458b9d29946a5a -size 2417234 diff --git a/numba-0.56.4.tar.gz b/numba-0.56.4.tar.gz new file mode 100644 index 0000000..f6e7b70 --- /dev/null +++ b/numba-0.56.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:32d9fef412c81483d7efe0ceb6cf4d3310fde8b624a9cecca00f790573ac96ee +size 2418748 diff --git a/python-numba.changes b/python-numba.changes index 79728ea..269cb3b 100644 --- a/python-numba.changes +++ b/python-numba.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Sun Jan 1 11:41:11 UTC 2023 - Matej Cepl + +- Update to 0.56.4: + - This is a bugfix release to fix a regression in the CUDA + target in relation to the .view() method on CUDA device + arrays that is present when using NumPy version 1.23.0 or + later. + - This is a bugfix release to remove the version restriction + applied to the setuptools package and to fix a bug in the + CUDA target in relation to copying zero length device arrays + to zero length host arrays. +- Add allow-numpy-1.24.patch to allow work with numpy 1.24 + ------------------------------------------------------------------- Mon Oct 10 10:07:52 UTC 2022 - John Vandenberg diff --git a/python-numba.spec b/python-numba.spec index 30cba8d..12e81ab 100644 --- a/python-numba.spec +++ b/python-numba.spec @@ -1,7 +1,7 @@ # # spec file # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -21,7 +21,7 @@ %define plainpython python # upper bound is exclusive: min-numpy_ver <= numpy < max_numpy_ver %define min_numpy_ver 1.18 -%define max_numpy_ver 1.24 +%define max_numpy_ver 1.25 %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "test" %define psuffix -test @@ -31,7 +31,7 @@ %bcond_with test %endif Name: python-numba%{psuffix} -Version: 0.56.2 +Version: 0.56.4 Release: 0 Summary: NumPy-aware optimizing compiler for Python using LLVM License: BSD-2-Clause @@ -42,6 +42,9 @@ Patch2: fix-cli-test.patch Patch3: skip-failing-tests.patch # PATCH-FIX-OPENSUSE update-tbb-backend-calls-2021.6.patch, based on gh#numba/numba#7608 Patch4: update-tbb-backend-calls-2021.6.patch +# PATCH-FIX-UPSTREAM allow-numpy-1.24.patch bsc#[0-9]+ mcepl@suse.com +# Allow working with numpy 1.24 and higher +Patch5: allow-numpy-1.24.patch BuildRequires: %{python_module devel >= 3.7} BuildRequires: %{python_module numpy-devel >= %{min_numpy_ver} with %python-numpy-devel < %{max_numpy_ver}} BuildRequires: %{python_module setuptools} diff --git a/skip-failing-tests.patch b/skip-failing-tests.patch index c22ed9e..96e6cb6 100644 --- a/skip-failing-tests.patch +++ b/skip-failing-tests.patch @@ -1,8 +1,11 @@ -Index: numba-0.54.0/numba/tests/test_parfors.py -=================================================================== ---- numba-0.54.0.orig/numba/tests/test_parfors.py -+++ numba-0.54.0/numba/tests/test_parfors.py -@@ -1146,6 +1146,7 @@ class TestParforNumPy(TestParforsBase): +--- + numba/tests/test_parfors.py | 5 +++-- + numba/tests/test_parfors_passes.py | 1 + + 2 files changed, 4 insertions(+), 2 deletions(-) + +--- a/numba/tests/test_parfors.py ++++ b/numba/tests/test_parfors.py +@@ -1174,6 +1174,7 @@ class TestParforNumPy(TestParforsBase): self.check_variants(test_impl2, data_gen) self.count_parfors_variants(test_impl2, data_gen) @@ -10,7 +13,7 @@ Index: numba-0.54.0/numba/tests/test_parfors.py def test_ndarray_fill(self): def test_impl(x): x.fill(7.0) -@@ -3890,7 +3891,7 @@ class TestParforsVectorizer(TestPrangeBa +@@ -4396,7 +4397,7 @@ class TestParforsVectorizer(TestPrangeBa # to check vsqrtpd operates on zmm match_vsqrtpd_on_zmm = re.compile('\n\s+vsqrtpd\s+.*zmm.*\n') @@ -19,7 +22,7 @@ Index: numba-0.54.0/numba/tests/test_parfors.py def test_vectorizer_fastmath_asm(self): """ This checks that if fastmath is set and the underlying hardware is suitable, and the function supplied is amenable to fastmath based -@@ -3933,7 +3934,7 @@ class TestParforsVectorizer(TestPrangeBa +@@ -4439,7 +4440,7 @@ class TestParforsVectorizer(TestPrangeBa # check no zmm addressing is present self.assertTrue('zmm' not in v) @@ -28,10 +31,8 @@ Index: numba-0.54.0/numba/tests/test_parfors.py def test_unsigned_refusal_to_vectorize(self): """ This checks that if fastmath is set and the underlying hardware is suitable, and the function supplied is amenable to fastmath based -Index: numba-0.54.0/numba/tests/test_parfors_passes.py -=================================================================== ---- numba-0.54.0.orig/numba/tests/test_parfors_passes.py -+++ numba-0.54.0/numba/tests/test_parfors_passes.py +--- a/numba/tests/test_parfors_passes.py ++++ b/numba/tests/test_parfors_passes.py @@ -516,6 +516,7 @@ class TestConvertLoopPass(BaseTest): str(raises.exception), ) diff --git a/update-tbb-backend-calls-2021.6.patch b/update-tbb-backend-calls-2021.6.patch index 93c4013..4b07df2 100644 --- a/update-tbb-backend-calls-2021.6.patch +++ b/update-tbb-backend-calls-2021.6.patch @@ -1,7 +1,9 @@ -Index: numba-0.56.2/numba/np/ufunc/tbbpool.cpp -=================================================================== ---- numba-0.56.2.orig/numba/np/ufunc/tbbpool.cpp -+++ numba-0.56.2/numba/np/ufunc/tbbpool.cpp +--- + numba/np/ufunc/tbbpool.cpp | 29 ++++++++++++++++++++++++----- + 1 file changed, 24 insertions(+), 5 deletions(-) + +--- a/numba/np/ufunc/tbbpool.cpp ++++ b/numba/np/ufunc/tbbpool.cpp @@ -12,6 +12,7 @@ Implement parallel vectorize workqueue o #undef _XOPEN_SOURCE #endif From 589481cec3e358cf160510ac578d5179fccd112926b3e6d258c78c17e6c5df83 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 2 Jan 2023 14:57:02 +0000 Subject: [PATCH 2/4] Some updates. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-numba?expand=0&rev=60 --- allow-numpy-1.24.patch | 405 ++++++++++++++++++++++++++++++++++++++++- python-numba.spec | 21 ++- 2 files changed, 414 insertions(+), 12 deletions(-) diff --git a/allow-numpy-1.24.patch b/allow-numpy-1.24.patch index 5175d5a..ac587a5 100644 --- a/allow-numpy-1.24.patch +++ b/allow-numpy-1.24.patch @@ -1,7 +1,408 @@ --- - setup.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + numba/__init__.py | 4 - + numba/cuda/tests/cudapy/test_intrinsics.py | 4 - + numba/np/arraymath.py | 6 ++ + numba/np/ufunc/_internal.c | 25 +++++------ + numba/stencils/stencilparfor.py | 7 ++- + numba/tests/test_array_methods.py | 15 ++----- + numba/tests/test_comprehension.py | 2 + numba/tests/test_linalg.py | 61 +++++++++++++++-------------- + numba/tests/test_mathlib.py | 2 + numba/tests/test_np_functions.py | 12 +++-- + setup.py | 2 + 11 files changed, 75 insertions(+), 65 deletions(-) +--- a/numba/__init__.py ++++ b/numba/__init__.py +@@ -142,8 +142,8 @@ def _ensure_critical_deps(): + + if numpy_version < (1, 18): + raise ImportError("Numba needs NumPy 1.18 or greater") +- elif numpy_version > (1, 23): +- raise ImportError("Numba needs NumPy 1.23 or less") ++ elif numpy_version > (1, 24): ++ raise ImportError("Numba needs NumPy 1.24 or less") + + try: + import scipy +--- a/numba/cuda/tests/cudapy/test_intrinsics.py ++++ b/numba/cuda/tests/cudapy/test_intrinsics.py +@@ -619,7 +619,7 @@ class TestCudaIntrinsic(CUDATestCase): + arg2 = np.float16(4.) + compiled[1, 1](ary, arg1, arg2) + np.testing.assert_allclose(ary[0], arg2) +- arg1 = np.float(5.) ++ arg1 = np.float16(5.) + compiled[1, 1](ary, arg1, arg2) + np.testing.assert_allclose(ary[0], arg1) + +@@ -631,7 +631,7 @@ class TestCudaIntrinsic(CUDATestCase): + arg2 = np.float16(4.) + compiled[1, 1](ary, arg1, arg2) + np.testing.assert_allclose(ary[0], arg1) +- arg1 = np.float(5.) ++ arg1 = np.float16(5.) + compiled[1, 1](ary, arg1, arg2) + np.testing.assert_allclose(ary[0], arg2) + +--- a/numba/np/arraymath.py ++++ b/numba/np/arraymath.py +@@ -4177,6 +4177,10 @@ iinfo = namedtuple('iinfo', _iinfo_suppo + # This module is imported under the compiler lock which should deal with the + # lack of thread safety in the warning filter. + def _gen_np_machar(): ++ # NumPy 1.24 removed np.MachAr ++ if numpy_version >= (1, 24): ++ return ++ + np122plus = numpy_version >= (1, 22) + w = None + with warnings.catch_warnings(record=True) as w: +@@ -4203,7 +4207,7 @@ def _gen_np_machar(): + return impl + + +-_gen_np_machar() ++# _gen_np_machar() + + + def generate_xinfo(np_func, container, attr): +--- a/numba/np/ufunc/_internal.c ++++ b/numba/np/ufunc/_internal.c +@@ -285,9 +285,7 @@ static struct _ufunc_dispatch { + PyCFunctionWithKeywords ufunc_accumulate; + PyCFunctionWithKeywords ufunc_reduceat; + PyCFunctionWithKeywords ufunc_outer; +-#if NPY_API_VERSION >= 0x00000008 + PyCFunction ufunc_at; +-#endif + } ufunc_dispatch; + + static int +@@ -303,10 +301,8 @@ init_ufunc_dispatch(int *numpy_uses_fast + if (strncmp(crnt_name, "accumulate", 11) == 0) { + ufunc_dispatch.ufunc_accumulate = + (PyCFunctionWithKeywords)crnt->ml_meth; +-#if NPY_API_VERSION >= 0x00000008 + } else if (strncmp(crnt_name, "at", 3) == 0) { + ufunc_dispatch.ufunc_at = crnt->ml_meth; +-#endif + } else { + result = -1; + } +@@ -326,10 +322,15 @@ init_ufunc_dispatch(int *numpy_uses_fast + } else if (strncmp(crnt_name, "reduceat", 9) == 0) { + ufunc_dispatch.ufunc_reduceat = + (PyCFunctionWithKeywords)crnt->ml_meth; ++ } else if (strncmp(crnt_name, "resolve_dtypes", 15) == 0) { ++ /* Ignored */ + } else { + result = -1; + } + break; ++ case '_': ++ // We ignore private methods ++ break; + default: + result = -1; /* Unknown method */ + } +@@ -341,6 +342,8 @@ init_ufunc_dispatch(int *numpy_uses_fast + *numpy_uses_fastcall = crnt->ml_flags & METH_FASTCALL; + } + else if (*numpy_uses_fastcall != (crnt->ml_flags & METH_FASTCALL)) { ++ PyErr_SetString(PyExc_RuntimeError, ++ "ufunc.at() flags do not match numpy_uses_fastcall"); + return -1; + } + } +@@ -351,11 +354,13 @@ init_ufunc_dispatch(int *numpy_uses_fast + && (ufunc_dispatch.ufunc_accumulate != NULL) + && (ufunc_dispatch.ufunc_reduceat != NULL) + && (ufunc_dispatch.ufunc_outer != NULL) +-#if NPY_API_VERSION >= 0x00000008 + && (ufunc_dispatch.ufunc_at != NULL) +-#endif + ); ++ } else { ++ char const * const fmt = "Unexpected ufunc method %s()"; ++ PyErr_Format(PyExc_RuntimeError, fmt, crnt_name); + } ++ + return result; + } + +@@ -425,13 +430,11 @@ dufunc_outer_fast(PyDUFuncObject * self, + } + + +-#if NPY_API_VERSION >= 0x00000008 + static PyObject * + dufunc_at(PyDUFuncObject * self, PyObject * args) + { + return ufunc_dispatch.ufunc_at((PyObject*)self->ufunc, args); + } +-#endif + + static PyObject * + dufunc__compile_for_args(PyDUFuncObject * self, PyObject * args, +@@ -609,11 +612,9 @@ static struct PyMethodDef dufunc_methods + {"outer", + (PyCFunction)dufunc_outer, + METH_VARARGS | METH_KEYWORDS, NULL}, +-#if NPY_API_VERSION >= 0x00000008 + {"at", + (PyCFunction)dufunc_at, + METH_VARARGS, NULL}, +-#endif + {"_compile_for_args", + (PyCFunction)dufunc__compile_for_args, + METH_VARARGS | METH_KEYWORDS, +@@ -643,11 +644,9 @@ static struct PyMethodDef dufunc_methods + {"outer", + (PyCFunction)dufunc_outer_fast, + METH_FASTCALL | METH_KEYWORDS, NULL}, +-#if NPY_API_VERSION >= 0x00000008 + {"at", + (PyCFunction)dufunc_at, + METH_VARARGS, NULL}, +-#endif + {"_compile_for_args", + (PyCFunction)dufunc__compile_for_args, + METH_VARARGS | METH_KEYWORDS, +@@ -791,9 +790,7 @@ MOD_INIT(_internal) + if (PyModule_AddIntMacro(m, PyUFunc_One) + || PyModule_AddIntMacro(m, PyUFunc_Zero) + || PyModule_AddIntMacro(m, PyUFunc_None) +-#if NPY_API_VERSION >= 0x00000007 + || PyModule_AddIntMacro(m, PyUFunc_ReorderableNone) +-#endif + ) + return MOD_ERROR_VAL; + +--- a/numba/stencils/stencilparfor.py ++++ b/numba/stencils/stencilparfor.py +@@ -21,6 +21,7 @@ from numba.core.ir_utils import (get_cal + find_callname, require, find_const, GuardException) + from numba.core.errors import NumbaValueError + from numba.core.utils import OPERATORS_TO_BUILTINS ++from numba.np import numpy_support + + + def _compute_last_ind(dim_size, index_const): +@@ -264,7 +265,11 @@ class StencilPass(object): + dtype_g_np_assign = ir.Assign(dtype_g_np, dtype_g_np_var, loc) + init_block.body.append(dtype_g_np_assign) + +- dtype_np_attr_call = ir.Expr.getattr(dtype_g_np_var, return_type.dtype.name, loc) ++ return_type_name = numpy_support.as_dtype( ++ return_type.dtype).type.__name__ ++ if return_type_name == 'bool': ++ return_type_name = 'bool_' ++ dtype_np_attr_call = ir.Expr.getattr(dtype_g_np_var, return_type_name, loc) + dtype_attr_var = ir.Var(scope, mk_unique_var("$np_attr_attr"), loc) + self.typemap[dtype_attr_var.name] = types.functions.NumberClass(return_type.dtype) + dtype_attr_assign = ir.Assign(dtype_np_attr_call, dtype_attr_var, loc) +--- a/numba/tests/test_array_methods.py ++++ b/numba/tests/test_array_methods.py +@@ -1193,7 +1193,7 @@ class TestArrayMethods(MemoryLeakMixin, + pyfunc = array_sum_dtype_kws + cfunc = jit(nopython=True)(pyfunc) + all_dtypes = [np.float64, np.float32, np.int64, np.int32, np.uint32, +- np.uint64, np.complex64, np.complex128, TIMEDELTA_M] ++ np.uint64, np.complex64, np.complex128] + all_test_arrays = [ + [np.ones((7, 6, 5, 4, 3), arr_dtype), + np.ones(1, arr_dtype), +@@ -1207,8 +1207,7 @@ class TestArrayMethods(MemoryLeakMixin, + np.dtype('uint32'): [np.float64, np.int64, np.float32], + np.dtype('uint64'): [np.float64, np.int64], + np.dtype('complex64'): [np.complex64, np.complex128], +- np.dtype('complex128'): [np.complex128], +- np.dtype(TIMEDELTA_M): [np.dtype(TIMEDELTA_M)]} ++ np.dtype('complex128'): [np.complex128]} + + for arr_list in all_test_arrays: + for arr in arr_list: +@@ -1216,15 +1215,15 @@ class TestArrayMethods(MemoryLeakMixin, + subtest_str = ("Testing np.sum with {} input and {} output" + .format(arr.dtype, out_dtype)) + with self.subTest(subtest_str): +- self.assertPreciseEqual(pyfunc(arr, dtype=out_dtype), +- cfunc(arr, dtype=out_dtype)) ++ self.assertPreciseEqual(pyfunc(arr, dtype=out_dtype), ++ cfunc(arr, dtype=out_dtype)) + + def test_sum_axis_dtype_kws(self): + """ test sum with axis and dtype parameters over a whole range of dtypes """ + pyfunc = array_sum_axis_dtype_kws + cfunc = jit(nopython=True)(pyfunc) + all_dtypes = [np.float64, np.float32, np.int64, np.int32, np.uint32, +- np.uint64, np.complex64, np.complex128, TIMEDELTA_M] ++ np.uint64, np.complex64, np.complex128] + all_test_arrays = [ + [np.ones((7, 6, 5, 4, 3), arr_dtype), + np.ones(1, arr_dtype), +@@ -1238,9 +1237,7 @@ class TestArrayMethods(MemoryLeakMixin, + np.dtype('uint32'): [np.float64, np.int64, np.float32], + np.dtype('uint64'): [np.float64, np.uint64], + np.dtype('complex64'): [np.complex64, np.complex128], +- np.dtype('complex128'): [np.complex128], +- np.dtype(TIMEDELTA_M): [np.dtype(TIMEDELTA_M)], +- np.dtype(TIMEDELTA_Y): [np.dtype(TIMEDELTA_Y)]} ++ np.dtype('complex128'): [np.complex128]} + + for arr_list in all_test_arrays: + for arr in arr_list: +--- a/numba/tests/test_comprehension.py ++++ b/numba/tests/test_comprehension.py +@@ -11,6 +11,7 @@ from numba import jit, typed + from numba.core import types, utils + from numba.core.errors import TypingError, LoweringError + from numba.core.types.functions import _header_lead ++from numba.np.numpy_support import numpy_version + from numba.tests.support import tag, _32bit, captured_stdout + + +@@ -360,6 +361,7 @@ class TestArrayComprehension(unittest.Te + self.check(comp_nest_with_array_conditional, 5, + assert_allocate_list=True) + ++ @unittest.skipUnless(numpy_version < (1, 24), 'Removed in NumPy 1.24') + def test_comp_nest_with_dependency(self): + def comp_nest_with_dependency(n): + l = np.array([[i * j for j in range(i+1)] for i in range(n)]) +--- a/numba/tests/test_linalg.py ++++ b/numba/tests/test_linalg.py +@@ -1122,6 +1122,32 @@ class TestLinalgSvd(TestLinalgBase): + Tests for np.linalg.svd. + """ + ++ # This checks that A ~= U*S*V**H, i.e. SV decomposition ties out. This is ++ # required as NumPy uses only double precision LAPACK routines and ++ # computation of SVD is numerically sensitive. Numba uses type-specific ++ # routines and therefore sometimes comes out with a different answer to ++ # NumPy (orthonormal bases are not unique, etc.). ++ ++ def check_reconstruction(self, a, got, expected): ++ u, sv, vt = got ++ ++ # Check they are dimensionally correct ++ for k in range(len(expected)): ++ self.assertEqual(got[k].shape, expected[k].shape) ++ ++ # Columns in u and rows in vt dictates the working size of s ++ s = np.zeros((u.shape[1], vt.shape[0])) ++ np.fill_diagonal(s, sv) ++ ++ rec = np.dot(np.dot(u, s), vt) ++ resolution = np.finfo(a.dtype).resolution ++ np.testing.assert_allclose( ++ a, ++ rec, ++ rtol=10 * resolution, ++ atol=100 * resolution # zeros tend to be fuzzy ++ ) ++ + @needs_lapack + def test_linalg_svd(self): + """ +@@ -1150,34 +1176,8 @@ class TestLinalgSvd(TestLinalgBase): + # plain match failed, test by reconstruction + use_reconstruction = True + +- # if plain match fails then reconstruction is used. +- # this checks that A ~= U*S*V**H +- # i.e. SV decomposition ties out +- # this is required as numpy uses only double precision lapack +- # routines and computation of svd is numerically +- # sensitive, numba using the type specific routines therefore +- # sometimes comes out with a different answer (orthonormal bases +- # are not unique etc.). + if use_reconstruction: +- u, sv, vt = got +- +- # check they are dimensionally correct +- for k in range(len(expected)): +- self.assertEqual(got[k].shape, expected[k].shape) +- +- # regardless of full_matrices cols in u and rows in vt +- # dictates the working size of s +- s = np.zeros((u.shape[1], vt.shape[0])) +- np.fill_diagonal(s, sv) +- +- rec = np.dot(np.dot(u, s), vt) +- resolution = np.finfo(a.dtype).resolution +- np.testing.assert_allclose( +- a, +- rec, +- rtol=10 * resolution, +- atol=100 * resolution # zeros tend to be fuzzy +- ) ++ self.check_reconstruction(a, got, expected) + + # Ensure proper resource management + with self.assertNoNRTLeak(): +@@ -1238,8 +1238,11 @@ class TestLinalgSvd(TestLinalgBase): + got = func(X, False) + np.testing.assert_allclose(X, X_orig) + +- for e_a, g_a in zip(expected, got): +- np.testing.assert_allclose(e_a, g_a) ++ try: ++ for e_a, g_a in zip(expected, got): ++ np.testing.assert_allclose(e_a, g_a) ++ except AssertionError: ++ self.check_reconstruction(X, got, expected) + + + class TestLinalgQr(TestLinalgBase): +--- a/numba/tests/test_mathlib.py ++++ b/numba/tests/test_mathlib.py +@@ -516,7 +516,7 @@ class TestMathLib(TestCase): + with warnings.catch_warnings(): + warnings.simplefilter("error", RuntimeWarning) + self.assertRaisesRegexp(RuntimeWarning, +- 'overflow encountered in .*_scalars', ++ 'overflow encountered in .*scalar', + naive_hypot, val, val) + + def test_hypot_npm(self): +--- a/numba/tests/test_np_functions.py ++++ b/numba/tests/test_np_functions.py +@@ -932,11 +932,11 @@ class TestNPFunctions(MemoryLeakMixin, T + yield np.inf, None + yield np.PINF, None + yield np.asarray([-np.inf, 0., np.inf]), None +- yield np.NINF, np.zeros(1, dtype=np.bool) +- yield np.inf, np.zeros(1, dtype=np.bool) +- yield np.PINF, np.zeros(1, dtype=np.bool) ++ yield np.NINF, np.zeros(1, dtype=np.bool_) ++ yield np.inf, np.zeros(1, dtype=np.bool_) ++ yield np.PINF, np.zeros(1, dtype=np.bool_) + yield np.NINF, np.empty(12) +- yield np.asarray([-np.inf, 0., np.inf]), np.zeros(3, dtype=np.bool) ++ yield np.asarray([-np.inf, 0., np.inf]), np.zeros(3, dtype=np.bool_) + + pyfuncs = [isneginf, isposinf] + for pyfunc in pyfuncs: +@@ -4775,6 +4775,7 @@ def foo(): + eval(compile(funcstr, '', 'exec')) + return locals()['foo'] + ++ @unittest.skipIf(numpy_version >= (1, 24), "NumPy < 1.24 required") + def test_MachAr(self): + attrs = ('ibeta', 'it', 'machep', 'eps', 'negep', 'epsneg', 'iexp', + 'minexp', 'xmin', 'maxexp', 'xmax', 'irnd', 'ngrd', +@@ -4817,7 +4818,8 @@ def foo(): + cfunc = jit(nopython=True)(iinfo) + cfunc(np.float64(7)) + +- @unittest.skipUnless(numpy_version >= (1, 22), "Needs NumPy >= 1.22") ++ @unittest.skipUnless((1, 22) <= numpy_version < (1, 24), ++ "Needs NumPy >= 1.22, < 1.24") + @TestCase.run_test_in_subprocess + def test_np_MachAr_deprecation_np122(self): + # Tests that Numba is replaying the NumPy 1.22 deprecation warning --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ min_python_version = "3.7" diff --git a/python-numba.spec b/python-numba.spec index 12e81ab..1b15e6a 100644 --- a/python-numba.spec +++ b/python-numba.spec @@ -47,7 +47,8 @@ Patch4: update-tbb-backend-calls-2021.6.patch Patch5: allow-numpy-1.24.patch BuildRequires: %{python_module devel >= 3.7} BuildRequires: %{python_module numpy-devel >= %{min_numpy_ver} with %python-numpy-devel < %{max_numpy_ver}} -BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: python-rpm-macros @@ -117,14 +118,11 @@ rm numba/tests/test_typedlist.py # sed -i -e '/check_testsuite_size/ s/5000/3000/' numba/tests/test_runtests.py %build -%if !%{with test} export CFLAGS="%{optflags} -fPIC" -%python_build -%endif +%pyproject_wheel %install -%if !%{with test} -%python_install +%pyproject_install %{python_expand # %fdupes %{buildroot}%{$python_sitearch} find %{buildroot}%{$python_sitearch} -name '*.[ch]' > devel-files0-%{$python_bin_suffix}.files @@ -134,7 +132,6 @@ sed 's|^%{buildroot}|%%exclude |' devel-files0-%{$python_bin_suffix}.files > dev %python_clone -a %{buildroot}%{_bindir}/numba %python_clone -a %{buildroot}%{_bindir}/pycc -%endif %check %if %{with test} @@ -142,12 +139,16 @@ sed 's|^%{buildroot}|%%exclude |' devel-files0-%{$python_bin_suffix}.files > dev mkdir emptytestdir pushd emptytestdir %{python_expand # numbatests: check specific tests with `osc build -M test --define="numbatests "` -%{_bindir}/numba-%{$python_bin_suffix} -s -$python -m numba.runtests -v -b --exclude-tags='long_running' -m %{_smp_build_ncpus} -- %{?!numbatests:numba.tests}%{?numbatests} +# %%{_bindir}/numba-%%{$python_bin_suffix} -s +export PYTHONPATH=%{buildroot}%{$python_sitearch} +$python ../runtests.py -v -b --exclude-tags=long_running -m %%{_smp_build_ncpus} -- %%{?!numbatests:numba.tests}%%{?numbatests} +# $python -m numba.runtests -v -b --exclude-tags='long_running' -m %%{_smp_build_ncpus} -- %%{?!numbatests:numba.tests}%%{?numbatests} } popd %endif +%clean + %if !%{with test} %post %python_install_alternative numba pycc @@ -161,7 +162,7 @@ popd %python_alternative %{_bindir}/numba %python_alternative %{_bindir}/pycc %{python_sitearch}/numba/ -%{python_sitearch}/numba-%{version}-py*.egg-info +%{python_sitearch}/numba-%{version}*-info %files %{python_files devel} -f devel-files-%{python_bin_suffix}.files %license LICENSE From 1f5d040253ec05462d8e52420726fbffe35ce7210d43e161e95027a4984a5fd4 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 3 Jan 2023 07:39:21 +0000 Subject: [PATCH 3/4] Accepting request 1046394 from home:bnavigator:branches:devel:languages:python:numeric - Clean up the specfile * restore the multibuild * Patch allow-numpy-1.24.patch is the WIP gh#numba/numba#8620 OBS-URL: https://build.opensuse.org/request/show/1046394 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-numba?expand=0&rev=61 --- python-numba.changes | 7 +++++++ python-numba.spec | 21 +++++++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/python-numba.changes b/python-numba.changes index 269cb3b..7c5deda 100644 --- a/python-numba.changes +++ b/python-numba.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Jan 2 21:27:24 UTC 2023 - Ben Greiner + +- Clean up the specfile + * restore the multibuild + * Patch allow-numpy-1.24.patch is the WIP gh#numba/numba#8620 + ------------------------------------------------------------------- Sun Jan 1 11:41:11 UTC 2023 - Matej Cepl diff --git a/python-numba.spec b/python-numba.spec index 1b15e6a..605e8ea 100644 --- a/python-numba.spec +++ b/python-numba.spec @@ -16,8 +16,8 @@ # -%{?!python_module:%define python_module() python3-%{**}} %define skip_python2 1 +%define skip_python311 1 %define plainpython python # upper bound is exclusive: min-numpy_ver <= numpy < max_numpy_ver %define min_numpy_ver 1.18 @@ -36,18 +36,20 @@ Release: 0 Summary: NumPy-aware optimizing compiler for Python using LLVM License: BSD-2-Clause URL: https://numba.pydata.org/ +# SourceRepository: https://github.com/numba/numba Source: https://files.pythonhosted.org/packages/source/n/numba/numba-%{version}.tar.gz # PATCH-FIX-OPENSUSE skip tests failing due to OBS specifics Patch2: fix-cli-test.patch Patch3: skip-failing-tests.patch # PATCH-FIX-OPENSUSE update-tbb-backend-calls-2021.6.patch, based on gh#numba/numba#7608 Patch4: update-tbb-backend-calls-2021.6.patch -# PATCH-FIX-UPSTREAM allow-numpy-1.24.patch bsc#[0-9]+ mcepl@suse.com +# PATCH-FIX-UPSTREAM allow-numpy-1.24.patch gh#numba/numba#8620 # Allow working with numpy 1.24 and higher Patch5: allow-numpy-1.24.patch BuildRequires: %{python_module devel >= 3.7} BuildRequires: %{python_module numpy-devel >= %{min_numpy_ver} with %python-numpy-devel < %{max_numpy_ver}} BuildRequires: %{python_module pip} +BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: gcc-c++ @@ -118,10 +120,13 @@ rm numba/tests/test_typedlist.py # sed -i -e '/check_testsuite_size/ s/5000/3000/' numba/tests/test_runtests.py %build +%if !%{with test} export CFLAGS="%{optflags} -fPIC" %pyproject_wheel +%endif %install +%if !%{with test} %pyproject_install %{python_expand # %fdupes %{buildroot}%{$python_sitearch} @@ -129,9 +134,9 @@ find %{buildroot}%{$python_sitearch} -name '*.[ch]' > devel-files0-%{$python_bin sed 's|^%{buildroot}||' devel-files0-%{$python_bin_suffix}.files > devel-files-%{$python_bin_suffix}.files sed 's|^%{buildroot}|%%exclude |' devel-files0-%{$python_bin_suffix}.files > devel-files-exclude-%{$python_bin_suffix}.files } - %python_clone -a %{buildroot}%{_bindir}/numba %python_clone -a %{buildroot}%{_bindir}/pycc +%endif %check %if %{with test} @@ -139,16 +144,12 @@ sed 's|^%{buildroot}|%%exclude |' devel-files0-%{$python_bin_suffix}.files > dev mkdir emptytestdir pushd emptytestdir %{python_expand # numbatests: check specific tests with `osc build -M test --define="numbatests "` -# %%{_bindir}/numba-%%{$python_bin_suffix} -s -export PYTHONPATH=%{buildroot}%{$python_sitearch} -$python ../runtests.py -v -b --exclude-tags=long_running -m %%{_smp_build_ncpus} -- %%{?!numbatests:numba.tests}%%{?numbatests} -# $python -m numba.runtests -v -b --exclude-tags='long_running' -m %%{_smp_build_ncpus} -- %%{?!numbatests:numba.tests}%%{?numbatests} +%{_bindir}/numba-%%{$python_bin_suffix} -s +$python -m numba.runtests -v -b --exclude-tags='long_running' -m %{_smp_build_ncpus} -- %{?!numbatests:numba.tests}%{?numbatests} } popd %endif -%clean - %if !%{with test} %post %python_install_alternative numba pycc @@ -162,7 +163,7 @@ popd %python_alternative %{_bindir}/numba %python_alternative %{_bindir}/pycc %{python_sitearch}/numba/ -%{python_sitearch}/numba-%{version}*-info +%{python_sitearch}/numba-%{version}.dist-info %files %{python_files devel} -f devel-files-%{python_bin_suffix}.files %license LICENSE From e18eb501ab442bed3b41c0a7a288db2b358d78e58df2e000d027c397cfe07212 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 3 Jan 2023 18:24:04 +0000 Subject: [PATCH 4/4] Accepting request 1046565 from home:bnavigator:branches:devel:languages:python:numeric - Split out python flavors into testing multibuilds. Depending on the obs worker, the test suite can take almost an hour per flavor. - Replace allow-numpy-1.24.patch with an updated numba-pr8620-np1.24.patch to also work with still present numpy 1.23 in Factory (discussed upstream in gh#numba/numba#8620) - Merge fix-cli-test.patch into skip-failing-tests.patch OBS-URL: https://build.opensuse.org/request/show/1046565 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-numba?expand=0&rev=62 --- _multibuild | 4 +- fix-cli-test.patch | 12 -- ...py-1.24.patch => numba-pr8620-np1.24.patch | 113 +++++++++--------- python-numba.changes | 11 ++ python-numba.spec | 36 ++++-- skip-failing-tests.patch | 12 ++ 6 files changed, 109 insertions(+), 79 deletions(-) delete mode 100644 fix-cli-test.patch rename allow-numpy-1.24.patch => numba-pr8620-np1.24.patch (86%) diff --git a/_multibuild b/_multibuild index fcc7b97..73ab5e8 100644 --- a/_multibuild +++ b/_multibuild @@ -1,3 +1,5 @@ - test + test-py38 + test-py39 + test-py310 diff --git a/fix-cli-test.patch b/fix-cli-test.patch deleted file mode 100644 index 884119d..0000000 --- a/fix-cli-test.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: numba-0.56.2/numba/tests/test_cli.py -=================================================================== ---- numba-0.56.2.orig/numba/tests/test_cli.py -+++ numba-0.56.2/numba/tests/test_cli.py -@@ -264,6 +264,7 @@ class TestGDBCLIInfoBrokenGdbs(TestCase) - self.assertIn("No such file or directory", stdout) - self.assertIn(path, stdout) - -+ @unittest.skip("Fails on type check in OBS") - def test_nonsense_gdb_binary(self): - # Tests that a nonsense binary specified as gdb it picked up ok - env = os.environ.copy() diff --git a/allow-numpy-1.24.patch b/numba-pr8620-np1.24.patch similarity index 86% rename from allow-numpy-1.24.patch rename to numba-pr8620-np1.24.patch index ac587a5..2100f9a 100644 --- a/allow-numpy-1.24.patch +++ b/numba-pr8620-np1.24.patch @@ -1,32 +1,7 @@ ---- - numba/__init__.py | 4 - - numba/cuda/tests/cudapy/test_intrinsics.py | 4 - - numba/np/arraymath.py | 6 ++ - numba/np/ufunc/_internal.c | 25 +++++------ - numba/stencils/stencilparfor.py | 7 ++- - numba/tests/test_array_methods.py | 15 ++----- - numba/tests/test_comprehension.py | 2 - numba/tests/test_linalg.py | 61 +++++++++++++++-------------- - numba/tests/test_mathlib.py | 2 - numba/tests/test_np_functions.py | 12 +++-- - setup.py | 2 - 11 files changed, 75 insertions(+), 65 deletions(-) - ---- a/numba/__init__.py -+++ b/numba/__init__.py -@@ -142,8 +142,8 @@ def _ensure_critical_deps(): - - if numpy_version < (1, 18): - raise ImportError("Numba needs NumPy 1.18 or greater") -- elif numpy_version > (1, 23): -- raise ImportError("Numba needs NumPy 1.23 or less") -+ elif numpy_version > (1, 24): -+ raise ImportError("Numba needs NumPy 1.24 or less") - - try: - import scipy ---- a/numba/cuda/tests/cudapy/test_intrinsics.py -+++ b/numba/cuda/tests/cudapy/test_intrinsics.py +Index: numba-0.56.4/numba/cuda/tests/cudapy/test_intrinsics.py +=================================================================== +--- numba-0.56.4.orig/numba/cuda/tests/cudapy/test_intrinsics.py ++++ numba-0.56.4/numba/cuda/tests/cudapy/test_intrinsics.py @@ -619,7 +619,7 @@ class TestCudaIntrinsic(CUDATestCase): arg2 = np.float16(4.) compiled[1, 1](ary, arg1, arg2) @@ -45,8 +20,10 @@ compiled[1, 1](ary, arg1, arg2) np.testing.assert_allclose(ary[0], arg2) ---- a/numba/np/arraymath.py -+++ b/numba/np/arraymath.py +Index: numba-0.56.4/numba/np/arraymath.py +=================================================================== +--- numba-0.56.4.orig/numba/np/arraymath.py ++++ numba-0.56.4/numba/np/arraymath.py @@ -4177,6 +4177,10 @@ iinfo = namedtuple('iinfo', _iinfo_suppo # This module is imported under the compiler lock which should deal with the # lack of thread safety in the warning filter. @@ -58,17 +35,10 @@ np122plus = numpy_version >= (1, 22) w = None with warnings.catch_warnings(record=True) as w: -@@ -4203,7 +4207,7 @@ def _gen_np_machar(): - return impl - - --_gen_np_machar() -+# _gen_np_machar() - - - def generate_xinfo(np_func, container, attr): ---- a/numba/np/ufunc/_internal.c -+++ b/numba/np/ufunc/_internal.c +Index: numba-0.56.4/numba/np/ufunc/_internal.c +=================================================================== +--- numba-0.56.4.orig/numba/np/ufunc/_internal.c ++++ numba-0.56.4/numba/np/ufunc/_internal.c @@ -285,9 +285,7 @@ static struct _ufunc_dispatch { PyCFunctionWithKeywords ufunc_accumulate; PyCFunctionWithKeywords ufunc_reduceat; @@ -179,8 +149,10 @@ ) return MOD_ERROR_VAL; ---- a/numba/stencils/stencilparfor.py -+++ b/numba/stencils/stencilparfor.py +Index: numba-0.56.4/numba/stencils/stencilparfor.py +=================================================================== +--- numba-0.56.4.orig/numba/stencils/stencilparfor.py ++++ numba-0.56.4/numba/stencils/stencilparfor.py @@ -21,6 +21,7 @@ from numba.core.ir_utils import (get_cal find_callname, require, find_const, GuardException) from numba.core.errors import NumbaValueError @@ -202,8 +174,10 @@ dtype_attr_var = ir.Var(scope, mk_unique_var("$np_attr_attr"), loc) self.typemap[dtype_attr_var.name] = types.functions.NumberClass(return_type.dtype) dtype_attr_assign = ir.Assign(dtype_np_attr_call, dtype_attr_var, loc) ---- a/numba/tests/test_array_methods.py -+++ b/numba/tests/test_array_methods.py +Index: numba-0.56.4/numba/tests/test_array_methods.py +=================================================================== +--- numba-0.56.4.orig/numba/tests/test_array_methods.py ++++ numba-0.56.4/numba/tests/test_array_methods.py @@ -1193,7 +1193,7 @@ class TestArrayMethods(MemoryLeakMixin, pyfunc = array_sum_dtype_kws cfunc = jit(nopython=True)(pyfunc) @@ -253,8 +227,10 @@ for arr_list in all_test_arrays: for arr in arr_list: ---- a/numba/tests/test_comprehension.py -+++ b/numba/tests/test_comprehension.py +Index: numba-0.56.4/numba/tests/test_comprehension.py +=================================================================== +--- numba-0.56.4.orig/numba/tests/test_comprehension.py ++++ numba-0.56.4/numba/tests/test_comprehension.py @@ -11,6 +11,7 @@ from numba import jit, typed from numba.core import types, utils from numba.core.errors import TypingError, LoweringError @@ -271,8 +247,10 @@ def test_comp_nest_with_dependency(self): def comp_nest_with_dependency(n): l = np.array([[i * j for j in range(i+1)] for i in range(n)]) ---- a/numba/tests/test_linalg.py -+++ b/numba/tests/test_linalg.py +Index: numba-0.56.4/numba/tests/test_linalg.py +=================================================================== +--- numba-0.56.4.orig/numba/tests/test_linalg.py ++++ numba-0.56.4/numba/tests/test_linalg.py @@ -1122,6 +1122,32 @@ class TestLinalgSvd(TestLinalgBase): Tests for np.linalg.svd. """ @@ -356,8 +334,10 @@ class TestLinalgQr(TestLinalgBase): ---- a/numba/tests/test_mathlib.py -+++ b/numba/tests/test_mathlib.py +Index: numba-0.56.4/numba/tests/test_mathlib.py +=================================================================== +--- numba-0.56.4.orig/numba/tests/test_mathlib.py ++++ numba-0.56.4/numba/tests/test_mathlib.py @@ -516,7 +516,7 @@ class TestMathLib(TestCase): with warnings.catch_warnings(): warnings.simplefilter("error", RuntimeWarning) @@ -367,8 +347,10 @@ naive_hypot, val, val) def test_hypot_npm(self): ---- a/numba/tests/test_np_functions.py -+++ b/numba/tests/test_np_functions.py +Index: numba-0.56.4/numba/tests/test_np_functions.py +=================================================================== +--- numba-0.56.4.orig/numba/tests/test_np_functions.py ++++ numba-0.56.4/numba/tests/test_np_functions.py @@ -932,11 +932,11 @@ class TestNPFunctions(MemoryLeakMixin, T yield np.inf, None yield np.PINF, None @@ -403,14 +385,31 @@ @TestCase.run_test_in_subprocess def test_np_MachAr_deprecation_np122(self): # Tests that Numba is replaying the NumPy 1.22 deprecation warning ---- a/setup.py -+++ b/setup.py +Index: numba-0.56.4/setup.py +=================================================================== +--- numba-0.56.4.orig/setup.py ++++ numba-0.56.4/setup.py @@ -23,7 +23,7 @@ min_python_version = "3.7" max_python_version = "3.11" # exclusive min_numpy_build_version = "1.11" min_numpy_run_version = "1.18" -max_numpy_run_version = "1.24" -+max_numpy_run_version = "1.25" ++max_numpy_run_version = "1.25" # exclusive min_llvmlite_version = "0.39.0dev0" max_llvmlite_version = "0.40" +Index: numba-0.56.4/numba/__init__.py +=================================================================== +--- numba-0.56.4.orig/numba/__init__.py ++++ numba-0.56.4/numba/__init__.py +@@ -142,8 +142,8 @@ def _ensure_critical_deps(): + + if numpy_version < (1, 18): + raise ImportError("Numba needs NumPy 1.18 or greater") +- elif numpy_version > (1, 23): +- raise ImportError("Numba needs NumPy 1.23 or less") ++ elif numpy_version > (1, 24): ++ raise ImportError("Numba needs NumPy 1.24 or less") + + try: + import scipy diff --git a/python-numba.changes b/python-numba.changes index 7c5deda..c3dc482 100644 --- a/python-numba.changes +++ b/python-numba.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Tue Jan 3 12:13:00 UTC 2023 - Ben Greiner + +- Split out python flavors into testing multibuilds. Depending on + the obs worker, the test suite can take almost an hour per + flavor. +- Replace allow-numpy-1.24.patch with an updated + numba-pr8620-np1.24.patch to also work with still present numpy + 1.23 in Factory (discussed upstream in gh#numba/numba#8620) +- Merge fix-cli-test.patch into skip-failing-tests.patch + ------------------------------------------------------------------- Mon Jan 2 21:27:24 UTC 2023 - Ben Greiner diff --git a/python-numba.spec b/python-numba.spec index 605e8ea..679f0ba 100644 --- a/python-numba.spec +++ b/python-numba.spec @@ -17,20 +17,40 @@ %define skip_python2 1 +# Not compatible with Python 3.11 yet. If this changes, and the python311 +# flavor is active, make sure to expand the multibuild test flavors +# https://github.com/numba/numba/issues/8304 %define skip_python311 1 %define plainpython python # upper bound is exclusive: min-numpy_ver <= numpy < max_numpy_ver %define min_numpy_ver 1.18 %define max_numpy_ver 1.25 + %global flavor @BUILD_FLAVOR@%{nil} -%if "%{flavor}" == "test" -%define psuffix -test -%bcond_without test -%else +%if "%{flavor}" == "" %define psuffix %{nil} %bcond_with test %endif -Name: python-numba%{psuffix} +%if "%{flavor}" == "test-py38" +%define psuffix -test-py38 +%define skip_python39 1 +%define skip_python310 1 +%bcond_without test +%endif +%if "%{flavor}" == "test-py39" +%define psuffix -test-py39 +%define skip_python38 1 +%define skip_python310 1 +%bcond_without test +%endif +%if "%{flavor}" == "test-py310" +%define psuffix -test-py310 +%define skip_python38 1 +%define skip_python39 1 +%bcond_without test +%endif + +Name: python-numba%{?psuffix} Version: 0.56.4 Release: 0 Summary: NumPy-aware optimizing compiler for Python using LLVM @@ -38,14 +58,12 @@ License: BSD-2-Clause URL: https://numba.pydata.org/ # SourceRepository: https://github.com/numba/numba Source: https://files.pythonhosted.org/packages/source/n/numba/numba-%{version}.tar.gz +# PATCH-FIX-UPSTREAM numba-pr8620-np1.24.patch gh#numba/numba#8620 + raising upper bound in setup.py and numba/__init__.py +Patch1: numba-pr8620-np1.24.patch # PATCH-FIX-OPENSUSE skip tests failing due to OBS specifics -Patch2: fix-cli-test.patch Patch3: skip-failing-tests.patch # PATCH-FIX-OPENSUSE update-tbb-backend-calls-2021.6.patch, based on gh#numba/numba#7608 Patch4: update-tbb-backend-calls-2021.6.patch -# PATCH-FIX-UPSTREAM allow-numpy-1.24.patch gh#numba/numba#8620 -# Allow working with numpy 1.24 and higher -Patch5: allow-numpy-1.24.patch BuildRequires: %{python_module devel >= 3.7} BuildRequires: %{python_module numpy-devel >= %{min_numpy_ver} with %python-numpy-devel < %{max_numpy_ver}} BuildRequires: %{python_module pip} diff --git a/skip-failing-tests.patch b/skip-failing-tests.patch index 96e6cb6..1e72984 100644 --- a/skip-failing-tests.patch +++ b/skip-failing-tests.patch @@ -41,3 +41,15 @@ def test_init_prange(self): def test_impl(): n = 20 +Index: numba-0.56.2/numba/tests/test_cli.py +=================================================================== +--- numba-0.56.2.orig/numba/tests/test_cli.py ++++ numba-0.56.2/numba/tests/test_cli.py +@@ -264,6 +264,7 @@ class TestGDBCLIInfoBrokenGdbs(TestCase) + self.assertIn("No such file or directory", stdout) + self.assertIn(path, stdout) + ++ @unittest.skip("Fails on type check in OBS") + def test_nonsense_gdb_binary(self): + # Tests that a nonsense binary specified as gdb it picked up ok + env = os.environ.copy()