diff --git a/bokeh-pr12218-Pillow9.2.patch b/bokeh-pr12218-Pillow9.2.patch new file mode 100644 index 0000000..8baf72a --- /dev/null +++ b/bokeh-pr12218-Pillow9.2.patch @@ -0,0 +1,42 @@ +From b86d5458cbf6d371013a8ced744b262460005e23 Mon Sep 17 00:00:00 2001 +From: Mateusz Paprocki +Date: Wed, 6 Jul 2022 14:59:48 +0200 +Subject: [PATCH] Robustify a unit test of Image.transform() + +--- + tests/unit/bokeh/core/property/test_visual.py | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/tests/unit/bokeh/core/property/test_visual.py b/tests/unit/bokeh/core/property/test_visual.py +index 3f293642b56..37620d35c1d 100644 +--- a/tests/unit/bokeh/core/property/test_visual.py ++++ b/tests/unit/bokeh/core/property/test_visual.py +@@ -21,6 +21,7 @@ + import datetime + from io import BytesIO + from pathlib import Path ++from typing import Literal + + # External imports + import numpy as np +@@ -284,12 +285,15 @@ def test_transform_numpy(self) -> None: + assert prop.transform(data) == expected + + @pytest.mark.parametrize('typ', ('png', 'gif', 'tiff')) +- def test_transform_PIL(self, typ) -> None: ++ def test_transform_PIL(self, typ: Literal["png", "gif", "tiff"]) -> None: + image = PIL.Image.new("RGBA", size=(50, 50), color=(155, 0, 0)) +- out = BytesIO() +- image.save(out, typ) +- value = PIL.Image.open(out) +- expected = "data:image/%s;base64," % typ + base64.b64encode(out.getvalue()).decode('ascii') ++ out0 = BytesIO() ++ image.save(out0, typ) ++ ++ value = PIL.Image.open(out0) ++ out1 = BytesIO() ++ value.save(out1, typ) ++ expected = "data:image/%s;base64," % typ + base64.b64encode(out1.getvalue()).decode('ascii') + + prop = bcpv.Image() + assert prop.transform(value) == expected diff --git a/python-bokeh.changes b/python-bokeh.changes index 42ffcb9..6cd54bd 100644 --- a/python-bokeh.changes +++ b/python-bokeh.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Jul 7 17:32:06 UTC 2022 - Ben Greiner + +- Add bokeh-pr12218-Pillow9.2.patch for fixing failures with + Pillow 9.2 + * gh#bokeh/bokeh#12216 + * gh#bokeh/bokeh#12218 + ------------------------------------------------------------------- Sun May 29 15:02:34 UTC 2022 - Atri Bhattacharya diff --git a/python-bokeh.spec b/python-bokeh.spec index 27529da..a80d681 100644 --- a/python-bokeh.spec +++ b/python-bokeh.spec @@ -17,7 +17,6 @@ %define skip_python2 1 -%define skip_python36 1 %bcond_without tests Name: python-bokeh Version: 2.4.3 @@ -27,6 +26,8 @@ License: BSD-3-Clause URL: https://github.com/bokeh/bokeh/ Source0: https://files.pythonhosted.org/packages/source/b/bokeh/bokeh-%{version}.tar.gz Source1: https://raw.githubusercontent.com/bokeh/bokeh/%{version}/conftest.py +#PATCH-FIX-UPSTREAM bokeh-pr12218-Pillow9.2.patch gh#bokeh/bokeh#12218 +Patch1: https://github.com/bokeh/bokeh/pull/12218.patch#/bokeh-pr12218-Pillow9.2.patch BuildRequires: %{python_module Jinja2 >= 2.9} BuildRequires: %{python_module Pillow >= 7.1.0} BuildRequires: %{python_module PyYAML >= 3.10}