From f039278f1ed0ebb998fb44f47831938176962aee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Thu, 10 Aug 2023 11:10:57 +0200 Subject: [PATCH 1/2] Relax ipywidgets constraint --- setup.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 1467b49..0a2b5f5 100644 --- a/setup.py +++ b/setup.py @@ -43,18 +43,23 @@ 'Intended Audience :: Science/Research', 'Topic :: Multimedia :: Graphics', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7' + 'Programming Language :: Python :: 3.8' + 'Programming Language :: Python :: 3.9' + 'Programming Language :: Python :: 3.10' + 'Programming Language :: Python :: 3.11' ], python_requires='>=3', install_requires=[ - 'ipywidgets>=7.5.1,<8' + 'ipywidgets>=7.5.1,<9', 'pandas', 'pytz' ], + extras_require={ + 'test': [ + 'pytest' + ] + }, zip_safe=False, include_package_data=True, packages=find_packages(), From 79d5243c8a2db35453a9a8c6cfb8d0b049786b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Wed, 16 Aug 2023 16:01:39 +0200 Subject: [PATCH 2/2] Simplify widget API for newer ipywidgets --- beakerx_base/beakerx_widgets.py | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/beakerx_base/beakerx_widgets.py b/beakerx_base/beakerx_widgets.py index 00667a7..bbb9289 100644 --- a/beakerx_base/beakerx_widgets.py +++ b/beakerx_base/beakerx_widgets.py @@ -82,18 +82,6 @@ def __init__(self, **kwargs): layout = InstanceDict(BeakerxLayout).tag(sync=True, **widget_serialization) - def _ipython_display_(self, **kwargs): - data = { - 'application/vnd.jupyter.widget-view+json': { - 'version_major': 2, - 'version_minor': 0, - 'model_id': self._model_id - } - } - display(data, raw=True) - - self._handle_displayed(**kwargs) - class BeakerxBox(Box): def __init__(self, **kwargs): @@ -107,22 +95,11 @@ def __init__(self, **kwargs): layout = InstanceDict(BeakerxLayout).tag(sync=True, **widget_serialization) - def _ipython_display_(self, **kwargs): - data = { - 'application/vnd.jupyter.widget-view+json': { - 'version_major': 2, - 'version_minor': 0, - 'model_id': self._model_id - }, - 'method': 'display_data' - } - + def _repr_mimebundle_(self, **kwargs): for component in self.components: self.components[component].fireInit() - - display(data, raw=True) - - self._handle_displayed(**kwargs) + + return super(BeakerxBox, self)._repr_mimebundle_(**kwargs) class BeakerxTextArea(Textarea, EasyFormComponent):