From efe872bd668673cae4493108b2361286b7a884c6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Oct 2022 14:49:50 +0000 Subject: [PATCH 1/8] Bump ipytree from 0.2.1 to 0.2.2 Bumps [ipytree](https://github.com/martinRenou/ipytree) from 0.2.1 to 0.2.2. - [Release notes](https://github.com/martinRenou/ipytree/releases) - [Changelog](https://github.com/martinRenou/ipytree/blob/master/RELEASE.md) - [Commits](https://github.com/martinRenou/ipytree/commits) --- updated-dependencies: - dependency-name: ipytree dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements_dev_optional.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_dev_optional.txt b/requirements_dev_optional.txt index 1022e56ec5..54b4ad96b1 100644 --- a/requirements_dev_optional.txt +++ b/requirements_dev_optional.txt @@ -2,7 +2,7 @@ # bsddb3==6.2.6; sys_platform != 'win32' lmdb==1.3.0; sys_platform != 'win32' # optional library requirements for Jupyter -ipytree==0.2.1 +ipytree==0.2.2 # optional library requirements for services # don't let pyup change pinning for azure-storage-blob, need to pin to older # version to get compatibility with azure storage emulator on appveyor (FIXME) From bb163972c97334f96e1133185295dc728e04652e Mon Sep 17 00:00:00 2001 From: jakirkham Date: Tue, 11 Oct 2022 21:59:58 -0700 Subject: [PATCH 2/8] Change `_ipython_display_` to `_repr_mimebundle_` This is the preferred way to handle widget representation now. --- zarr/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zarr/util.py b/zarr/util.py index c9136a63eb..f5e17d76de 100644 --- a/zarr/util.py +++ b/zarr/util.py @@ -533,9 +533,9 @@ def __unicode__(self): def __repr__(self): return self.__unicode__() - def _ipython_display_(self): + def _repr_mimebundle_(self): tree = tree_widget(self.group, expand=self.expand, level=self.level) - tree._ipython_display_() + tree._repr_mimebundle_() return tree From 9395074b0ae751968d17d06d14b9c261a3f62ed1 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Tue, 11 Oct 2022 22:01:05 -0700 Subject: [PATCH 3/8] Use `_repr_mimebundle_` in tests too --- zarr/tests/test_hierarchy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zarr/tests/test_hierarchy.py b/zarr/tests/test_hierarchy.py index a2917acb44..8d1fabbed3 100644 --- a/zarr/tests/test_hierarchy.py +++ b/zarr/tests/test_hierarchy.py @@ -1760,7 +1760,7 @@ def _check_tree(g, expect_bytes, expect_text): assert expect_repr == repr(g.tree()) if ipytree: # noinspection PyProtectedMember - widget = g.tree()._ipython_display_() + widget = g.tree()._repr_mimebundle_() isinstance(widget, ipytree.Tree) From fb67959216c061020e623e366826e183aeeb78f6 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Tue, 11 Oct 2022 22:01:59 -0700 Subject: [PATCH 4/8] Require ipytree 0.2.2+ --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 79ff649dac..c5626db1aa 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ extras_require={ 'jupyter': [ 'notebook', - 'ipytree', + 'ipytree>=0.2.2', ], }, python_requires='>=3.8, <4', From 2db4562beec3f7ae82dde2705371f2b8f1214b9b Mon Sep 17 00:00:00 2001 From: jakirkham Date: Tue, 11 Oct 2022 22:07:14 -0700 Subject: [PATCH 5/8] Require ipywidgets 8.0.0+ Switches to using `_repr_mimebundle_` instead of `_ipython_display_`. Require ipywidgets 8.0.0, as we made the same switch in response. --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index c5626db1aa..9f005ecd39 100644 --- a/setup.py +++ b/setup.py @@ -31,6 +31,7 @@ 'jupyter': [ 'notebook', 'ipytree>=0.2.2', + 'ipywidgets>=8.0.0', ], }, python_requires='>=3.8, <4', From 8a2fff87399a9b80bdbdb268a91ffa7f2486172e Mon Sep 17 00:00:00 2001 From: jakirkham Date: Tue, 11 Oct 2022 22:22:07 -0700 Subject: [PATCH 6/8] Pass `**kwargs` through `_repr_mimebundle_` Needed in some cases with `ipywidgets` objects. --- zarr/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zarr/util.py b/zarr/util.py index f5e17d76de..9f7c4335ba 100644 --- a/zarr/util.py +++ b/zarr/util.py @@ -533,9 +533,9 @@ def __unicode__(self): def __repr__(self): return self.__unicode__() - def _repr_mimebundle_(self): + def _repr_mimebundle_(self, **kwargs): tree = tree_widget(self.group, expand=self.expand, level=self.level) - tree._repr_mimebundle_() + tree._repr_mimebundle_(**kwargs) return tree From fbcbc4e0a5326e2a4cedddf1ebf9ea6f1da48169 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Tue, 11 Oct 2022 22:24:51 -0700 Subject: [PATCH 7/8] Return `_repr_mimebundle_` result from `ipytree` --- zarr/util.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/zarr/util.py b/zarr/util.py index 9f7c4335ba..9fcdac9df7 100644 --- a/zarr/util.py +++ b/zarr/util.py @@ -535,8 +535,7 @@ def __repr__(self): def _repr_mimebundle_(self, **kwargs): tree = tree_widget(self.group, expand=self.expand, level=self.level) - tree._repr_mimebundle_(**kwargs) - return tree + return tree._repr_mimebundle_(**kwargs) def check_array_shape(param, array, shape): From 256e47bcb40b8bcdae914235421260a06a562469 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Tue, 11 Oct 2022 22:34:25 -0700 Subject: [PATCH 8/8] Add `ipywidgets` 8.0.2 Makes this explicit in our requirements. Also should help us track down breakages from it in the future. --- requirements_dev_optional.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements_dev_optional.txt b/requirements_dev_optional.txt index 54b4ad96b1..5a7f2cac7c 100644 --- a/requirements_dev_optional.txt +++ b/requirements_dev_optional.txt @@ -3,6 +3,7 @@ lmdb==1.3.0; sys_platform != 'win32' # optional library requirements for Jupyter ipytree==0.2.2 +ipywidgets==8.0.2 # optional library requirements for services # don't let pyup change pinning for azure-storage-blob, need to pin to older # version to get compatibility with azure storage emulator on appveyor (FIXME)