2016-01-11 13:19:49 +00:00
|
|
|
#
|
|
|
|
|
# spec file for package python-imageio
|
|
|
|
|
#
|
2021-02-15 22:00:26 +00:00
|
|
|
# Copyright (c) 2021 SUSE LLC
|
2016-01-11 13:19:49 +00:00
|
|
|
#
|
|
|
|
|
# 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.
|
|
|
|
|
|
2018-12-04 13:33:56 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2016-01-11 13:19:49 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
2018-04-21 19:40:42 +00:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2020-04-09 14:06:50 +00:00
|
|
|
%define skip_python2 1
|
2021-02-15 22:00:26 +00:00
|
|
|
# NEP29: python36-numpy is no longer available in Tumbleweed, because NumPy 1.20 dropped support for it
|
|
|
|
|
%define skip_python36 1
|
|
|
|
|
%bcond_with test_extras
|
2016-01-11 13:19:49 +00:00
|
|
|
Name: python-imageio
|
2021-02-15 22:00:26 +00:00
|
|
|
Version: 2.9.0
|
2016-01-11 13:19:49 +00:00
|
|
|
Release: 0
|
2018-03-03 17:31:25 +00:00
|
|
|
Summary: Python library for reading and writing image, video, and related formats
|
2016-01-11 13:19:49 +00:00
|
|
|
License: BSD-2-Clause
|
2020-03-16 10:42:42 +00:00
|
|
|
URL: https://imageio.github.io/
|
2018-09-05 12:21:43 +00:00
|
|
|
Source0: https://files.pythonhosted.org/packages/source/i/imageio/imageio-%{version}.tar.gz
|
|
|
|
|
Source1: python-imageio-rpmlintrc
|
2020-03-16 10:42:42 +00:00
|
|
|
BuildRequires: %{python_module Pillow}
|
|
|
|
|
BuildRequires: %{python_module numpy}
|
|
|
|
|
BuildRequires: %{python_module psutil}
|
|
|
|
|
BuildRequires: %{python_module pytest}
|
2018-03-03 17:31:25 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
|
BuildRequires: fdupes
|
2017-05-17 16:27:34 +00:00
|
|
|
BuildRequires: python-rpm-macros
|
2020-04-09 14:06:50 +00:00
|
|
|
Requires: python-Pillow
|
2016-01-11 13:19:49 +00:00
|
|
|
Requires: python-numpy
|
2021-02-15 22:00:26 +00:00
|
|
|
Recommends: python-imageio-ffmpeg
|
|
|
|
|
Suggests: python-astropy
|
|
|
|
|
# not in openSUSE (yet)
|
|
|
|
|
Suggests: python-simpleitk
|
|
|
|
|
# alternative is not singlespec
|
|
|
|
|
Suggests: python3-itk
|
|
|
|
|
%if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3"
|
|
|
|
|
# GDAL is not (yet) singlespec
|
|
|
|
|
Suggests: python3-GDAL
|
|
|
|
|
%endif
|
2020-05-25 13:34:22 +00:00
|
|
|
Requires(post): update-alternatives
|
|
|
|
|
Requires(postun): update-alternatives
|
2016-01-11 13:19:49 +00:00
|
|
|
Recommends: libfreeimageplus3
|
2021-02-15 22:00:26 +00:00
|
|
|
%if %{with test_extras}
|
|
|
|
|
BuildRequires: %{python_module astropy}
|
|
|
|
|
BuildRequires: %{python_module imageio-ffmpeg}
|
|
|
|
|
# BuildRequires: %%{python_module simpleitk} # (non simple python3-itk does not work on 32-bit, don't bother testing that)
|
|
|
|
|
BuildRequires: python3-GDAL
|
|
|
|
|
%endif
|
2020-03-16 10:42:42 +00:00
|
|
|
BuildArch: noarch
|
2017-05-17 16:27:34 +00:00
|
|
|
%python_subpackages
|
2016-01-11 13:19:49 +00:00
|
|
|
|
|
|
|
|
%description
|
2018-03-03 17:31:25 +00:00
|
|
|
Imageio is a Python library that provides an interface to read and
|
2016-01-11 13:19:49 +00:00
|
|
|
write a wide range of image data, including animated images, volumetric
|
2017-05-17 16:27:34 +00:00
|
|
|
data, and scientific formats.
|
2016-01-11 13:19:49 +00:00
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q -n imageio-%{version}
|
|
|
|
|
|
2018-09-05 12:21:43 +00:00
|
|
|
# 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
|
|
|
|
|
|
2016-01-11 13:19:49 +00:00
|
|
|
%build
|
2017-05-17 16:27:34 +00:00
|
|
|
export IMAGEIO_NO_INTERNET=1
|
|
|
|
|
%python_build
|
2016-01-11 13:19:49 +00:00
|
|
|
|
|
|
|
|
%install
|
2017-05-17 16:27:34 +00:00
|
|
|
export IMAGEIO_NO_INTERNET=1
|
|
|
|
|
%python_install
|
2020-05-25 13:34:22 +00:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/imageio_remove_bin
|
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/imageio_download_bin
|
2017-05-17 16:27:34 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2016-01-11 13:19:49 +00:00
|
|
|
|
2017-05-17 16:27:34 +00:00
|
|
|
%check
|
2019-03-25 08:44:31 +00:00
|
|
|
export IMAGEIO_NO_INTERNET=1
|
2021-02-15 22:00:26 +00:00
|
|
|
# ffmpeg: plain openSUSE does not have the right codecs to test this"
|
|
|
|
|
donttest="test_ffmpeg"
|
|
|
|
|
%pytest -ra -k "not ($donttest)"
|
2016-01-11 13:19:49 +00:00
|
|
|
|
2020-05-25 13:34:22 +00:00
|
|
|
%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
|
|
|
|
|
|
2017-05-17 16:27:34 +00:00
|
|
|
%files %{python_files}
|
2018-04-21 19:40:42 +00:00
|
|
|
%license LICENSE
|
|
|
|
|
%doc CONTRIBUTORS.txt README.md
|
2016-01-11 13:19:49 +00:00
|
|
|
%{python_sitelib}/*
|
2020-05-25 13:34:22 +00:00
|
|
|
%python_alternative %{_bindir}/imageio_download_bin
|
|
|
|
|
%python_alternative %{_bindir}/imageio_remove_bin
|
2016-01-11 13:19:49 +00:00
|
|
|
|
|
|
|
|
%changelog
|