forked from pool/python-imagecodecs
Accepting request 1060173 from home:bnavigator:branches:devel:languages:python
- Update to 2022.12.24 * Pass 6512 tests. * Fix PNG codec error handling. * Fix truncated transferfunctions in cms_profile (#57). * Fix exceptions not raised in cdef functions not returning Python object. - Release 2022.12.22 * Require libtiff 4.5 (breaking). * Require libavif 0.11 (breaking). * Change jpegxl_encode level parameter to resemble libjpeg quality (breaking). * Add LZFSE codec via lzfse library. * Add LZHAM codec via lzham library. * Fix AttributeError in cms_profile (#52). * Support gamma argument in cms_profile (#53). * Raise limit of TIFF pages to 1048576. * Use libtiff thread-safe error/warning handlers. * Add option to specify filters and strategy in png_encode. * Add option to specify integrity check type in lzma_encode. * Fix DeprecationWarning with NumPy 1.24. OBS-URL: https://build.opensuse.org/request/show/1060173 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-imagecodecs?expand=0&rev=19
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-imagecodecs
|
||||
# spec file
|
||||
#
|
||||
# Copyright (c) 2022 SUSE LLC
|
||||
# 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
|
||||
@@ -16,7 +16,6 @@
|
||||
#
|
||||
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
%global flavor @BUILD_FLAVOR@%{nil}
|
||||
%if "%{flavor}" == "test"
|
||||
%define psuffix -test
|
||||
@@ -25,10 +24,9 @@
|
||||
%define psuffix %{nil}
|
||||
%bcond_with test
|
||||
%endif
|
||||
%define skip_python2 1
|
||||
%define skip_python36 1
|
||||
|
||||
Name: python-imagecodecs%{psuffix}
|
||||
Version: 2022.9.26
|
||||
Version: 2022.12.24
|
||||
Release: 0
|
||||
Summary: Image transformation, compression, and decompression codecs
|
||||
License: BSD-3-Clause
|
||||
@@ -37,12 +35,15 @@ Source: https://files.pythonhosted.org/packages/source/i/imagecodecs/ima
|
||||
Source1: imagecodecs_distributor_setup.py
|
||||
Patch0: always-cythonize.patch
|
||||
BuildRequires: %{python_module Cython >= 0.29.19}
|
||||
BuildRequires: %{python_module numpy-devel >= 1.19.2}
|
||||
BuildRequires: %{python_module setuptools >= 18.0}
|
||||
BuildRequires: %{python_module base >= 3.8}
|
||||
BuildRequires: %{python_module numpy-devel}
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: dos2unix
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires: python-numpy >= 1.19.2
|
||||
Requires: python-numpy
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun):update-alternatives
|
||||
Recommends: python-Pillow
|
||||
@@ -50,23 +51,25 @@ Recommends: python-blosc
|
||||
Recommends: python-lz4
|
||||
Recommends: python-matplotlib >= 3.3
|
||||
Recommends: python-numcodecs
|
||||
Recommends: python-tifffile >= 2021.1.11
|
||||
Recommends: python-tifffile
|
||||
Recommends: python-zstd
|
||||
%if %{with test}
|
||||
BuildRequires: %{python_module Brotli}
|
||||
BuildRequires: %{python_module Pillow}
|
||||
BuildRequires: %{python_module blosc}
|
||||
BuildRequires: %{python_module czifile}
|
||||
# dask is needed for doctests, but it fails
|
||||
#BuildRequires: %%{python_module dask}
|
||||
BuildRequires: %{python_module dask-array}
|
||||
BuildRequires: %{python_module dask-delayed}
|
||||
BuildRequires: %{python_module dask}
|
||||
BuildRequires: %{python_module imagecodecs >= %{version}}
|
||||
BuildRequires: %{python_module lz4}
|
||||
BuildRequires: %{python_module matplotlib >= 3.3}
|
||||
BuildRequires: %{python_module numcodecs}
|
||||
BuildRequires: %{python_module pytest-xdist}
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: %{python_module python-snappy}
|
||||
BuildRequires: %{python_module scikit-image}
|
||||
BuildRequires: %{python_module tifffile >= 2021.1.11}
|
||||
BuildRequires: %{python_module tifffile}
|
||||
BuildRequires: %{python_module zarr}
|
||||
BuildRequires: %{python_module zstd}
|
||||
# libraries and python modules not (yet) available:
|
||||
@@ -84,6 +87,8 @@ BuildRequires: libaec-devel
|
||||
BuildRequires: libaom-devel
|
||||
BuildRequires: libdeflate-devel
|
||||
BuildRequires: libzopfli-devel
|
||||
BuildRequires: lzfse-devel
|
||||
BuildRequires: lzham_codec-devel
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: rav1e-devel
|
||||
BuildRequires: snappy-devel
|
||||
@@ -133,19 +138,24 @@ dos2unix tests/test_imagecodecs.py
|
||||
|
||||
cp %SOURCE1 ./
|
||||
dos2unix README.rst
|
||||
# https://github.com/cgohlke/imagecodecs/pull/15#issuecomment-795744838
|
||||
ldd %{_libdir}/libblosc.so.1 | grep -q libsnappy && sed -i "s/if not IS_CG and compressor == 'snappy'/if False/" tests/test_imagecodecs.py
|
||||
# These libraries are not linked to, (check SOURCE1)
|
||||
rm imagecodecs/licenses/LICENSE-blosc2
|
||||
rm imagecodecs/licenses/LICENSE-brunsli
|
||||
rm imagecodecs/licenses/LICENSE-jetraw
|
||||
rm imagecodecs/licenses/LICENSE-libjxl
|
||||
rm imagecodecs/licenses/LICENSE-lerc
|
||||
rm imagecodecs/licenses/LICENSE-mozjpeg
|
||||
|
||||
%build
|
||||
%if !%{with test}
|
||||
export CFLAGS="%{optflags}"
|
||||
export INCDIR="%{_includedir}"
|
||||
%python_build
|
||||
%pyproject_wheel
|
||||
%endif
|
||||
|
||||
%install
|
||||
%if !%{with test}
|
||||
%python_install
|
||||
%pyproject_install
|
||||
%python_clone -a %{buildroot}%{_bindir}/imagecodecs
|
||||
%{python_expand rm -rf %{buildroot}%{$python_sitearch}/imagecodecs/licenses/
|
||||
%fdupes %{buildroot}%{$python_sitearch}
|
||||
@@ -154,14 +164,14 @@ export INCDIR="%{_includedir}"
|
||||
|
||||
%check
|
||||
%if %{with test}
|
||||
# Should add --doctest-modules %%{$python_sitearch}/imagecodecs/imagecodecs.py
|
||||
# however doctests are currently broken, with importing dask not working
|
||||
|
||||
# All heif tests fail
|
||||
# lerc is not built, but a few tests still run and fail
|
||||
# spng fail on i586
|
||||
# two tests for in test_tifffile for webp, possibly because python-tifffile needs to be updated
|
||||
%pytest_arch tests -rs -k 'not (heif or lerc or spng or (test_tifffile and webp))'
|
||||
# All heif tests fail because of unsupported filetypes (openSUSE does not ship patentend codec support with libheif)
|
||||
donttest="heif"
|
||||
# no webp and lerc support in libtiff
|
||||
donttest="$donttest or (test_tiff and (webp or lerc))"
|
||||
%ifarch %ix86 %arm32
|
||||
donttest="$donttest or spng"
|
||||
%endif
|
||||
%pytest_arch -n auto tests -rsXfE --doctest-modules %{$python_sitearch}/imagecodecs/imagecodecs.py -k "not ($donttest)"
|
||||
%endif
|
||||
|
||||
%if !%{with test}
|
||||
@@ -175,7 +185,7 @@ export INCDIR="%{_includedir}"
|
||||
%license LICENSE imagecodecs/licenses/*
|
||||
%doc README.rst
|
||||
%python_alternative %{_bindir}/imagecodecs
|
||||
%{python_sitearch}/imagecodecs-%{version}*-info/
|
||||
%{python_sitearch}/imagecodecs-%{version}.dist-info/
|
||||
%{python_sitearch}/imagecodecs/
|
||||
%endif
|
||||
|
||||
|
Reference in New Issue
Block a user