From d60d662a440c9ada8b9d21b28fc79a962848725af4eec68301d5ca4b7860937b Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 28 May 2021 16:03:14 +0000 Subject: [PATCH 1/4] - Add stdlib-typing_extensions.patch which removes dependency on typing_extensions package (gh#bokeh/bokeh#11307). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-bokeh?expand=0&rev=42 --- python-bokeh.changes | 6 ++ python-bokeh.spec | 11 ++-- stdlib-typing_extensions.patch | 109 +++++++++++++++++++++++++++++++++ 3 files changed, 121 insertions(+), 5 deletions(-) create mode 100644 stdlib-typing_extensions.patch diff --git a/python-bokeh.changes b/python-bokeh.changes index f3b33be..d206a7c 100644 --- a/python-bokeh.changes +++ b/python-bokeh.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri May 28 16:02:43 UTC 2021 - Matej Cepl + +- Add stdlib-typing_extensions.patch which removes dependency on + typing_extensions package (gh#bokeh/bokeh#11307). + ------------------------------------------------------------------- Sat Feb 27 11:27:05 UTC 2021 - Michael Ströder diff --git a/python-bokeh.spec b/python-bokeh.spec index 058946a..b5acca1 100644 --- a/python-bokeh.spec +++ b/python-bokeh.spec @@ -28,6 +28,9 @@ Summary: Statistical interactive HTML plots for Python License: BSD-3-Clause URL: https://github.com/bokeh/bokeh/ Source: https://files.pythonhosted.org/packages/source/b/bokeh/bokeh-%{version}.tar.gz +# PATCH-FEATURE-UPSTREAM stdlib-typing_extensions.patch gh#bokeh/bokeh#11307 mcepl@suse.com +# Removes dependency on the external package typing_extensions +Patch0: stdlib-typing_extensions.patch BuildRequires: %{python_module Jinja2 >= 2.7} BuildRequires: %{python_module Pillow >= 7.1.0} BuildRequires: %{python_module PyYAML >= 3.10} @@ -36,7 +39,6 @@ BuildRequires: %{python_module numpy >= 1.11.3} BuildRequires: %{python_module packaging >= 16.8} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module tornado >= 5.1} -BuildRequires: %{python_module typing_extensions >= 3.7.4} BuildRequires: fdupes BuildRequires: python-rpm-macros # SECTION test requirements @@ -58,9 +60,8 @@ Requires: python-numpy >= 1.11.3 Requires: python-packaging >= 16.8 Requires: python-python-dateutil >= 2.1 Requires: python-tornado >= 5.1 -Requires: python-typing_extensions >= 3.7.4 Requires(post): update-alternatives -Requires(postun): update-alternatives +Requires(postun):update-alternatives BuildArch: noarch %python_subpackages @@ -71,7 +72,7 @@ graphics in the style of D3.js, and favors delivering this capability with interactivity over large or streaming datasets. %prep -%setup -q -n bokeh-%{version} +%autosetup -p1 -n bokeh-%{version} %build %python_build @@ -90,7 +91,7 @@ with interactivity over large or streaming datasets. %if %{with tests} %check -# Running the test suite (with datafiles from the GitHub archive) fails +# Running the test suite (with datafiles from the GitHub archive) fails # due to missing server/client setups, chromedriver, selenium etc. %pytest --no-js %endif diff --git a/stdlib-typing_extensions.patch b/stdlib-typing_extensions.patch new file mode 100644 index 0000000..fb1ae51 --- /dev/null +++ b/stdlib-typing_extensions.patch @@ -0,0 +1,109 @@ +--- + bokeh/io/webdriver.py | 3 +-- + bokeh/models/tools.py | 11 +++++------ + bokeh/plotting/_tools.py | 4 +--- + bokeh/util/browser.py | 5 +---- + setup.py | 1 - + 5 files changed, 8 insertions(+), 16 deletions(-) + +--- a/bokeh/io/webdriver.py ++++ b/bokeh/io/webdriver.py +@@ -28,12 +28,11 @@ import atexit + import os + from os.path import devnull, dirname, isfile, join + from shutil import which +-from typing import List, Optional ++from typing import List, Literal, Optional + + # External imports + from selenium import webdriver + from selenium.webdriver.remote.webdriver import WebDriver +-from typing_extensions import Literal + + #----------------------------------------------------------------------------- + # Globals and constants +--- a/bokeh/models/tools.py ++++ b/bokeh/models/tools.py +@@ -40,7 +40,6 @@ log = logging.getLogger(__name__) + # Standard library imports + import difflib + import typing as tp +-from typing_extensions import Literal + + # Bokeh imports + from ..core.enums import ( +@@ -287,25 +286,25 @@ class Toolbar(ToolbarBase): + + ''' + +- active_drag: tp.Union[Literal["auto"], Drag, None] = Either(Null, Auto, Instance(Drag), default="auto", help=""" ++ active_drag: tp.Union[tp.Literal["auto"], Drag, None] = Either(Null, Auto, Instance(Drag), default="auto", help=""" + Specify a drag tool to be active when the plot is displayed. + """) + +- active_inspect: tp.Union[Literal["auto"], InspectTool, tp.Sequence[InspectTool], None] = \ ++ active_inspect: tp.Union[tp.Literal["auto"], InspectTool, tp.Sequence[InspectTool], None] = \ + Either(Null, Auto, Instance(InspectTool), Seq(Instance(InspectTool)), default="auto", help=""" + Specify an inspection tool or sequence of inspection tools to be active when + the plot is displayed. + """) + +- active_scroll: tp.Union[Literal["auto"], Scroll, None] = Either(Null, Auto, Instance(Scroll), default="auto", help=""" ++ active_scroll: tp.Union[tp.Literal["auto"], Scroll, None] = Either(Null, Auto, Instance(Scroll), default="auto", help=""" + Specify a scroll/pinch tool to be active when the plot is displayed. + """) + +- active_tap: tp.Union[Literal["auto"], Tap, None] = Either(Null, Auto, Instance(Tap), default="auto", help=""" ++ active_tap: tp.Union[tp.Literal["auto"], Tap, None] = Either(Null, Auto, Instance(Tap), default="auto", help=""" + Specify a tap/click tool to be active when the plot is displayed. + """) + +- active_multi: tp.Union[Literal["auto"], GestureTool, None] = Nullable(Instance(GestureTool), help=""" ++ active_multi: tp.Union[tp.Literal["auto"], GestureTool, None] = Nullable(Instance(GestureTool), help=""" + Specify an active multi-gesture tool, for instance an edit tool or a range + tool. + +--- a/bokeh/plotting/_tools.py ++++ b/bokeh/plotting/_tools.py +@@ -24,6 +24,7 @@ from typing import ( + Dict, + Iterator, + List, ++ Literal, + NamedTuple, + Optional, + Sequence, +@@ -32,9 +33,6 @@ from typing import ( + cast, + ) + +-# External imports +-from typing_extensions import Literal +- + # Bokeh imports + from ..models import HoverTool, Plot, Tool, Toolbar + from ..models.tools import Drag, InspectTool, Scroll, Tap +--- a/bokeh/util/browser.py ++++ b/bokeh/util/browser.py +@@ -21,10 +21,7 @@ log = logging.getLogger(__name__) + # Standard library imports + import webbrowser + from os.path import abspath +-from typing import Optional, cast +- +-# External imports +-from typing_extensions import Literal, Protocol ++from typing import Literal, Optional, Protocol, cast + + # Bokeh imports + from ..settings import settings +--- a/setup.py ++++ b/setup.py +@@ -92,7 +92,6 @@ REQUIRES = [ + 'pillow >=7.1.0', + 'packaging >=16.8', + 'tornado >=5.1', +- 'typing_extensions >=3.7.4', + ] + + # if this is just conda-build skimming information, skip all this actual work From b774e72bb9ee4add0201fe9c9386f498eda581a8bded0a553fd39001a82e0d19 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 28 May 2021 21:00:11 +0000 Subject: [PATCH 2/4] Revert OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-bokeh?expand=0&rev=43 --- python-bokeh.changes | 6 -- python-bokeh.spec | 7 +-- stdlib-typing_extensions.patch | 109 --------------------------------- 3 files changed, 3 insertions(+), 119 deletions(-) delete mode 100644 stdlib-typing_extensions.patch diff --git a/python-bokeh.changes b/python-bokeh.changes index d206a7c..f3b33be 100644 --- a/python-bokeh.changes +++ b/python-bokeh.changes @@ -1,9 +1,3 @@ -------------------------------------------------------------------- -Fri May 28 16:02:43 UTC 2021 - Matej Cepl - -- Add stdlib-typing_extensions.patch which removes dependency on - typing_extensions package (gh#bokeh/bokeh#11307). - ------------------------------------------------------------------- Sat Feb 27 11:27:05 UTC 2021 - Michael Ströder diff --git a/python-bokeh.spec b/python-bokeh.spec index b5acca1..976ad81 100644 --- a/python-bokeh.spec +++ b/python-bokeh.spec @@ -28,9 +28,6 @@ Summary: Statistical interactive HTML plots for Python License: BSD-3-Clause URL: https://github.com/bokeh/bokeh/ Source: https://files.pythonhosted.org/packages/source/b/bokeh/bokeh-%{version}.tar.gz -# PATCH-FEATURE-UPSTREAM stdlib-typing_extensions.patch gh#bokeh/bokeh#11307 mcepl@suse.com -# Removes dependency on the external package typing_extensions -Patch0: stdlib-typing_extensions.patch BuildRequires: %{python_module Jinja2 >= 2.7} BuildRequires: %{python_module Pillow >= 7.1.0} BuildRequires: %{python_module PyYAML >= 3.10} @@ -39,6 +36,7 @@ BuildRequires: %{python_module numpy >= 1.11.3} BuildRequires: %{python_module packaging >= 16.8} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module tornado >= 5.1} +BuildRequires: %{python_module typing_extensions >= 3.7.4} BuildRequires: fdupes BuildRequires: python-rpm-macros # SECTION test requirements @@ -60,6 +58,7 @@ Requires: python-numpy >= 1.11.3 Requires: python-packaging >= 16.8 Requires: python-python-dateutil >= 2.1 Requires: python-tornado >= 5.1 +Requires: python-typing_extensions >= 3.7.4 Requires(post): update-alternatives Requires(postun):update-alternatives BuildArch: noarch @@ -72,7 +71,7 @@ graphics in the style of D3.js, and favors delivering this capability with interactivity over large or streaming datasets. %prep -%autosetup -p1 -n bokeh-%{version} +%setup -q -n bokeh-%{version} %build %python_build diff --git a/stdlib-typing_extensions.patch b/stdlib-typing_extensions.patch deleted file mode 100644 index fb1ae51..0000000 --- a/stdlib-typing_extensions.patch +++ /dev/null @@ -1,109 +0,0 @@ ---- - bokeh/io/webdriver.py | 3 +-- - bokeh/models/tools.py | 11 +++++------ - bokeh/plotting/_tools.py | 4 +--- - bokeh/util/browser.py | 5 +---- - setup.py | 1 - - 5 files changed, 8 insertions(+), 16 deletions(-) - ---- a/bokeh/io/webdriver.py -+++ b/bokeh/io/webdriver.py -@@ -28,12 +28,11 @@ import atexit - import os - from os.path import devnull, dirname, isfile, join - from shutil import which --from typing import List, Optional -+from typing import List, Literal, Optional - - # External imports - from selenium import webdriver - from selenium.webdriver.remote.webdriver import WebDriver --from typing_extensions import Literal - - #----------------------------------------------------------------------------- - # Globals and constants ---- a/bokeh/models/tools.py -+++ b/bokeh/models/tools.py -@@ -40,7 +40,6 @@ log = logging.getLogger(__name__) - # Standard library imports - import difflib - import typing as tp --from typing_extensions import Literal - - # Bokeh imports - from ..core.enums import ( -@@ -287,25 +286,25 @@ class Toolbar(ToolbarBase): - - ''' - -- active_drag: tp.Union[Literal["auto"], Drag, None] = Either(Null, Auto, Instance(Drag), default="auto", help=""" -+ active_drag: tp.Union[tp.Literal["auto"], Drag, None] = Either(Null, Auto, Instance(Drag), default="auto", help=""" - Specify a drag tool to be active when the plot is displayed. - """) - -- active_inspect: tp.Union[Literal["auto"], InspectTool, tp.Sequence[InspectTool], None] = \ -+ active_inspect: tp.Union[tp.Literal["auto"], InspectTool, tp.Sequence[InspectTool], None] = \ - Either(Null, Auto, Instance(InspectTool), Seq(Instance(InspectTool)), default="auto", help=""" - Specify an inspection tool or sequence of inspection tools to be active when - the plot is displayed. - """) - -- active_scroll: tp.Union[Literal["auto"], Scroll, None] = Either(Null, Auto, Instance(Scroll), default="auto", help=""" -+ active_scroll: tp.Union[tp.Literal["auto"], Scroll, None] = Either(Null, Auto, Instance(Scroll), default="auto", help=""" - Specify a scroll/pinch tool to be active when the plot is displayed. - """) - -- active_tap: tp.Union[Literal["auto"], Tap, None] = Either(Null, Auto, Instance(Tap), default="auto", help=""" -+ active_tap: tp.Union[tp.Literal["auto"], Tap, None] = Either(Null, Auto, Instance(Tap), default="auto", help=""" - Specify a tap/click tool to be active when the plot is displayed. - """) - -- active_multi: tp.Union[Literal["auto"], GestureTool, None] = Nullable(Instance(GestureTool), help=""" -+ active_multi: tp.Union[tp.Literal["auto"], GestureTool, None] = Nullable(Instance(GestureTool), help=""" - Specify an active multi-gesture tool, for instance an edit tool or a range - tool. - ---- a/bokeh/plotting/_tools.py -+++ b/bokeh/plotting/_tools.py -@@ -24,6 +24,7 @@ from typing import ( - Dict, - Iterator, - List, -+ Literal, - NamedTuple, - Optional, - Sequence, -@@ -32,9 +33,6 @@ from typing import ( - cast, - ) - --# External imports --from typing_extensions import Literal -- - # Bokeh imports - from ..models import HoverTool, Plot, Tool, Toolbar - from ..models.tools import Drag, InspectTool, Scroll, Tap ---- a/bokeh/util/browser.py -+++ b/bokeh/util/browser.py -@@ -21,10 +21,7 @@ log = logging.getLogger(__name__) - # Standard library imports - import webbrowser - from os.path import abspath --from typing import Optional, cast -- --# External imports --from typing_extensions import Literal, Protocol -+from typing import Literal, Optional, Protocol, cast - - # Bokeh imports - from ..settings import settings ---- a/setup.py -+++ b/setup.py -@@ -92,7 +92,6 @@ REQUIRES = [ - 'pillow >=7.1.0', - 'packaging >=16.8', - 'tornado >=5.1', -- 'typing_extensions >=3.7.4', - ] - - # if this is just conda-build skimming information, skip all this actual work From 6695531c4989647a06edcea8ac523f21cc5b7786a826f4f2f089847be0b84fee Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 28 May 2021 21:00:42 +0000 Subject: [PATCH 3/4] spec-cleaner OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-bokeh?expand=0&rev=44 --- python-bokeh.spec | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/python-bokeh.spec b/python-bokeh.spec index 976ad81..7973a9a 100644 --- a/python-bokeh.spec +++ b/python-bokeh.spec @@ -16,11 +16,10 @@ # -# tests suite disabled by default. See below. -%bcond_with tests - %define skip_python2 1 %define skip_python36 1 +# tests suite disabled by default. See below. +%bcond_with tests Name: python-bokeh Version: 2.3.0 Release: 0 @@ -39,17 +38,6 @@ BuildRequires: %{python_module tornado >= 5.1} BuildRequires: %{python_module typing_extensions >= 3.7.4} BuildRequires: fdupes BuildRequires: python-rpm-macros -# SECTION test requirements -%if %{with tests} -BuildRequires: %{python_module beautifulsoup4} -BuildRequires: %{python_module flaky} -BuildRequires: %{python_module pytest} -BuildRequires: %{python_module python-dateutil >= 2.1} -BuildRequires: %{python_module selenium} -# Note: If you manage to activate the test suite, try to patch external mock out. -BuildRequires: %{python_module mock} -%endif -# /SECTION BuildConflicts: python-buildservice-tweak Requires: python-Jinja2 >= 2.7 Requires: python-Pillow >= 7.1.0 @@ -62,6 +50,17 @@ Requires: python-typing_extensions >= 3.7.4 Requires(post): update-alternatives Requires(postun):update-alternatives BuildArch: noarch +# SECTION test requirements +%if %{with tests} +BuildRequires: %{python_module beautifulsoup4} +BuildRequires: %{python_module flaky} +# Note: If you manage to activate the test suite, try to patch external mock out. +BuildRequires: %{python_module mock} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module python-dateutil >= 2.1} +BuildRequires: %{python_module selenium} +%endif +# /SECTION %python_subpackages %description From 9444f7773a397ad8b97b80c6c763a772310b0a37b68e30b067f6d2290395cf01 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sat, 5 Jun 2021 12:56:09 +0000 Subject: [PATCH 4/4] Add changelog OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-bokeh?expand=0&rev=45 --- python-bokeh.changes | 5 +++++ python-bokeh.spec | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/python-bokeh.changes b/python-bokeh.changes index f3b33be..802a6dc 100644 --- a/python-bokeh.changes +++ b/python-bokeh.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Jun 5 12:55:54 UTC 2021 - Matej Cepl + +- Test suite complete useless. + ------------------------------------------------------------------- Sat Feb 27 11:27:05 UTC 2021 - Michael Ströder diff --git a/python-bokeh.spec b/python-bokeh.spec index 7973a9a..137c6c4 100644 --- a/python-bokeh.spec +++ b/python-bokeh.spec @@ -19,7 +19,7 @@ %define skip_python2 1 %define skip_python36 1 # tests suite disabled by default. See below. -%bcond_with tests +%bcond_with tests Name: python-bokeh Version: 2.3.0 Release: 0 @@ -56,8 +56,11 @@ BuildRequires: %{python_module beautifulsoup4} BuildRequires: %{python_module flaky} # Note: If you manage to activate the test suite, try to patch external mock out. BuildRequires: %{python_module mock} +BuildRequires: %{python_module nbconvert} +BuildRequires: %{python_module networkx} BuildRequires: %{python_module pytest} BuildRequires: %{python_module python-dateutil >= 2.1} +BuildRequires: %{python_module requests} BuildRequires: %{python_module selenium} %endif # /SECTION @@ -91,7 +94,7 @@ with interactivity over large or streaming datasets. %check # Running the test suite (with datafiles from the GitHub archive) fails # due to missing server/client setups, chromedriver, selenium etc. -%pytest --no-js +%pytest -k 'not (selenium or sampledata)' %endif %post