From 9356b0d3346ddf07a4cc6722f25ff55f1be2e5601e73782827d25fd6006eb296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 16 Mar 2020 10:42:42 +0000 Subject: [PATCH] - Fix build without python2 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-imageio?expand=0&rev=15 --- python-imageio.changes | 5 +++++ python-imageio.spec | 43 ++++++++++++++++++++---------------------- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/python-imageio.changes b/python-imageio.changes index bb90c64..69c5675 100644 --- a/python-imageio.changes +++ b/python-imageio.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Mar 16 10:42:13 UTC 2020 - Tomáš Chvátal + +- Fix build without python2 + ------------------------------------------------------------------- Wed Apr 17 15:16:25 UTC 2019 - Todd R diff --git a/python-imageio.spec b/python-imageio.spec index f3bb6be..8deb5ac 100644 --- a/python-imageio.spec +++ b/python-imageio.spec @@ -1,7 +1,7 @@ # # spec file for package python-imageio # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,32 +17,36 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%bcond_without python2 Name: python-imageio Version: 2.5.0 Release: 0 Summary: Python library for reading and writing image, video, and related formats License: BSD-2-Clause -Group: Development/Languages/Python -URL: http://imageio.github.io/ +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 setuptools} -BuildRequires: fdupes -BuildRequires: python-rpm-macros -Requires: python-numpy -Recommends: python-Pillow -Recommends: libfreeimageplus3 -%ifpython3 -Requires: python-imageio-ffmpeg -%endif -BuildArch: noarch -# There are many other optional dependencies, but they are skipped anyway BuildRequires: %{python_module Pillow} BuildRequires: %{python_module numpy} BuildRequires: %{python_module psutil} BuildRequires: %{python_module pytest} -BuildRequires: python-enum34 +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros BuildRequires: python3-imageio-ffmpeg +Requires: python-numpy +Recommends: libfreeimageplus3 +Recommends: python-Pillow +BuildArch: noarch +%ifpython3 +Requires: python-imageio-ffmpeg +%endif +%if %{with python2} +BuildRequires: python-enum34 +%endif +%ifpython2 +Requires: python-enum34 +%endif %python_subpackages %description @@ -69,15 +73,8 @@ export IMAGEIO_NO_INTERNET=1 %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -pushd tests export IMAGEIO_NO_INTERNET=1 -PYTHONPATH=%{buildroot}%{python2_sitelib} python2 -m pytest -k 'not test_fei_file_fail and not test_ffmpeg' -%if %{python3_version_nodots} == 37 -PYTHONPATH=%{buildroot}%{python3_sitelib} python3 -m pytest -k 'not test_series_unclosed and not test_import_dependencies and not test_ffmpeg' -%else -PYTHONPATH=%{buildroot}%{python3_sitelib} python3 -m pytest -k 'not test_import_dependencies and not test_ffmpeg' -%endif -popd +%pytest -k "not test_fei_file_fail and not test_ffmpeg and not test_series_unclosed and not test_import_dependencies" %files %{python_files} %license LICENSE