Skip to content

Commit

Permalink
Update python-numba to version 0.54.1 / rev 30 via SR 945418
Browse files Browse the repository at this point in the history
https://build.opensuse.org/request/show/945418
by user mcepl + dimstar_suse
- 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
  • Loading branch information
mcepl authored and bmwiedemann committed Jan 10, 2022
1 parent 460389c commit 0cad20a
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 13 deletions.
Binary file modified packages/p/python-numba/.files
Binary file not shown.
12 changes: 12 additions & 0 deletions packages/p/python-numba/.rev
Expand Up @@ -242,4 +242,16 @@ Python2 support was turned off by accident. I don't go out of my way to support
<comment></comment>
<requestid>932339</requestid>
</revision>
<revision rev="30" vrev="2">
<srcmd5>e012d42d07430e35ca5b560771b0dedf</srcmd5>
<version>0.54.1</version>
<time>1641855235</time>
<user>dimstar_suse</user>
<comment>- Numba &lt;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
</comment>
<requestid>945418</requestid>
</revision>
</revisionlist>
26 changes: 19 additions & 7 deletions packages/p/python-numba/numba-pr7483-numpy1_21.patch
Expand Up @@ -79,15 +79,15 @@ 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 {
+ /* Note that the following may also hold `_PyCFunctionFastWithKeywords` */
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
Expand All @@ -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;
Expand All @@ -113,15 +113,15 @@ 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;
}

+
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);
}

Expand Down Expand Up @@ -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 */
};

Expand Down Expand Up @@ -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;
Expand All @@ -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)

8 changes: 8 additions & 0 deletions packages/p/python-numba/python-numba.changes
@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Sat Jan 8 22:19:07 UTC 2022 - Ben Greiner <code@bnavigator.de>

- 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 <code@bnavigator.de>

Expand Down
14 changes: 8 additions & 6 deletions packages/p/python-numba/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
Expand All @@ -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
Expand All @@ -36,21 +37,21 @@ 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++
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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 0cad20a

Please sign in to comment.