File python-hdf5plugin.spec of Package python-hdf5plugin

#
# spec file for package python-hdf5plugin
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%bcond_without systemlibs
Name:           python-hdf5plugin
Version:        4.4.0
Release:        0
Summary:        Compression filters for h5py
License:        BSD-2-Clause AND MIT AND BSD-3-Clause AND CC-BY-3.0 AND Zlib
URL:            https://github.com/silx-kit/hdf5plugin
Source:         https://files.pythonhosted.org/packages/source/h/hdf5plugin/hdf5plugin-%{version}.tar.gz
# PATCH-FIX-OPENSUSE hdf5plugin-system-libs.patch code@bnavigator.de -- debundle as much as we can, disable SSE3 and AVX512
Patch0:         hdf5plugin-system-libs.patch
# PATCH-FIX-UPSTREAM Fix warnings related to const for blosc_filter.c
Patch1:         hdf5plugin-fix-gcc14.patch
# PATCH-FIX-UPSTREAM gh#silx-kit/hdf5plugin#346343e8b63e6a7842d82130a48a16815dfe07bd
Patch2:         support-numpy-2.patch
BuildRequires:  %{python_module Cython}
BuildRequires:  %{python_module blosc2}
BuildRequires:  %{python_module h5py}
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module py-cpuinfo >= 8.0.0}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module wheel >= 0.34.0}
BuildRequires:  c++_compiler
BuildRequires:  fdupes
BuildRequires:  hdf5-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(blosc)
BuildRequires:  pkgconfig(blosc2)
BuildRequires:  pkgconfig(bzip2)
# Cannot unbundle charls: fcidecomp expects charls < 2 with interface.h
# BuildRequires:  pkgconfig(charls)
BuildRequires:  pkgconfig(libzstd)
BuildRequires:  python-rpm-macros
BuildRequires:  pkgconfig(liblz4)
BuildRequires:  pkgconfig(snappy)
BuildRequires:  pkgconfig(zlib)
Requires:       python-bitshuffle
Requires:       python-h5py
BuildArch:      noarch
%python_subpackages

%description
hdf5plugin provides HDF5 compression filters
(namely: Blosc, Blosc2, BitShuffle, BZip2, FciDecomp, LZ4, SZ, SZ3, Zfp, ZStd)
and makes them usable from h5py.

%prep
%autosetup -p1 -n hdf5plugin-%{version}
sed -i '1{/^#/d}' src/hdf5plugin/_version.py

%build
export CFLAGS="%{optflags}"
export HDF5PLUGIN_STRIP=all
%pyproject_wheel

%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%check
export PYTHONDONTWRITEBYTECODE=1
%{python_expand export PYTHONPATH=%{buildroot}/%{$python_sitelib}
$python test/test.py
}

%files %{python_files}
%doc CHANGELOG.rst README.rst
%license LICENSE
%{python_sitelib}/hdf5plugin
%{python_sitelib}/hdf5plugin-%{version}.dist-info

%changelog
openSUSE Build Service is sponsored by