15
0
Files
python-imageio/python-imageio.spec
Matej Cepl 2d2cf96545 Accepting request 1096160 from home:mcalabkova:branches:devel:languages:python
- update to 2.31.1
  * Add support for Python 3.11
  * Tifffile v3 support
  * Add audio support for ffmpeg writer
  * small improvements to pyav
  * Consistently apply color palettes by default
  * Add n_images to ImageProperties
  * Expose v3 plugins via v2 API
  * Decode gray 16-bit PNG as uint16 (not int32) if pillow allows

OBS-URL: https://build.opensuse.org/request/show/1096160
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-imageio?expand=0&rev=28
2023-06-30 14:55:34 +00:00

118 lines
3.7 KiB
RPMSpec

#
# spec file for package python-imageio
#
# Copyright (c) 2023 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/
#
%{?!python_module:%define python_module() python3-%{**}}
%define skip_python2 1
%bcond_with test_extras
Name: python-imageio
Version: 2.31.1
Release: 0
Summary: Python library for reading and writing image, video, and related formats
License: BSD-2-Clause
URL: https://imageio.github.io/
Source0: https://files.pythonhosted.org/packages/source/i/imageio/imageio-%{version}.tar.gz
Source1: python-imageio-rpmlintrc
BuildRequires: %{python_module Pillow >= 8.3.2}
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module numpy >= 1.20.0}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-Pillow >= 8.3.2
Requires: python-numpy >= 1.20.0
Recommends: python-imageio-ffmpeg
Recommends: python-psutil
Suggests: python-astropy
Suggests: python-av
Suggests: python-tifffile
# not in openSUSE (yet)
Suggests: python-simpleitk
%if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3"
# GDAL is not (yet) singlespec
Suggests: python3-GDAL
%endif
Requires(post): update-alternatives
Requires(postun):update-alternatives
Recommends: libfreeimageplus3
# SECTION test requirements
BuildRequires: %{python_module fsspec}
BuildRequires: %{python_module imageio-ffmpeg}
BuildRequires: %{python_module pytest}
BuildRequires: libglvnd-devel
%if %{with test_extras}
BuildRequires: %{python_module astropy}
BuildRequires: %{python_module av}
BuildRequires: %{python_module psutil}
BuildRequires: %{python_module tifffile}
BuildRequires: python3-GDAL
%endif
# /SECTION
BuildArch: noarch
%python_subpackages
%description
Imageio is a Python library that provides an interface to read and
write a wide range of image data, including animated images, volumetric
data, and scientific formats.
%prep
%setup -q -n imageio-%{version}
# Plugins are not executable scripts
for plgpy in imageio/plugins/_*.py ; do
echo "Fixing $plgpy..."
sed -i -e '1{/\/usr\/bin.*python/d}' $plgpy
done
%build
export IMAGEIO_NO_INTERNET=1
%python_build
%install
export IMAGEIO_NO_INTERNET=1
%python_install
%python_clone -a %{buildroot}%{_bindir}/imageio_remove_bin
%python_clone -a %{buildroot}%{_bindir}/imageio_download_bin
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
export IMAGEIO_NO_INTERNET=1
# plain openSUSE does not have the right codecs to test this ffmpeg
donttest="test_ffmpeg or test_bayer_write"
# unmarked online tests
donttest="$donttest or test_freeimage"
%pytest -ra -k "not ($donttest)" -m "not needs_internet"
%post
%python_install_alternative imageio_remove_bin
%python_install_alternative imageio_download_bin
%postun
%python_uninstall_alternative imageio_remove_bin
%python_uninstall_alternative imageio_download_bin
%files %{python_files}
%license LICENSE
%doc CONTRIBUTORS.txt README.md
%{python_sitelib}/imageio
%{python_sitelib}/imageio-%{version}*-info
%python_alternative %{_bindir}/imageio_download_bin
%python_alternative %{_bindir}/imageio_remove_bin
%changelog