Hello community, here is the log from the commit of package python-h5py for openSUSE:Factory checked in at 2018-02-27 16:59:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-h5py (Old) and /work/SRC/openSUSE:Factory/.python-h5py.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-h5py" Tue Feb 27 16:59:25 2018 rev:7 rq:580312 version:2.7.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-h5py/python-h5py.changes 2017-11-14 13:06:59.793504735 +0100 +++ /work/SRC/openSUSE:Factory/.python-h5py.new/python-h5py.changes 2018-02-27 16:59:49.379998600 +0100 @@ -1,0 +2,8 @@ +Thu Jan 25 22:04:22 UTC 2018 - toddrme2...@gmail.com + +- Add dont_reorder_compund.patch + Fixes builds with numpy 1.14. See: + https://github.com/h5py/h5py/issues/969 + https://github.com/h5py/h5py/pull/970 + +------------------------------------------------------------------- New: ---- dont_reorder_compund.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-h5py.spec ++++++ --- /var/tmp/diff_new_pack.zAJMZx/_old 2018-02-27 16:59:50.335964060 +0100 +++ /var/tmp/diff_new_pack.zAJMZx/_new 2018-02-27 16:59:50.339963915 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-h5py # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,29 +17,35 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%bcond_without test Name: python-h5py Version: 2.7.1 Release: 0 Summary: Python interface to the Hierarchical Data Format library License: BSD-3-Clause Group: Development/Libraries/Python -Url: http://www.h5py.org/ +Url: https://github.com/h5py/h5py Source: https://files.pythonhosted.org/packages/source/h/h5py/h5py-%{version}.tar.gz #PATCH-FIX-OPENSUSE no_include_opt.patch -- Don't include /opt/ directory. Patch0: no_include_opt.patch -BuildRequires: %{python_module Cython} +#PATCH-FIX-UPSTREAM dont_reorder_compund.patch -- Don't reorder compound types, breaks on numpy 1.14. https://github.com/h5py/h5py/issues/969, https://github.com/h5py/h5py/pull/970 +Patch1: dont_reorder_compund.patch +BuildRequires: %{python_module Cython >= 0.23} BuildRequires: %{python_module devel} -BuildRequires: %{python_module numpy-devel >= 1.6.1} +BuildRequires: %{python_module numpy-devel >= 1.7} BuildRequires: %{python_module pkgconfig} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six} BuildRequires: fdupes BuildRequires: hdf5-devel BuildRequires: python-rpm-macros +%if %{with test} +BuildRequires: python-unittest2 +%endif Requires: hdf5 -Requires: python-numpy >= 1.6.1 +Requires: python-numpy >= 1.7 Requires: python-six -BuildRoot: %{_tmppath}/%{name}-%{version}-build + %python_subpackages %description @@ -52,6 +58,7 @@ %prep %setup -q -n h5py-%{version} %patch0 -p1 +%patch1 -p1 %build export CFLAGS="%{optflags}" @@ -61,9 +68,11 @@ %python_install %python_expand %fdupes %{buildroot}%{$python_sitearch} +%if %{with test} %check export CFLAGS="%{optflags}" %python_exec setup.py test +%endif %post /sbin/ldconfig ++++++ dont_reorder_compund.patch ++++++ >From 5009e062a6f7d4e074cab0fcb42a780ac2b1d7d4 Mon Sep 17 00:00:00 2001 From: James Tocknell <aragi...@gmail.com> Date: Thu, 28 Dec 2017 20:55:55 +1100 Subject: [PATCH] FIX: Don't reorder compound types, breaks on numpy 1.14 --- h5py/h5t.pyx | 25 +++++++------------------ setup.py | 2 +- tox.ini | 4 ++-- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/h5py/h5t.pyx b/h5py/h5t.pyx index cc2344e1..7445e9eb 100644 --- a/h5py/h5t.pyx +++ b/h5py/h5t.pyx @@ -1136,12 +1136,6 @@ cdef class TypeCompoundID(TypeCompositeID): else: if sys.version[0] == '3': field_names = [x.decode('utf8') for x in field_names] - if len(field_names) > 0: - collated_fields = zip(field_names, field_types, field_offsets) - ordered_fields = sorted( - collated_fields, key=operator.itemgetter(2)) - field_names, field_types, field_offsets = \ - map(list, zip(*ordered_fields)) typeobj = dtype({ 'names': field_names, 'formats': field_types, @@ -1458,8 +1452,7 @@ cdef TypeCompoundID _c_compound(dtype dt, int logical, int aligned): cdef dtype member_dt cdef size_t member_offset = 0 - cdef dict offsets = {} - cdef list fields = [] + cdef dict fields = {} # The challenge with correctly converting a numpy/h5py dtype to a HDF5 type # which is composed of subtypes has three aspects we must consider @@ -1468,19 +1461,14 @@ cdef TypeCompoundID _c_compound(dtype dt, int logical, int aligned): # 2. For correct round-tripping of aligned dtypes, we need to consider how # much padding we need by looking at the field offsets # 3. There is no requirement that the offsets be monotonically increasing - # (so we start by sorting the names as a function of increasing offset) # # The code below tries to cover these aspects - # Get offsets for each compound member - for name, field in dt.fields.items(): - offsets[name] = field[1] - # Build list of names, offsets, and types, sorted by increasing offset # (i.e. the position of the member in the struct) - for name in sorted(dt.names, key=offsets.__getitem__): + for name in sorted(dt.names, key=(lambda n: dt.fields[n][1])): field = dt.fields[name] - name = name.encode('utf8') if isinstance(name, unicode) else name + h5_name = name.encode('utf8') if isinstance(name, unicode) else name # Get HDF5 data types and set the offset for each member member_dt = field[0] @@ -1489,7 +1477,7 @@ cdef TypeCompoundID _c_compound(dtype dt, int logical, int aligned): if aligned and (member_offset > field[1] or member_dt.itemsize != member_type.get_size()): raise TypeError("Enforced alignment not compatible with HDF5 type") - fields.append((name, member_offset, member_type)) + fields[name] = (h5_name, member_offset, member_type) # Update member offset based on the HDF5 type size member_offset += member_type.get_size() @@ -1500,8 +1488,9 @@ cdef TypeCompoundID _c_compound(dtype dt, int logical, int aligned): # Create compound with the necessary size, and insert its members tid = H5Tcreate(H5T_COMPOUND, member_offset) - for (name, member_offset, member_type) in fields: - H5Tinsert(tid, name, member_offset, member_type.id) + for name in dt.names: + h5_name, member_offset, member_type = fields[name] + H5Tinsert(tid, h5_name, member_offset, member_type.id) return TypeCompoundID(tid) diff --git a/setup.py b/setup.py index ec2a78a7..bbb086f6 100755 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ # these are required to build h5py # RUN_REQUIRES is included as setup.py test needs RUN_REQUIRES for testing # RUN_REQUIRES can be removed when setup.py test is removed -SETUP_REQUIRES = RUN_REQUIRES + [NUMPY_DEP, 'Cython>=0.19', 'pkgconfig'] +SETUP_REQUIRES = RUN_REQUIRES + [NUMPY_DEP, 'Cython>=0.23', 'pkgconfig'] # Needed to avoid trying to install numpy/cython on pythons which the latest # versions don't support diff --git a/tox.ini b/tox.ini index 764da697..8cf546d7 100644 --- a/tox.ini +++ b/tox.ini @@ -4,9 +4,9 @@ [testenv] deps = deps: numpy>=1.7 - deps: cython>=0.19 + deps: cython>=0.23 mindeps: numpy==1.7 - mindeps: cython==0.19 + mindeps: cython==0.23 commands = test: python {toxinidir}/ci/fix_paths.py {envsitepackagesdir} test: python -c "from sys import exit; import h5py; exit(0) if h5py.run_tests().wasSuccessful() else exit(1)"