1
0

Accepting request 719706 from devel:languages:python:numeric

OBS-URL: https://build.opensuse.org/request/show/719706
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-nibabel?expand=0&rev=2
This commit is contained in:
Dominique Leuenberger 2019-07-30 10:39:09 +00:00 committed by Git OBS Bridge
commit f8b30fd84d
3 changed files with 32 additions and 0 deletions

23
fix_numpy_1_17.patch Normal file
View File

@ -0,0 +1,23 @@
From 86b4fbedfb6919fab4e3ffe21536c5df2633c57b Mon Sep 17 00:00:00 2001
From: "Christopher J. Markiewicz" <markiewicz@stanford.edu>
Date: Sat, 15 Jun 2019 14:28:04 +0200
Subject: [PATCH] FIX/TEST: Numpy casting rules have gotten more strict, raise
different exception
---
nibabel/tests/test_volumeutils.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/nibabel/tests/test_volumeutils.py b/nibabel/tests/test_volumeutils.py
index 06df9eb6a..fcdc5c271 100644
--- a/nibabel/tests/test_volumeutils.py
+++ b/nibabel/tests/test_volumeutils.py
@@ -700,7 +700,7 @@ def test_a2f_non_numeric():
# Some versions of numpy can cast structured types to float, others not
try:
arr.astype(float)
- except ValueError:
+ except (TypeError, ValueError):
pass
else:
back_arr = write_return(arr, fobj, float)

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Jul 29 18:56:10 UTC 2019 - Todd R <toddrme2178@gmail.com>
- Add fix_numpy_1_17.patch to fix building with numpy 1.17.0
From: gh#/nipy/nibabel#768
-------------------------------------------------------------------
Fri Jul 26 14:21:33 UTC 2019 - Todd R <toddrme2178@gmail.com>

View File

@ -24,6 +24,8 @@ Summary: Tool to access multiple neuroimaging data formats
Url: http://nipy.org/nibabel
Group: Development/Languages/Python
Source: https://files.pythonhosted.org/packages/source/n/nibabel/nibabel-%{version}.tar.gz
# PATCH-FIX-UPSTREAM fix_numpy_1_17.patch gh#/nipy/nibabel#768
Patch1: fix_numpy_1_17.patch
BuildRequires: %{python_module setuptools >= 30.3.0}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@ -54,6 +56,7 @@ very limited support for DICOM.
%prep
%setup -q -n nibabel-%{version}
%patch1 -p1
%build
%python_build