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()