From 2704467ddf831e9f840c47e5369a186b964a82f070896daa0b114c63cef294c3 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 10 Jan 2022 17:36:04 +0000 Subject: [PATCH] Accepting request 945125 from home:bnavigator:branches:devel:languages:python:numeric - Numba <0.55 is not compatible with Python 3.10 or NumPy 1.22 gh#numba/numba#7557 - Add test skip to numba-pr7483-numpy1_21.patch due to numpy update gh#numpy/numpy#20376 OBS-URL: https://build.opensuse.org/request/show/945125 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-numba?expand=0&rev=50 --- numba-pr7483-numpy1_21.patch | 26 +++++++++++++++++++------- python-numba.changes | 8 ++++++++ python-numba.spec | 14 ++++++++------ 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/numba-pr7483-numpy1_21.patch b/numba-pr7483-numpy1_21.patch index a4eca7d..e24fcbf 100644 --- a/numba-pr7483-numpy1_21.patch +++ b/numba-pr7483-numpy1_21.patch @@ -79,7 +79,7 @@ Index: numba-0.54.1/numba/np/ufunc/_internal.c =================================================================== --- numba-0.54.1.orig/numba/np/ufunc/_internal.c +++ numba-0.54.1/numba/np/ufunc/_internal.c -@@ -275,6 +275,7 @@ static PyMemberDef dufunc_members[] = { +@@ -276,6 +276,7 @@ static PyMemberDef dufunc_members[] = { */ static struct _ufunc_dispatch { @@ -87,7 +87,7 @@ Index: numba-0.54.1/numba/np/ufunc/_internal.c PyCFunctionWithKeywords ufunc_reduce; PyCFunctionWithKeywords ufunc_accumulate; PyCFunctionWithKeywords ufunc_reduceat; -@@ -285,7 +286,7 @@ static struct _ufunc_dispatch { +@@ -286,7 +287,7 @@ static struct _ufunc_dispatch { } ufunc_dispatch; static int @@ -96,7 +96,7 @@ Index: numba-0.54.1/numba/np/ufunc/_internal.c { int result = 0; PyMethodDef * crnt = PyUFunc_Type.tp_methods; -@@ -328,6 +329,16 @@ init_ufunc_dispatch(void) +@@ -329,6 +330,16 @@ init_ufunc_dispatch(void) result = -1; /* Unknown method */ } if (result < 0) break; @@ -113,7 +113,7 @@ Index: numba-0.54.1/numba/np/ufunc/_internal.c } if (result == 0) { /* Sanity check. */ -@@ -343,6 +354,7 @@ init_ufunc_dispatch(void) +@@ -344,6 +355,7 @@ init_ufunc_dispatch(void) return result; } @@ -121,7 +121,7 @@ Index: numba-0.54.1/numba/np/ufunc/_internal.c static PyObject * dufunc_reduce(PyDUFuncObject * self, PyObject * args, PyObject *kws) { -@@ -367,6 +379,47 @@ dufunc_outer(PyDUFuncObject * self, PyOb +@@ -368,6 +380,47 @@ dufunc_outer(PyDUFuncObject * self, PyOb return ufunc_dispatch.ufunc_outer((PyObject*)self->ufunc, args, kws); } @@ -169,7 +169,7 @@ Index: numba-0.54.1/numba/np/ufunc/_internal.c #if NPY_API_VERSION >= 0x00000008 static PyObject * dufunc_at(PyDUFuncObject * self, PyObject * args) -@@ -567,6 +620,41 @@ static struct PyMethodDef dufunc_methods +@@ -568,6 +621,41 @@ static struct PyMethodDef dufunc_methods {NULL, NULL, 0, NULL} /* sentinel */ }; @@ -211,7 +211,7 @@ Index: numba-0.54.1/numba/np/ufunc/_internal.c static PyObject * dufunc_getfrozen(PyDUFuncObject * self, void * closure) { -@@ -680,8 +768,15 @@ MOD_INIT(_internal) +@@ -681,8 +769,15 @@ MOD_INIT(_internal) return MOD_ERROR_VAL; PyDUFunc_Type.tp_new = PyType_GenericNew; @@ -228,3 +228,15 @@ Index: numba-0.54.1/numba/np/ufunc/_internal.c if (PyType_Ready(&PyDUFunc_Type) < 0) return MOD_ERROR_VAL; Py_INCREF(&PyDUFunc_Type); +Index: numba-0.54.1/numba/tests/test_array_reductions.py +=================================================================== +--- numba-0.54.1.orig/numba/tests/test_array_reductions.py ++++ numba-0.54.1/numba/tests/test_array_reductions.py +@@ -725,6 +725,7 @@ class TestArrayReductions(MemoryLeakMixi + self.check_npdatetime(array_argmax) + self.check_nptimedelta(array_argmax) + ++ @unittest.skip("https://github.com/numpy/numpy/issues/20376") + def test_median_npdatetime(self): + self.check_nptimedelta(array_median_global) + diff --git a/python-numba.changes b/python-numba.changes index 9f59813..97f81e1 100644 --- a/python-numba.changes +++ b/python-numba.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Sat Jan 8 22:19:07 UTC 2022 - Ben Greiner + +- Numba <0.55 is not compatible with Python 3.10 or NumPy 1.22 + gh#numba/numba#7557 +- Add test skip to numba-pr7483-numpy1_21.patch due to numpy update + gh#numpy/numpy#20376 + ------------------------------------------------------------------- Thu Nov 18 18:42:21 UTC 2021 - Ben Greiner diff --git a/python-numba.spec b/python-numba.spec index 8c279d0..35a4004 100644 --- a/python-numba.spec +++ b/python-numba.spec @@ -1,7 +1,7 @@ # # spec file # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,8 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 -%define skip_python36 1 +%define skip_python310 1 +%define plainpython python %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "test" %define psuffix -test @@ -36,12 +37,12 @@ URL: https://numba.pydata.org/ Source: https://files.pythonhosted.org/packages/source/n/numba/numba-%{version}.tar.gz # PATCH-FIX-UPSTREAM fix-max-name-size.patch -- fix for gh#numba/numba#3876 -- from gh#numba/numba#4373 Patch0: fix-max-name-size.patch -# PATCH-FIX-UPSTREAM support numpy 1.21 -- gh#numba/numba#7176, gh#numba/numba#7483 +# PATCH-FIX-UPSTREAM support numpy 1.21 -- gh#numba/numba#7176, gh#numba/numba#7483, gh#numpy/numpy#20376 Patch1: numba-pr7483-numpy1_21.patch # PATCH-FIX-OPENSUSE skip tests failing due to OBS specifics Patch3: skip-failing-tests.patch -BuildRequires: %{python_module devel >= 3.7} -BuildRequires: %{python_module numpy-devel >= 1.18} +BuildRequires: %{python_module devel >= 3.7 with %python-devel < 3.10} +BuildRequires: %{python_module numpy-devel >= 1.18 with %python-numpy-devel < 1.22} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: gcc-c++ @@ -49,8 +50,8 @@ BuildRequires: python-rpm-macros BuildRequires: tbb-devel >= 2021 Requires: python-llvmlite < 0.38 Requires: python-llvmlite >= 0.37 -Requires: python-numpy >= 1.18 Requires: python-scipy >= 0.16 +Requires: (python-numpy >= 1.18 with python-numpy < 1.22) Requires(post): update-alternatives Requires(preun):update-alternatives Recommends: python-Jinja2 @@ -95,6 +96,7 @@ Summary: Development files for numba applications Requires: %{name} = %{version} Requires: python-devel Requires: python-numpy-devel >= 1.11 +Requires: %{plainpython}(abi) = %{python_version} %description devel This package contains files for developing applications using numba.