From 3468cf65fd6ac59131a8818c1416cbd9aebf7080a077c393560073751f561d29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Mon, 23 Jan 2023 12:54:52 +0000 Subject: [PATCH] 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 --- always-cythonize.patch | 14 ++++---- imagecodecs-2022.12.24.tar.gz | 3 ++ imagecodecs-2022.9.26.tar.gz | 3 -- imagecodecs_distributor_setup.py | 9 ++--- python-imagecodecs.changes | 24 +++++++++++++ python-imagecodecs.spec | 62 ++++++++++++++++++-------------- 6 files changed, 75 insertions(+), 40 deletions(-) create mode 100644 imagecodecs-2022.12.24.tar.gz delete mode 100644 imagecodecs-2022.9.26.tar.gz diff --git a/always-cythonize.patch b/always-cythonize.patch index 19e2df2..e421e01 100644 --- a/always-cythonize.patch +++ b/always-cythonize.patch @@ -1,19 +1,19 @@ -Index: imagecodecs-2022.9.26/setup.py +Index: imagecodecs-2022.12.24/setup.py =================================================================== ---- imagecodecs-2022.9.26.orig/setup.py -+++ imagecodecs-2022.9.26/setup.py -@@ -94,7 +94,7 @@ def ext(**kwargs): - extra_compile_args=[], +--- imagecodecs-2022.12.24.orig/setup.py ++++ imagecodecs-2022.12.24/setup.py +@@ -85,7 +85,7 @@ def ext(**kwargs): extra_link_args=[], + depends=[], cython_compile_time_env={}, - cythonize=False, + cythonize=True, ) d.update(kwargs) return d -@@ -114,13 +114,13 @@ OPTIONS = { - 'extra_compile_args': [], +@@ -106,13 +106,13 @@ OPTIONS = { 'extra_link_args': [], + 'depends': ['imagecodecs/_shared.pxd'], 'cython_compile_time_env': {}, - 'cythonize': False, # sys.version_info >= (3, 11) + 'cythonize': True, # sys.version_info >= (3, 11) diff --git a/imagecodecs-2022.12.24.tar.gz b/imagecodecs-2022.12.24.tar.gz new file mode 100644 index 0000000..d671d73 --- /dev/null +++ b/imagecodecs-2022.12.24.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c5282a808786dadb8e3ee238bb213b2e065574f1bb0f4b51e8bf93747e0babb3 +size 13747904 diff --git a/imagecodecs-2022.9.26.tar.gz b/imagecodecs-2022.9.26.tar.gz deleted file mode 100644 index 62633a0..0000000 --- a/imagecodecs-2022.9.26.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:04d5757d8fd7819844b0f8d9eed05025dca4962f280d0010b42c7c9c993fe371 -size 13508043 diff --git a/imagecodecs_distributor_setup.py b/imagecodecs_distributor_setup.py index c04700a..f9f2588 100644 --- a/imagecodecs_distributor_setup.py +++ b/imagecodecs_distributor_setup.py @@ -16,9 +16,8 @@ def customize_build(EXTENSIONS, OPTIONS): del EXTENSIONS['jpegxl'] # jpeg-xl library not available del EXTENSIONS['lerc'] # LERC library not available del EXTENSIONS['lz4f'] # requires static linking - del EXTENSIONS['mozjpeg'] # mozjpeg library not available - del EXTENSIONS['zfp'] # zfp library 0.5.5 not supported - + del EXTENSIONS['mozjpeg'] # Win32 only + EXTENSIONS['avif']['libraries'] = [ 'avif', 'aom', @@ -28,7 +27,7 @@ def customize_build(EXTENSIONS, OPTIONS): if sys.maxsize < 2**63 - 1: # no zfp on 32-bit platforms - # del EXTENSIONS['zfp'] + del EXTENSIONS['zfp'] # avif tests fail on 32-bit del EXTENSIONS['avif'] # spng build fail on 32-bit @@ -42,3 +41,5 @@ def customize_build(EXTENSIONS, OPTIONS): EXTENSIONS['jpegxr']['include_dirs'].append(includedir + 'jxrlib') EXTENSIONS['rcomp']['include_dirs'].append(includedir + 'cfitsio') EXTENSIONS['zopfli']['include_dirs'].append(includedir + 'zopfli') + EXTENSIONS['lzham']['libraries'] = ['lzhamdll'] + \ No newline at end of file diff --git a/python-imagecodecs.changes b/python-imagecodecs.changes index 055c87c..9f77c24 100644 --- a/python-imagecodecs.changes +++ b/python-imagecodecs.changes @@ -1,3 +1,27 @@ +------------------------------------------------------------------- +Sat Jan 21 11:40:41 UTC 2023 - Ben Greiner + +- 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. + ------------------------------------------------------------------- Sun Oct 9 08:05:22 UTC 2022 - John Vandenberg diff --git a/python-imagecodecs.spec b/python-imagecodecs.spec index 9462488..5a7a290 100644 --- a/python-imagecodecs.spec +++ b/python-imagecodecs.spec @@ -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