From 76fe35019e8cc06f7a89629103e5671832eb93c1fe47753e051ca587746de1ed Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 21 Nov 2023 06:59:22 +0000 Subject: [PATCH] Accepting request 1127715 from home:mcalabkova:branches:devel:languages:python:numeric - Update to 0.58.1 * Added towncrier * The minimum supported NumPy version is 1.22. * Add support for NumPy 1.26 * Remove NVVM 3.4 and CTK 11.0 / 11.1 support * Removal of Windows 32-bit Support * The minimum llvmlite version is now 0.41.0. * Added RVSDG-frontend - Drop merged patches: * numba-pr9105-np1.25.patch * multiprocessing-context.patch OBS-URL: https://build.opensuse.org/request/show/1127715 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-numba?expand=0&rev=75 --- multiprocessing-context.patch | 61 ---- numba-0.57.1.tar.gz | 3 - numba-0.58.1.tar.gz | 3 + numba-pr9105-np1.25.patch | 555 ---------------------------------- python-numba.changes | 15 + python-numba.spec | 14 +- 6 files changed, 23 insertions(+), 628 deletions(-) delete mode 100644 multiprocessing-context.patch delete mode 100644 numba-0.57.1.tar.gz create mode 100644 numba-0.58.1.tar.gz delete mode 100644 numba-pr9105-np1.25.patch diff --git a/multiprocessing-context.patch b/multiprocessing-context.patch deleted file mode 100644 index dc8177f..0000000 --- a/multiprocessing-context.patch +++ /dev/null @@ -1,61 +0,0 @@ -From c59e46a177bf7134dec3a9a374ec75aec4576e31 Mon Sep 17 00:00:00 2001 -From: Stuart Archibald -Date: Thu, 7 Sep 2023 17:03:56 +0100 -Subject: [PATCH] Fix issue with incompatible multiprocessing context in test. - -This fixes an issue highlighted by a patch added to Python 3.11.5 -which identifies if a semaphore created via one multiprocessing -context is in use by another (doing this is essentially a bug). ---- - numba/tests/test_parallel_backend.py | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/numba/tests/test_parallel_backend.py b/numba/tests/test_parallel_backend.py -index b1bee4fa94e..db64b6971e4 100644 ---- a/numba/tests/test_parallel_backend.py -+++ b/numba/tests/test_parallel_backend.py -@@ -819,13 +819,13 @@ def test_par_parent_explicit_mp_fork_par_child(self): - body = """if 1: - X = np.arange(1000000.) - Y = np.arange(1000000.) -- q = multiprocessing.Queue() -+ ctx = multiprocessing.get_context('fork') -+ q = ctx.Queue() - - # Start OpenMP runtime on parent via parallel function - Z = busy_func(X, Y, q) - - # fork() underneath with no exec, will abort -- ctx = multiprocessing.get_context('fork') - proc = ctx.Process(target = busy_func, args=(X, Y, q)) - proc.start() - proc.join() -@@ -851,12 +851,12 @@ def test_par_parent_mp_spawn_par_child_par_parent(self): - body = """if 1: - X = np.arange(1000000.) - Y = np.arange(1000000.) -- q = multiprocessing.Queue() -+ ctx = multiprocessing.get_context('spawn') -+ q = ctx.Queue() - - # Start OpenMP runtime and run on parent via parallel function - Z = busy_func(X, Y, q) - procs = [] -- ctx = multiprocessing.get_context('spawn') - for x in range(20): # start a lot to try and get overlap - ## fork() + exec() to run some OpenMP on children - proc = ctx.Process(target = busy_func, args=(X, Y, q)) -@@ -937,11 +937,11 @@ def test_serial_parent_explicit_mp_fork_par_child_then_par_parent(self): - body = """if 1: - X = np.arange(1000000.) - Y = np.arange(1000000.) -- q = multiprocessing.Queue() -+ ctx = multiprocessing.get_context('fork') -+ q = ctx.Queue() - - # this is ok - procs = [] -- ctx = multiprocessing.get_context('fork') - for x in range(10): - # fork() underneath with but no OpenMP in parent, this is ok - proc = ctx.Process(target = busy_func, args=(X, Y, q)) diff --git a/numba-0.57.1.tar.gz b/numba-0.57.1.tar.gz deleted file mode 100644 index 5df5fb8..0000000 --- a/numba-0.57.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:33c0500170d213e66d90558ad6aca57d3e03e97bb11da82e6d87ab793648cb17 -size 2552795 diff --git a/numba-0.58.1.tar.gz b/numba-0.58.1.tar.gz new file mode 100644 index 0000000..01b7560 --- /dev/null +++ b/numba-0.58.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:487ded0633efccd9ca3a46364b40006dbdaca0f95e99b8b83e778d1195ebcbaa +size 2623830 diff --git a/numba-pr9105-np1.25.patch b/numba-pr9105-np1.25.patch deleted file mode 100644 index 7b232ef..0000000 --- a/numba-pr9105-np1.25.patch +++ /dev/null @@ -1,555 +0,0 @@ -Index: numba-0.57.1/docs/source/user/installing.rst -=================================================================== ---- numba-0.57.1.orig/docs/source/user/installing.rst -+++ numba-0.57.1/docs/source/user/installing.rst -@@ -262,6 +262,8 @@ information. - +----------++--------------+---------------------------+----------------------------+------------------------------+-------------------+-----------------------------+ - | Numba | Release date | Python | NumPy | llvmlite | LLVM | TBB | - +===========+==============+===========================+============================+==============================+===================+=============================+ -+| 0.58.0 | UNRELEASED | 3.8.x <= version < 3.12 | 1.21 <= version < 1.26 | 0.41.x | 14.x | 2021.6 <= version | -++-----------+--------------+---------------------------+----------------------------+------------------------------+-------------------+-----------------------------+ - | 0.57.1 | 2023-06-21 | 3.8.x <= version < 3.12 | 1.21 <= version < 1.25 | 0.40.x | 14.x | 2021.6 <= version | - +-----------+--------------+---------------------------+----------------------------+------------------------------+-------------------+-----------------------------+ - | 0.57.0 | 2023-05-01 | 3.8.x <= version < 3.12 | 1.21 <= version < 1.25 | 0.40.x | 14.x | 2021.6 <= version | -Index: numba-0.57.1/docs/upcoming_changes/9011.np_support.rst -=================================================================== ---- /dev/null -+++ numba-0.57.1/docs/upcoming_changes/9011.np_support.rst -@@ -0,0 +1,5 @@ -+ -+Add support for NumPy 1.25 -+========================== -+ -+Extend Numba to support new and changed features released in NumPy 1.25. -Index: numba-0.57.1/numba/core/typing/npdatetime.py -=================================================================== ---- numba-0.57.1.orig/numba/core/typing/npdatetime.py -+++ numba-0.57.1/numba/core/typing/npdatetime.py -@@ -11,6 +11,7 @@ from numba.core.typing.templates import - AbstractTemplate, infer_global, infer, - infer_getattr, signature) - from numba.np import npdatetime_helpers -+from numba.np.numpy_support import numpy_version - - - # timedelta64-only operations -@@ -144,13 +145,22 @@ class TimedeltaTrueDiv(TimedeltaDivOp): - class TimedeltaFloorDiv(TimedeltaDivOp): - key = operator.floordiv - --@infer_global(operator.eq) --class TimedeltaCmpEq(TimedeltaCmpOp): -- key = operator.eq -- --@infer_global(operator.ne) --class TimedeltaCmpNe(TimedeltaCmpOp): -- key = operator.ne -+if numpy_version >= (1, 25): -+ @infer_global(operator.eq) -+ class TimedeltaCmpEq(TimedeltaOrderedCmpOp): -+ key = operator.eq -+ -+ @infer_global(operator.ne) -+ class TimedeltaCmpNe(TimedeltaOrderedCmpOp): -+ key = operator.ne -+else: -+ @infer_global(operator.eq) -+ class TimedeltaCmpEq(TimedeltaCmpOp): -+ key = operator.eq -+ -+ @infer_global(operator.ne) -+ class TimedeltaCmpNe(TimedeltaCmpOp): -+ key = operator.ne - - @infer_global(operator.lt) - class TimedeltaCmpLt(TimedeltaOrderedCmpOp): -@@ -228,7 +238,6 @@ class DatetimeMinusDatetime(AbstractTemp - left, right = args - if isinstance(left, types.NPDatetime) and isinstance(right, - types.NPDatetime): -- # All units compatible... - unit = npdatetime_helpers.get_best_unit(left.unit, right.unit) - return signature(types.NPTimedelta(unit), left, right) - -Index: numba-0.57.1/numba/cpython/numbers.py -=================================================================== ---- numba-0.57.1.orig/numba/cpython/numbers.py -+++ numba-0.57.1/numba/cpython/numbers.py -@@ -361,6 +361,38 @@ def int_ne_impl(context, builder, sig, a - return impl_ret_untracked(context, builder, sig.return_type, res) - - -+def int_signed_unsigned_cmp(op): -+ def impl(context, builder, sig, args): -+ (left, right) = args -+ # This code is translated from the NumPy source. -+ # What we're going to do is divide the range of a signed value at zero. -+ # If the signed value is less than zero, then we can treat zero as the -+ # unsigned value since the unsigned value is necessarily zero or larger -+ # and any signed comparison between a negative value and zero/infinity -+ # will yield the same result. If the signed value is greater than or -+ # equal to zero, then we can safely cast it to an unsigned value and do -+ # the expected unsigned-unsigned comparison operation. -+ # Original: https://github.com/numpy/numpy/pull/23713 -+ cmp_zero = builder.icmp_signed('<', left, Constant(left.type, 0)) -+ lt_zero = builder.icmp_signed(op, left, Constant(left.type, 0)) -+ ge_zero = builder.icmp_unsigned(op, left, right) -+ res = builder.select(cmp_zero, lt_zero, ge_zero) -+ return impl_ret_untracked(context, builder, sig.return_type, res) -+ return impl -+ -+ -+def int_unsigned_signed_cmp(op): -+ def impl(context, builder, sig, args): -+ (left, right) = args -+ # See the function `int_signed_unsigned_cmp` for implementation notes. -+ cmp_zero = builder.icmp_signed('<', right, Constant(right.type, 0)) -+ lt_zero = builder.icmp_signed(op, Constant(right.type, 0), right) -+ ge_zero = builder.icmp_unsigned(op, left, right) -+ res = builder.select(cmp_zero, lt_zero, ge_zero) -+ return impl_ret_untracked(context, builder, sig.return_type, res) -+ return impl -+ -+ - def int_abs_impl(context, builder, sig, args): - [x] = args - ZERO = Constant(x.type, None) -Index: numba-0.57.1/numba/cuda/tests/cudapy/test_gufunc.py -=================================================================== ---- numba-0.57.1.orig/numba/cuda/tests/cudapy/test_gufunc.py -+++ numba-0.57.1/numba/cuda/tests/cudapy/test_gufunc.py -@@ -1,5 +1,4 @@ - import numpy as np --import numpy.core.umath_tests as ut - - from collections import namedtuple - from numba import void, int32, float32, float64 -@@ -42,7 +41,7 @@ class TestCUDAGufunc(CUDATestCase): - 5) - - C = gufunc(A, B) -- Gold = ut.matrix_multiply(A, B) -+ Gold = np.matmul(A, B) - self.assertTrue(np.allclose(C, Gold)) - - def test_gufunc_auto_transfer(self): -@@ -58,7 +57,7 @@ class TestCUDAGufunc(CUDATestCase): - dB = cuda.to_device(B) - - C = gufunc(A, dB).copy_to_host() -- Gold = ut.matrix_multiply(A, B) -+ Gold = np.matmul(A, B) - self.assertTrue(np.allclose(C, Gold)) - - def test_gufunc(self): -@@ -72,7 +71,7 @@ class TestCUDAGufunc(CUDATestCase): - 5) - - C = gufunc(A, B) -- Gold = ut.matrix_multiply(A, B) -+ Gold = np.matmul(A, B) - self.assertTrue(np.allclose(C, Gold)) - - def test_gufunc_hidim(self): -@@ -84,7 +83,7 @@ class TestCUDAGufunc(CUDATestCase): - B = np.arange(matrix_ct * 4 * 5, dtype=np.float32).reshape(4, 25, 4, 5) - - C = gufunc(A, B) -- Gold = ut.matrix_multiply(A, B) -+ Gold = np.matmul(A, B) - self.assertTrue(np.allclose(C, Gold)) - - def test_gufunc_new_axis(self): -@@ -94,7 +93,7 @@ class TestCUDAGufunc(CUDATestCase): - X = np.random.randn(10, 3, 3) - Y = np.random.randn(3, 3) - -- gold = ut.matrix_multiply(X, Y) -+ gold = np.matmul(X, Y) - - res1 = gufunc(X, Y) - np.testing.assert_allclose(gold, res1) -@@ -122,7 +121,7 @@ class TestCUDAGufunc(CUDATestCase): - C = dC.copy_to_host(stream=stream) - stream.synchronize() - -- Gold = ut.matrix_multiply(A, B) -+ Gold = np.matmul(A, B) - - self.assertTrue(np.allclose(C, Gold)) - -Index: numba-0.57.1/numba/cuda/ufuncs.py -=================================================================== ---- numba-0.57.1.orig/numba/cuda/ufuncs.py -+++ numba-0.57.1/numba/cuda/ufuncs.py -@@ -25,6 +25,7 @@ def ufunc_db(): - from numba.np.npyfuncs import _check_arity_and_homogeneity - from numba.np.npyfuncs import (np_complex_acosh_impl, np_complex_cos_impl, - np_complex_sin_impl) -+ from numba.np.numpy_support import numpy_version - - def np_unary_impl(fn, context, builder, sig, args): - _check_arity_and_homogeneity(sig, args, 1) -@@ -269,6 +270,10 @@ def ufunc_db(): - 'f->f': mathimpl.degrees_float_impl, - 'd->d': mathimpl.degrees_float_impl, - } -+ if numpy_version >= (1, 25): -+ db[np.greater].update({ -+ 'qQ->?': numbers.int_signed_unsigned_cmp('>'), -+ 'Qq->?': numbers.int_unsigned_signed_cmp('>')}) - - db[np.degrees] = db[np.rad2deg] - -Index: numba-0.57.1/numba/np/arraymath.py -=================================================================== ---- numba-0.57.1.orig/numba/np/arraymath.py -+++ numba-0.57.1/numba/np/arraymath.py -@@ -490,6 +490,7 @@ def return_false(a): - - - @overload(np.min) -+@overload(np.amin) - @overload_method(types.Array, "min") - def npy_min(a): - if not isinstance(a, types.Array): -@@ -539,6 +540,7 @@ def npy_min(a): - - - @overload(np.max) -+@overload(np.amax) - @overload_method(types.Array, "max") - def npy_max(a): - if not isinstance(a, types.Array): -@@ -3124,6 +3126,7 @@ def round_ndigits(x, ndigits): - - @overload(np.around) - @overload(np.round) -+@overload(np.round_) - def impl_np_round(a, decimals=0, out=None): - if not type_can_asarray(a): - raise TypingError('The argument "a" must be array-like') -Index: numba-0.57.1/numba/np/ufunc_db.py -=================================================================== ---- numba-0.57.1.orig/numba/np/ufunc_db.py -+++ numba-0.57.1/numba/np/ufunc_db.py -@@ -620,6 +620,10 @@ def _fill_ufunc_db(ufunc_db): - 'FF->?': npyfuncs.np_complex_gt_impl, - 'DD->?': npyfuncs.np_complex_gt_impl, - } -+ if numpy_version >= (1, 25): -+ ufunc_db[np.greater].update({ -+ 'qQ->?': numbers.int_signed_unsigned_cmp('>'), -+ 'Qq->?': numbers.int_unsigned_signed_cmp('>')}) - - ufunc_db[np.greater_equal] = { - '??->?': numbers.int_uge_impl, -@@ -638,6 +642,10 @@ def _fill_ufunc_db(ufunc_db): - 'FF->?': npyfuncs.np_complex_ge_impl, - 'DD->?': npyfuncs.np_complex_ge_impl, - } -+ if numpy_version >= (1, 25): -+ ufunc_db[np.greater_equal].update({ -+ 'qQ->?': numbers.int_signed_unsigned_cmp('>='), -+ 'Qq->?': numbers.int_unsigned_signed_cmp('>=')}) - - ufunc_db[np.less] = { - '??->?': numbers.int_ult_impl, -@@ -656,6 +664,10 @@ def _fill_ufunc_db(ufunc_db): - 'FF->?': npyfuncs.np_complex_lt_impl, - 'DD->?': npyfuncs.np_complex_lt_impl, - } -+ if numpy_version >= (1, 25): -+ ufunc_db[np.less].update({ -+ 'qQ->?': numbers.int_signed_unsigned_cmp('<'), -+ 'Qq->?': numbers.int_unsigned_signed_cmp('<')}) - - ufunc_db[np.less_equal] = { - '??->?': numbers.int_ule_impl, -@@ -674,6 +686,10 @@ def _fill_ufunc_db(ufunc_db): - 'FF->?': npyfuncs.np_complex_le_impl, - 'DD->?': npyfuncs.np_complex_le_impl, - } -+ if numpy_version >= (1, 25): -+ ufunc_db[np.less_equal].update({ -+ 'qQ->?': numbers.int_signed_unsigned_cmp('<='), -+ 'Qq->?': numbers.int_unsigned_signed_cmp('<=')}) - - ufunc_db[np.not_equal] = { - '??->?': numbers.int_ne_impl, -@@ -692,6 +708,10 @@ def _fill_ufunc_db(ufunc_db): - 'FF->?': npyfuncs.np_complex_ne_impl, - 'DD->?': npyfuncs.np_complex_ne_impl, - } -+ if numpy_version >= (1, 25): -+ ufunc_db[np.not_equal].update({ -+ 'qQ->?': numbers.int_signed_unsigned_cmp('!='), -+ 'Qq->?': numbers.int_unsigned_signed_cmp('!=')}) - - ufunc_db[np.equal] = { - '??->?': numbers.int_eq_impl, -@@ -710,6 +730,10 @@ def _fill_ufunc_db(ufunc_db): - 'FF->?': npyfuncs.np_complex_eq_impl, - 'DD->?': npyfuncs.np_complex_eq_impl, - } -+ if numpy_version >= (1, 25): -+ ufunc_db[np.equal].update({ -+ 'qQ->?': numbers.int_signed_unsigned_cmp('=='), -+ 'Qq->?': numbers.int_unsigned_signed_cmp('==')}) - - ufunc_db[np.logical_and] = { - '??->?': npyfuncs.np_logical_and_impl, -Index: numba-0.57.1/numba/tests/npyufunc/test_gufunc.py -=================================================================== ---- numba-0.57.1.orig/numba/tests/npyufunc/test_gufunc.py -+++ numba-0.57.1/numba/tests/npyufunc/test_gufunc.py -@@ -2,7 +2,6 @@ import unittest - import pickle - - import numpy as np --import numpy.core.umath_tests as ut - - from numba import void, float32, int64, jit, guvectorize - from numba.np.ufunc import GUVectorize -@@ -33,7 +32,7 @@ class TestGUFunc(TestCase): - B = np.arange(matrix_ct * 4 * 5, dtype=np.float32).reshape(matrix_ct, 4, 5) - - C = gufunc(A, B) -- Gold = ut.matrix_multiply(A, B) -+ Gold = np.matmul(A, B) - - np.testing.assert_allclose(C, Gold, rtol=1e-5, atol=1e-8) - -@@ -108,7 +107,7 @@ class TestDynamicGUFunc(TestCase): - def test_dynamic_matmul(self): - - def check_matmul_gufunc(gufunc, A, B, C): -- Gold = ut.matrix_multiply(A, B) -+ Gold = np.matmul(A, B) - gufunc(A, B, C) - np.testing.assert_allclose(C, Gold, rtol=1e-5, atol=1e-8) - -Index: numba-0.57.1/numba/tests/test_array_methods.py -=================================================================== ---- numba-0.57.1.orig/numba/tests/test_array_methods.py -+++ numba-0.57.1/numba/tests/test_array_methods.py -@@ -31,6 +31,9 @@ def np_around_unary(val): - def np_round_array(arr, decimals, out): - np.round(arr, decimals, out) - -+def np_round__array(arr, decimals, out): -+ np.round_(arr, decimals, out) -+ - def np_round_binary(val, decimals): - return np.round(val, decimals) - -@@ -366,6 +369,9 @@ class TestArrayMethods(MemoryLeakMixin, - def test_around_array(self): - self.check_round_array(np_around_array) - -+ def test_round__array(self): -+ self.check_round_array(np_round__array) -+ - def test_around_bad_array(self): - for pyfunc in (np_round_unary, np_around_unary): - cfunc = jit(nopython=True)(pyfunc) -@@ -374,7 +380,7 @@ class TestArrayMethods(MemoryLeakMixin, - cfunc(None) - - def test_around_bad_out(self): -- for py_func in (np_round_array, np_around_array): -+ for py_func in (np_round_array, np_around_array, np_round__array): - cfunc = jit(nopython=True)(py_func) - msg = '.*The argument "out" must be an array if it is provided.*' - with self.assertRaisesRegex(TypingError, msg): -Index: numba-0.57.1/numba/tests/test_array_reductions.py -=================================================================== ---- numba-0.57.1.orig/numba/tests/test_array_reductions.py -+++ numba-0.57.1/numba/tests/test_array_reductions.py -@@ -75,12 +75,18 @@ def array_min(arr): - def array_min_global(arr): - return np.min(arr) - -+def array_amin(arr): -+ return np.amin(arr) -+ - def array_max(arr): - return arr.max() - - def array_max_global(arr): - return np.max(arr) - -+def array_amax(arr): -+ return np.amax(arr) -+ - def array_argmin(arr): - return arr.argmin() - -@@ -1110,6 +1116,7 @@ class TestArrayReductions(MemoryLeakMixi - array_all, array_all_global, - array_any, array_any_global, - array_min, array_min_global, -+ array_amax, array_amin, - array_max, array_max_global, - array_nanmax, array_nanmin, - array_nansum, -Index: numba-0.57.1/numba/tests/test_fancy_indexing.py -=================================================================== ---- numba-0.57.1.orig/numba/tests/test_fancy_indexing.py -+++ numba-0.57.1/numba/tests/test_fancy_indexing.py -@@ -406,7 +406,7 @@ class TestFancyIndexingMultiDim(MemoryLe - expected = get_item(arr, index) - got = numba_get_item(arr, index) - # Sanity check: In advanced indexing, the result is always a copy. -- self.assertNotIn(expected.base, orig_base) -+ self.assertIsNot(expected.base, orig_base) - - # Note: Numba may not return the same array strides and - # contiguity as NumPy -Index: numba-0.57.1/numba/tests/test_npdatetime.py -=================================================================== ---- numba-0.57.1.orig/numba/tests/test_npdatetime.py -+++ numba-0.57.1/numba/tests/test_npdatetime.py -@@ -411,10 +411,18 @@ class TestTimedeltaArithmetic(TestCase): - check(TD('Nat', 'ms'), TD('Nat', 's'), True) - check(TD('Nat'), TD(1), False) - # Incompatible units => timedeltas compare unequal -- check(TD(1, 'Y'), TD(365, 'D'), False) -- check(TD(1, 'Y'), TD(366, 'D'), False) -- # ... except when both are NaT! -- check(TD('NaT', 'W'), TD('NaT', 'D'), True) -+ if numpy_version < (1, 25): -+ check(TD(1, 'Y'), TD(365, 'D'), False) -+ check(TD(1, 'Y'), TD(366, 'D'), False) -+ # ... except when both are NaT! -+ check(TD('NaT', 'W'), TD('NaT', 'D'), True) -+ else: -+ # incompatible units raise -+ # The exception is different depending on Python mode -+ with self.assertRaises((TypeError, TypingError)): -+ eq(TD(1, 'Y'), TD(365, 'D')) -+ with self.assertRaises((TypeError, TypingError)): -+ ne(TD(1, 'Y'), TD(365, 'D')) - - def test_lt_ge(self): - lt = self.jit(lt_usecase) -Index: numba-0.57.1/numba/tests/test_ufuncs.py -=================================================================== ---- numba-0.57.1.orig/numba/tests/test_ufuncs.py -+++ numba-0.57.1/numba/tests/test_ufuncs.py -@@ -256,6 +256,56 @@ class BasicUFuncTest(BaseUFuncTest): - else: - raise - -+ def signed_unsigned_cmp_test(self, comparison_ufunc): -+ self.basic_ufunc_test(comparison_ufunc) -+ -+ if numpy_support.numpy_version < (1, 25): -+ return -+ -+ # Test additional implementations that specifically handle signed / -+ # unsigned comparisons added in NumPy 1.25: -+ # https://github.com/numpy/numpy/pull/23713 -+ additional_inputs = ( -+ (np.int64(-1), np.uint64(0)), -+ (np.int64(-1), np.uint64(1)), -+ (np.int64(0), np.uint64(0)), -+ (np.int64(0), np.uint64(1)), -+ (np.int64(1), np.uint64(0)), -+ (np.int64(1), np.uint64(1)), -+ -+ (np.uint64(0), np.int64(-1)), -+ (np.uint64(0), np.int64(0)), -+ (np.uint64(0), np.int64(1)), -+ (np.uint64(1), np.int64(-1)), -+ (np.uint64(1), np.int64(0)), -+ (np.uint64(1), np.int64(1)), -+ -+ (np.array([-1, -1, 0, 0, 1, 1], dtype=np.int64), -+ np.array([0, 1, 0, 1, 0, 1], dtype=np.uint64)), -+ -+ (np.array([0, 1, 0, 1, 0, 1], dtype=np.uint64), -+ np.array([-1, -1, 0, 0, 1, 1], dtype=np.int64)) -+ ) -+ -+ pyfunc = self._make_ufunc_usecase(comparison_ufunc) -+ -+ for a, b in additional_inputs: -+ input_types = (typeof(a), typeof(b)) -+ output_type = types.Array(types.bool_, 1, 'C') -+ argtys = input_types + (output_type,) -+ cfunc = self._compile(pyfunc, argtys) -+ -+ if isinstance(a, np.ndarray): -+ result = np.zeros(a.shape, dtype=np.bool_) -+ else: -+ result = np.zeros(1, dtype=np.bool_) -+ -+ expected = np.zeros_like(result) -+ -+ pyfunc(a, b, expected) -+ cfunc(a, b, result) -+ np.testing.assert_equal(expected, result) -+ - - class TestUFuncs(BasicUFuncTest, TestCase): - def basic_int_ufunc_test(self, name=None): -@@ -505,22 +555,22 @@ class TestUFuncs(BasicUFuncTest, TestCas - ############################################################################ - # Comparison functions - def test_greater_ufunc(self): -- self.basic_ufunc_test(np.greater) -+ self.signed_unsigned_cmp_test(np.greater) - - def test_greater_equal_ufunc(self): -- self.basic_ufunc_test(np.greater_equal) -+ self.signed_unsigned_cmp_test(np.greater_equal) - - def test_less_ufunc(self): -- self.basic_ufunc_test(np.less) -+ self.signed_unsigned_cmp_test(np.less) - - def test_less_equal_ufunc(self): -- self.basic_ufunc_test(np.less_equal) -+ self.signed_unsigned_cmp_test(np.less_equal) - - def test_not_equal_ufunc(self): -- self.basic_ufunc_test(np.not_equal) -+ self.signed_unsigned_cmp_test(np.not_equal) - - def test_equal_ufunc(self): -- self.basic_ufunc_test(np.equal) -+ self.signed_unsigned_cmp_test(np.equal) - - def test_logical_and_ufunc(self): - self.basic_ufunc_test(np.logical_and) -Index: numba-0.57.1/numba/__init__.py -=================================================================== ---- numba-0.57.1.orig/numba/__init__.py -+++ numba-0.57.1/numba/__init__.py -@@ -38,8 +38,9 @@ def _ensure_critical_deps(): - msg = (f"Numba needs NumPy 1.21 or greater. Got NumPy " - f"{numpy_version[0]}.{numpy_version[1]}.") - raise ImportError(msg) -- elif numpy_version > (1, 24): -- raise ImportError("Numba needs NumPy 1.24 or less") -+ elif numpy_version > (1, 25): -+ # https://github.com/numba/numba/pull/9138 -+ raise ImportError("Numba needs NumPy 1.25 or less") - try: - import scipy - except ImportError: -Index: numba-0.57.1/setup.py -=================================================================== ---- numba-0.57.1.orig/setup.py -+++ numba-0.57.1/setup.py -@@ -23,7 +23,8 @@ min_python_version = "3.8" - max_python_version = "3.12" # exclusive - min_numpy_build_version = "1.11" - min_numpy_run_version = "1.21" --max_numpy_run_version = "1.25" -+# https://github.com/numba/numba/pull/9138 -+max_numpy_run_version = "1.26" - min_llvmlite_version = "0.40.0dev0" - max_llvmlite_version = "0.41" - diff --git a/python-numba.changes b/python-numba.changes index a827487..6a7c554 100644 --- a/python-numba.changes +++ b/python-numba.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Mon Nov 20 12:15:07 UTC 2023 - Markéta Machová + +- Update to 0.58.1 + * Added towncrier + * The minimum supported NumPy version is 1.22. + * Add support for NumPy 1.26 + * Remove NVVM 3.4 and CTK 11.0 / 11.1 support + * Removal of Windows 32-bit Support + * The minimum llvmlite version is now 0.41.0. + * Added RVSDG-frontend +- Drop merged patches: + * numba-pr9105-np1.25.patch + * multiprocessing-context.patch + ------------------------------------------------------------------- Tue Sep 19 12:08:03 UTC 2023 - Markéta Machová diff --git a/python-numba.spec b/python-numba.spec index bdcb232..135601e 100644 --- a/python-numba.spec +++ b/python-numba.spec @@ -17,9 +17,9 @@ %define plainpython python -# upper bound is exclusive: min-numpy_ver <= numpy < max_numpy_ve -%define min_numpy_ver 1.21 -%define max_numpy_ver 1.26 +# upper bound is exclusive: min-numpy_ver <= numpy < max_numpy_ver +%define min_numpy_ver 1.22 +%define max_numpy_ver 1.27 %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "" @@ -46,19 +46,15 @@ %endif Name: python-numba%{?psuffix} -Version: 0.57.1 +Version: 0.58.1 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-UPSTREAM numba-pr9105-np1.25.patch gh#numba/numba#9105 -Patch0: numba-pr9105-np1.25.patch # PATCH-FIX-OPENSUSE skip tests failing due to OBS specifics Patch3: skip-failing-tests.patch -# PATCH-FIX-UPSTREAM https://github.com/numba/numba/commit/c59e46a177bf7134dec3a9a374ec75aec4576e31 Fix issue with incompatible multiprocessing context in test. -Patch4: multiprocessing-context.patch BuildRequires: %{python_module devel >= 3.8} BuildRequires: %{python_module numpy-devel >= %{min_numpy_ver} with %python-numpy-devel < %{max_numpy_ver}} BuildRequires: %{python_module pip} @@ -68,7 +64,7 @@ BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: python-rpm-macros BuildRequires: (tbb-devel >= 2021) -Requires: (python-llvmlite >= 0.40 with python-llvmlite < 0.41) +Requires: (python-llvmlite >= 0.41 with python-llvmlite < 0.42) Requires: (python-numpy >= %{min_numpy_ver} with python-numpy < %{max_numpy_ver}) Requires(post): update-alternatives Requires(postun):update-alternatives