From ebfbf1e0321fe037ef3625d3b98f2d7ab60f0fb0334c38ecb6a5c9f7df1eb2f8 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 5 Oct 2023 15:45:54 +0000 Subject: [PATCH] Accepting request 1115762 from home:mcalabkova:branches:devel:languages:python - Update to 3.0 * Create Convert processor and GaussianBlur processor * Updating histogram entropy implementations * Make processors.Resize more memory-efficient * Added WebP as a transparency format * Use pytest instead of nose * Make it compatible with Pillow10 * test: use unittest.mock instead of mock - Drop merged patches: * switch-to-pytest.patch * python-pilkit-no-mock.patch * pil-fix-test.patch OBS-URL: https://build.opensuse.org/request/show/1115762 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pilkit?expand=0&rev=13 --- pil-fix-test.patch | 13 ----- pilkit-2.0.tar.gz | 3 -- pilkit-3.0.tar.gz | 3 ++ python-pilkit-no-mock.patch | 26 ---------- python-pilkit.changes | 16 +++++++ python-pilkit.spec | 14 +++--- switch-to-pytest.patch | 94 ------------------------------------- 7 files changed, 25 insertions(+), 144 deletions(-) delete mode 100644 pil-fix-test.patch delete mode 100644 pilkit-2.0.tar.gz create mode 100644 pilkit-3.0.tar.gz delete mode 100644 python-pilkit-no-mock.patch delete mode 100644 switch-to-pytest.patch diff --git a/pil-fix-test.patch b/pil-fix-test.patch deleted file mode 100644 index f06fecb..0000000 --- a/pil-fix-test.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: pilkit-2.0/tests/test_utils.py -=================================================================== ---- pilkit-2.0.orig/tests/test_utils.py -+++ pilkit-2.0/tests/test_utils.py -@@ -16,7 +16,7 @@ def test_extension_to_format(): - - - def test_format_to_extension_no_init(): -- eq_(format_to_extension('PNG'), '.png') -+ eq_(format_to_extension('GIF'), '.gif') - eq_(format_to_extension('ICO'), '.ico') - - diff --git a/pilkit-2.0.tar.gz b/pilkit-2.0.tar.gz deleted file mode 100644 index ab56d21..0000000 --- a/pilkit-2.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ddb30c2f0198a147e56b151476c3bb9fe045fbfd5b0a0fa2a3148dba62d1559f -size 161137 diff --git a/pilkit-3.0.tar.gz b/pilkit-3.0.tar.gz new file mode 100644 index 0000000..facecb9 --- /dev/null +++ b/pilkit-3.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6719e8cc0482e5447f5cb94f18b949d8e604ea9673a9b019c74d41b779e4eab +size 402342 diff --git a/python-pilkit-no-mock.patch b/python-pilkit-no-mock.patch deleted file mode 100644 index 0c2cdb8..0000000 --- a/python-pilkit-no-mock.patch +++ /dev/null @@ -1,26 +0,0 @@ -Index: pilkit-2.0/tests/test_processors.py -=================================================================== ---- pilkit-2.0.orig/tests/test_processors.py -+++ pilkit-2.0/tests/test_processors.py -@@ -4,7 +4,7 @@ from pilkit.processors import (Resize, R - import os - from pilkit.processors.resize import Thumbnail - from .utils import create_image, eq_, assert_true --import mock -+import unittest.mock as mock - - - def test_smartcrop(): -Index: pilkit-2.0/tests/test_utils.py -=================================================================== ---- pilkit-2.0.orig/tests/test_utils.py -+++ pilkit-2.0/tests/test_utils.py -@@ -5,7 +5,7 @@ from pilkit.lib import Image - from pilkit.utils import (extension_to_format, format_to_extension, FileWrapper, - save_image, prepare_image, quiet) - from pytest import raises --from mock import Mock, patch -+from unittest.mock import Mock, patch - from tempfile import NamedTemporaryFile - from .utils import create_image, eq_, assert_true - diff --git a/python-pilkit.changes b/python-pilkit.changes index b9c56fa..fe5d996 100644 --- a/python-pilkit.changes +++ b/python-pilkit.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Thu Oct 5 08:36:31 UTC 2023 - Markéta Machová + +- Update to 3.0 + * Create Convert processor and GaussianBlur processor + * Updating histogram entropy implementations + * Make processors.Resize more memory-efficient + * Added WebP as a transparency format + * Use pytest instead of nose + * Make it compatible with Pillow10 + * test: use unittest.mock instead of mock +- Drop merged patches: + * switch-to-pytest.patch + * python-pilkit-no-mock.patch + * pil-fix-test.patch + ------------------------------------------------------------------- Wed Apr 6 10:37:26 UTC 2022 - pgajdos@suse.com diff --git a/python-pilkit.spec b/python-pilkit.spec index 5dc5608..5990053 100644 --- a/python-pilkit.spec +++ b/python-pilkit.spec @@ -1,7 +1,7 @@ # # spec file for package python-pilkit # -# 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,18 +16,14 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%{?sle15_python_module_pythons} Name: python-pilkit -Version: 2.0 +Version: 3.0 Release: 0 Summary: A collection of utilities and processors for the Python Imaging Libary License: BSD-3-Clause URL: https://github.com/matthewwithanm/pilkit/ Source: https://files.pythonhosted.org/packages/source/p/pilkit/pilkit-%{version}.tar.gz -Patch0: pil-fix-test.patch -Patch1: switch-to-pytest.patch -# https://github.com/matthewwithanm/pilkit/issues/54 -Patch2: python-pilkit-no-mock.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -36,6 +32,7 @@ BuildArch: noarch BuildRequires: %{python_module Pillow} BuildRequires: %{python_module pytest} # /SECTION +Requires: python-Pillow %python_subpackages %description @@ -62,6 +59,7 @@ interface for performing manipulations on PIL images. %files %{python_files} %license LICENSE %doc AUTHORS README.rst -%{python_sitelib}/* +%{python_sitelib}/pilkit +%{python_sitelib}/pilkit-%{version}*-info %changelog diff --git a/switch-to-pytest.patch b/switch-to-pytest.patch deleted file mode 100644 index feb614b..0000000 --- a/switch-to-pytest.patch +++ /dev/null @@ -1,94 +0,0 @@ -Index: pilkit-2.0/tests/test_processors.py -=================================================================== ---- pilkit-2.0.orig/tests/test_processors.py -+++ pilkit-2.0/tests/test_processors.py -@@ -1,10 +1,9 @@ - from pilkit.lib import Image, ImageDraw, ImageColor - from pilkit.processors import (Resize, ResizeToFill, ResizeToFit, SmartCrop, - SmartResize, MakeOpaque, ColorOverlay) --from nose.tools import eq_, assert_true - import os - from pilkit.processors.resize import Thumbnail --from .utils import create_image -+from .utils import create_image, eq_, assert_true - import mock - - -Index: pilkit-2.0/tests/test_utils.py -=================================================================== ---- pilkit-2.0.orig/tests/test_utils.py -+++ pilkit-2.0/tests/test_utils.py -@@ -4,10 +4,10 @@ from pilkit.exceptions import UnknownFor - from pilkit.lib import Image - from pilkit.utils import (extension_to_format, format_to_extension, FileWrapper, - save_image, prepare_image, quiet) -+from pytest import raises - from mock import Mock, patch --from nose.tools import eq_, raises, ok_ - from tempfile import NamedTemporaryFile --from .utils import create_image -+from .utils import create_image, eq_, assert_true - - - def test_extension_to_format(): -@@ -20,14 +20,14 @@ def test_format_to_extension_no_init(): - eq_(format_to_extension('ICO'), '.ico') - - --@raises(UnknownFormat) - def test_unknown_format(): -- format_to_extension('TXT') -+ with raises(UnknownFormat): -+ format_to_extension('TXT') - - --@raises(UnknownExtension) - def test_unknown_extension(): -- extension_to_format('.txt') -+ with raises(UnknownExtension): -+ extension_to_format('.txt') - - - def test_default_extension(): -@@ -43,14 +43,13 @@ def test_default_extension(): - eq_(format_to_extension('JPEG'), '.jpg') - - --@raises(AttributeError) - def test_filewrapper(): - - class K(object): - def fileno(self): - raise UnsupportedOperation -- -- FileWrapper(K()).fileno() -+ with raises(AttributeError): -+ FileWrapper(K()).fileno() - - - def test_save_with_filename(): -@@ -71,7 +70,7 @@ def test_format_normalization(): - See https://github.com/matthewwithanm/django-imagekit/issues/262 - """ - im = Image.new('RGBA', (100, 100)) -- ok_('transparency' in prepare_image(im, 'gIF')[1]) -+ assert_true('transparency' in prepare_image(im, 'gIF')[1]) - - def test_quiet(): - """ -Index: pilkit-2.0/tests/utils.py -=================================================================== ---- pilkit-2.0.orig/tests/utils.py -+++ pilkit-2.0/tests/utils.py -@@ -17,3 +17,11 @@ def get_image_file(): - - def create_image(): - return Image.open(get_image_file()) -+ -+ -+def eq_(first, second): -+ assert first == second -+ -+ -+def assert_true(first): -+ assert first is True