From e9755ee4f9669c01e3ba214ffcb2a635d391fc8ca099eeddce20e43c1cde3540 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 12 Oct 2018 15:06:02 +0000 Subject: [PATCH] Remove valuerror-typerror-failing-tests.patch and replace it with proper patch (https://github.com/tacaswell/h5py/commit/6653c65e8c8d0.patch) in adjust_mapping_hdf5_error_codes.patch. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-h5py?expand=0&rev=9 --- adjust_mapping_hdf5_error_codes.patch | 30 ++++++++++++++++++++++++++ python-h5py.changes | 7 ++++++ python-h5py.spec | 2 +- valuerror-typerror-failing-tests.patch | 22 ------------------- 4 files changed, 38 insertions(+), 23 deletions(-) create mode 100644 adjust_mapping_hdf5_error_codes.patch delete mode 100644 valuerror-typerror-failing-tests.patch diff --git a/adjust_mapping_hdf5_error_codes.patch b/adjust_mapping_hdf5_error_codes.patch new file mode 100644 index 0000000..6d56a77 --- /dev/null +++ b/adjust_mapping_hdf5_error_codes.patch @@ -0,0 +1,30 @@ +From 6653c65e8c8d024bbcf50315a1c5201487632322 Mon Sep 17 00:00:00 2001 +From: Thomas A Caswell +Date: Thu, 11 Oct 2018 23:39:29 -0400 +Subject: [PATCH] FIX: adjust mapping of hdf5 error codes -> python error codes + +This is to account for changes to hdf5 between 1.10.2 and 1.10.3. + +Closes #1088 +--- + h5py/_errors.pyx | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/h5py/_errors.pyx b/h5py/_errors.pyx +index 76801f4f..23849f49 100644 +--- a/h5py/_errors.pyx ++++ b/h5py/_errors.pyx +@@ -73,6 +73,13 @@ _exact_table = { + (H5E_SYM, H5E_CANTINIT): ValueError, # Object already exists/1.8 + (H5E_ARGS, H5E_BADTYPE): ValueError, # Invalid location in file + (H5E_REFERENCE, H5E_CANTINIT): ValueError, # Dereferencing invalid ref ++ ++ # needed for 1.10.3 to maintain compatibility with 1.10.{0,1,2} ++ ++ # due to changes to H5Gdeprec.c:H5Gget_num_objs ++ (H5E_SYM, H5E_BADTYPE): ValueError, # Invalid location in file ++ # due to changes to H5F.c:H5Fstart_swmr_write ++ (H5E_FILE, H5E_CANTCONVERT): ValueError, # Invalid file format + } + + cdef struct err_data_t: diff --git a/python-h5py.changes b/python-h5py.changes index b8b6820..f8c0ebc 100644 --- a/python-h5py.changes +++ b/python-h5py.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Oct 12 15:00:53 UTC 2018 - Matej Cepl + +- Remove valuerror-typerror-failing-tests.patch and replace it with + proper patch (https://github.com/tacaswell/h5py/commit/6653c65e8c8d0.patch) + in adjust_mapping_hdf5_error_codes.patch. + ------------------------------------------------------------------- Thu Oct 11 16:34:58 UTC 2018 - Todd R diff --git a/python-h5py.spec b/python-h5py.spec index 47eb7e4..97af19a 100644 --- a/python-h5py.spec +++ b/python-h5py.spec @@ -32,7 +32,7 @@ Patch0: no_include_opt.patch Patch1: remove_unittest2.patch #PATCH-FIX-UPSTREAM valuerror-typerror-failing-tests.patch mcepl@suse.cz # https://github.com/h5py/h5py/issues/1088 -Patch2: valuerror-typerror-failing-tests.patch +Patch2: adjust_mapping_hdf5_error_codes.patch BuildRequires: %{python_module Cython >= 0.23} BuildRequires: %{python_module devel} BuildRequires: %{python_module numpy-devel >= 1.7} diff --git a/valuerror-typerror-failing-tests.patch b/valuerror-typerror-failing-tests.patch deleted file mode 100644 index c197002..0000000 --- a/valuerror-typerror-failing-tests.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/h5py/tests/hl/test_dataset_swmr.py -+++ b/h5py/tests/hl/test_dataset_swmr.py -@@ -71,7 +71,7 @@ class TestDatasetSwmrRead(TestCase): - def test_force_swmr_mode_on_raises(self): - """ Verify when reading a file cannot be forcibly switched to swmr mode. - When reading with SWMR the file must be opened with swmr=True.""" -- with self.assertRaises(ValueError): -+ with self.assertRaises((ValueError, TypeError)): - self.f.swmr_mode = True - self.assertTrue(self.f.swmr_mode) - ---- a/h5py/tests/old/test_group.py -+++ b/h5py/tests/old/test_group.py -@@ -298,7 +298,7 @@ class TestLen(BaseMapping): - def test_exc(self): - """ len() on closed group gives ValueError """ - self.f.close() -- with self.assertRaises(ValueError): -+ with self.assertRaises((ValueError, TypeError)): - len(self.f) - - class TestContains(BaseGroup):