Accepting request 1060413 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/1060413
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-imagecodecs?expand=0&rev=9
This commit is contained in:
Dominique Leuenberger 2023-01-23 17:33:37 +00:00 committed by Git OBS Bridge
commit 4a5f84b1f4
6 changed files with 75 additions and 40 deletions

View File

@ -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.12.24.orig/setup.py
+++ imagecodecs-2022.9.26/setup.py +++ imagecodecs-2022.12.24/setup.py
@@ -94,7 +94,7 @@ def ext(**kwargs): @@ -85,7 +85,7 @@ def ext(**kwargs):
extra_compile_args=[],
extra_link_args=[], extra_link_args=[],
depends=[],
cython_compile_time_env={}, cython_compile_time_env={},
- cythonize=False, - cythonize=False,
+ cythonize=True, + cythonize=True,
) )
d.update(kwargs) d.update(kwargs)
return d return d
@@ -114,13 +114,13 @@ OPTIONS = { @@ -106,13 +106,13 @@ OPTIONS = {
'extra_compile_args': [],
'extra_link_args': [], 'extra_link_args': [],
'depends': ['imagecodecs/_shared.pxd'],
'cython_compile_time_env': {}, 'cython_compile_time_env': {},
- 'cythonize': False, # sys.version_info >= (3, 11) - 'cythonize': False, # sys.version_info >= (3, 11)
+ 'cythonize': True, # sys.version_info >= (3, 11) + 'cythonize': True, # sys.version_info >= (3, 11)

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c5282a808786dadb8e3ee238bb213b2e065574f1bb0f4b51e8bf93747e0babb3
size 13747904

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:04d5757d8fd7819844b0f8d9eed05025dca4962f280d0010b42c7c9c993fe371
size 13508043

View File

@ -16,9 +16,8 @@ def customize_build(EXTENSIONS, OPTIONS):
del EXTENSIONS['jpegxl'] # jpeg-xl library not available del EXTENSIONS['jpegxl'] # jpeg-xl library not available
del EXTENSIONS['lerc'] # LERC library not available del EXTENSIONS['lerc'] # LERC library not available
del EXTENSIONS['lz4f'] # requires static linking del EXTENSIONS['lz4f'] # requires static linking
del EXTENSIONS['mozjpeg'] # mozjpeg library not available del EXTENSIONS['mozjpeg'] # Win32 only
del EXTENSIONS['zfp'] # zfp library 0.5.5 not supported
EXTENSIONS['avif']['libraries'] = [ EXTENSIONS['avif']['libraries'] = [
'avif', 'avif',
'aom', 'aom',
@ -28,7 +27,7 @@ def customize_build(EXTENSIONS, OPTIONS):
if sys.maxsize < 2**63 - 1: if sys.maxsize < 2**63 - 1:
# no zfp on 32-bit platforms # no zfp on 32-bit platforms
# del EXTENSIONS['zfp'] del EXTENSIONS['zfp']
# avif tests fail on 32-bit # avif tests fail on 32-bit
del EXTENSIONS['avif'] del EXTENSIONS['avif']
# spng build fail on 32-bit # spng build fail on 32-bit
@ -42,3 +41,5 @@ def customize_build(EXTENSIONS, OPTIONS):
EXTENSIONS['jpegxr']['include_dirs'].append(includedir + 'jxrlib') EXTENSIONS['jpegxr']['include_dirs'].append(includedir + 'jxrlib')
EXTENSIONS['rcomp']['include_dirs'].append(includedir + 'cfitsio') EXTENSIONS['rcomp']['include_dirs'].append(includedir + 'cfitsio')
EXTENSIONS['zopfli']['include_dirs'].append(includedir + 'zopfli') EXTENSIONS['zopfli']['include_dirs'].append(includedir + 'zopfli')
EXTENSIONS['lzham']['libraries'] = ['lzhamdll']

View File

@ -1,3 +1,27 @@
-------------------------------------------------------------------
Sat Jan 21 11:40:41 UTC 2023 - Ben Greiner <code@bnavigator.de>
- 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 <jayvdb@gmail.com> Sun Oct 9 08:05:22 UTC 2022 - John Vandenberg <jayvdb@gmail.com>

View File

@ -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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # 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} %global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test" %if "%{flavor}" == "test"
%define psuffix -test %define psuffix -test
@ -25,10 +24,9 @@
%define psuffix %{nil} %define psuffix %{nil}
%bcond_with test %bcond_with test
%endif %endif
%define skip_python2 1
%define skip_python36 1
Name: python-imagecodecs%{psuffix} Name: python-imagecodecs%{psuffix}
Version: 2022.9.26 Version: 2022.12.24
Release: 0 Release: 0
Summary: Image transformation, compression, and decompression codecs Summary: Image transformation, compression, and decompression codecs
License: BSD-3-Clause License: BSD-3-Clause
@ -37,12 +35,15 @@ Source: https://files.pythonhosted.org/packages/source/i/imagecodecs/ima
Source1: imagecodecs_distributor_setup.py Source1: imagecodecs_distributor_setup.py
Patch0: always-cythonize.patch Patch0: always-cythonize.patch
BuildRequires: %{python_module Cython >= 0.29.19} BuildRequires: %{python_module Cython >= 0.29.19}
BuildRequires: %{python_module numpy-devel >= 1.19.2} BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module setuptools >= 18.0} BuildRequires: %{python_module numpy-devel}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: dos2unix BuildRequires: dos2unix
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
Requires: python-numpy >= 1.19.2 Requires: python-numpy
Requires(post): update-alternatives Requires(post): update-alternatives
Requires(postun):update-alternatives Requires(postun):update-alternatives
Recommends: python-Pillow Recommends: python-Pillow
@ -50,23 +51,25 @@ Recommends: python-blosc
Recommends: python-lz4 Recommends: python-lz4
Recommends: python-matplotlib >= 3.3 Recommends: python-matplotlib >= 3.3
Recommends: python-numcodecs Recommends: python-numcodecs
Recommends: python-tifffile >= 2021.1.11 Recommends: python-tifffile
Recommends: python-zstd Recommends: python-zstd
%if %{with test} %if %{with test}
BuildRequires: %{python_module Brotli} BuildRequires: %{python_module Brotli}
BuildRequires: %{python_module Pillow} BuildRequires: %{python_module Pillow}
BuildRequires: %{python_module blosc} BuildRequires: %{python_module blosc}
BuildRequires: %{python_module czifile} BuildRequires: %{python_module czifile}
# dask is needed for doctests, but it fails BuildRequires: %{python_module dask-array}
#BuildRequires: %%{python_module dask} BuildRequires: %{python_module dask-delayed}
BuildRequires: %{python_module dask}
BuildRequires: %{python_module imagecodecs >= %{version}} BuildRequires: %{python_module imagecodecs >= %{version}}
BuildRequires: %{python_module lz4} BuildRequires: %{python_module lz4}
BuildRequires: %{python_module matplotlib >= 3.3} BuildRequires: %{python_module matplotlib >= 3.3}
BuildRequires: %{python_module numcodecs} BuildRequires: %{python_module numcodecs}
BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytest}
BuildRequires: %{python_module python-snappy} BuildRequires: %{python_module python-snappy}
BuildRequires: %{python_module scikit-image} BuildRequires: %{python_module scikit-image}
BuildRequires: %{python_module tifffile >= 2021.1.11} BuildRequires: %{python_module tifffile}
BuildRequires: %{python_module zarr} BuildRequires: %{python_module zarr}
BuildRequires: %{python_module zstd} BuildRequires: %{python_module zstd}
# libraries and python modules not (yet) available: # libraries and python modules not (yet) available:
@ -84,6 +87,8 @@ BuildRequires: libaec-devel
BuildRequires: libaom-devel BuildRequires: libaom-devel
BuildRequires: libdeflate-devel BuildRequires: libdeflate-devel
BuildRequires: libzopfli-devel BuildRequires: libzopfli-devel
BuildRequires: lzfse-devel
BuildRequires: lzham_codec-devel
BuildRequires: pkgconfig BuildRequires: pkgconfig
BuildRequires: rav1e-devel BuildRequires: rav1e-devel
BuildRequires: snappy-devel BuildRequires: snappy-devel
@ -133,19 +138,24 @@ dos2unix tests/test_imagecodecs.py
cp %SOURCE1 ./ cp %SOURCE1 ./
dos2unix README.rst dos2unix README.rst
# https://github.com/cgohlke/imagecodecs/pull/15#issuecomment-795744838 # These libraries are not linked to, (check SOURCE1)
ldd %{_libdir}/libblosc.so.1 | grep -q libsnappy && sed -i "s/if not IS_CG and compressor == 'snappy'/if False/" tests/test_imagecodecs.py 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 %build
%if !%{with test} %if !%{with test}
export CFLAGS="%{optflags}" export CFLAGS="%{optflags}"
export INCDIR="%{_includedir}" export INCDIR="%{_includedir}"
%python_build %pyproject_wheel
%endif %endif
%install %install
%if !%{with test} %if !%{with test}
%python_install %pyproject_install
%python_clone -a %{buildroot}%{_bindir}/imagecodecs %python_clone -a %{buildroot}%{_bindir}/imagecodecs
%{python_expand rm -rf %{buildroot}%{$python_sitearch}/imagecodecs/licenses/ %{python_expand rm -rf %{buildroot}%{$python_sitearch}/imagecodecs/licenses/
%fdupes %{buildroot}%{$python_sitearch} %fdupes %{buildroot}%{$python_sitearch}
@ -154,14 +164,14 @@ export INCDIR="%{_includedir}"
%check %check
%if %{with test} %if %{with test}
# Should add --doctest-modules %%{$python_sitearch}/imagecodecs/imagecodecs.py # All heif tests fail because of unsupported filetypes (openSUSE does not ship patentend codec support with libheif)
# however doctests are currently broken, with importing dask not working donttest="heif"
# no webp and lerc support in libtiff
# All heif tests fail donttest="$donttest or (test_tiff and (webp or lerc))"
# lerc is not built, but a few tests still run and fail %ifarch %ix86 %arm32
# spng fail on i586 donttest="$donttest or spng"
# two tests for in test_tifffile for webp, possibly because python-tifffile needs to be updated %endif
%pytest_arch tests -rs -k 'not (heif or lerc or spng or (test_tifffile and webp))' %pytest_arch -n auto tests -rsXfE --doctest-modules %{$python_sitearch}/imagecodecs/imagecodecs.py -k "not ($donttest)"
%endif %endif
%if !%{with test} %if !%{with test}
@ -175,7 +185,7 @@ export INCDIR="%{_includedir}"
%license LICENSE imagecodecs/licenses/* %license LICENSE imagecodecs/licenses/*
%doc README.rst %doc README.rst
%python_alternative %{_bindir}/imagecodecs %python_alternative %{_bindir}/imagecodecs
%{python_sitearch}/imagecodecs-%{version}*-info/ %{python_sitearch}/imagecodecs-%{version}.dist-info/
%{python_sitearch}/imagecodecs/ %{python_sitearch}/imagecodecs/
%endif %endif