Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compatibility for ipywidgets>=8 #69

Merged
merged 2 commits into from
Nov 22, 2022
Merged

Add compatibility for ipywidgets>=8 #69

merged 2 commits into from
Nov 22, 2022

Conversation

philippjfr
Copy link
Contributor

@philippjfr philippjfr commented Nov 18, 2022

@philippjfr
Copy link
Contributor Author

@mattpap Could you review and release version 1.3 when you get a chance?

We can then follow up with another PR for bokeh 3.0 compatibility.

@philippjfr
Copy link
Contributor Author

Might need some more testing.

@mattpap
Copy link
Contributor

mattpap commented Nov 21, 2022

@philippjfr, do you intend any further changes to this PR, or can I proceed with merging and releasing a new version?

@philippjfr
Copy link
Contributor Author

Let's proceed. Seemed to work well for me.

@mattpap mattpap merged commit 1c790a0 into main Nov 22, 2022
@mattpap mattpap deleted the ipywidgets_8_compat branch November 22, 2022 09:59
@mattpap
Copy link
Contributor

mattpap commented Nov 22, 2022

The Python side of this still needs updating. With ipywidgets 8.0.2 I'm getting:

export SRC_DIR=/home/mateusz/conda/envs/bk_py310/conda-bld/ipywidgets_bokeh_1669112794075/test_tmp
Traceback (most recent call last):
  File "/home/mateusz/conda/envs/bk_py310/conda-bld/ipywidgets_bokeh_1669112794075/test_tmp/run_test.py", line 2, in <module>
import: 'ipywidgets_bokeh'
    import ipywidgets_bokeh
  File "/home/mateusz/conda/envs/bk_py310/conda-bld/ipywidgets_bokeh_1669112794075/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.11/site-packages/ipywidgets_bokeh/__init__.py", line 1, in <module>
    from .widget import IPyWidget
  File "/home/mateusz/conda/envs/bk_py310/conda-bld/ipywidgets_bokeh_1669112794075/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.11/site-packages/ipywidgets_bokeh/widget.py", line 13, in <module>
    from .kernel import kernel
  File "/home/mateusz/conda/envs/bk_py310/conda-bld/ipywidgets_bokeh_1669112794075/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.11/site-packages/ipywidgets_bokeh/kernel.py", line 142, in <module>
    kernel = BokehKernel.instance()
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mateusz/conda/envs/bk_py310/conda-bld/ipywidgets_bokeh_1669112794075/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.11/site-packages/traitlets/config/configurable.py", line 551, in instance
    inst = cls(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/mateusz/conda/envs/bk_py310/conda-bld/ipywidgets_bokeh_1669112794075/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.11/site-packages/ipywidgets_bokeh/kernel.py", line 128, in __init__
    self.comm_manager = CommManager(parent=self, kernel=self)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'

I already published npm and pip ipywidgets_bokeh 1.3.0 before realizing this.

@mattpap
Copy link
Contributor

mattpap commented Nov 22, 2022

Also, do we expect ipytwidgets_bokeh working with both ipywidgets 7.x and 8.x or only 8.x?

@mattpap
Copy link
Contributor

mattpap commented Nov 22, 2022

Or perhaps this is the issue with ipykernel's CommManger in version 6.18. I couldn't reproduce, because I upgraded ipywidgets but not ipykernel, but conda had most recent version in the build environment.

@mattpap
Copy link
Contributor

mattpap commented Nov 22, 2022

All packages are published now.

@philippjfr
Copy link
Contributor Author

Damn, taking a look now. As far as I could tell it was working with both 7.x and 8.x.

@philippjfr
Copy link
Contributor Author

So those errors are coming from ipykernel 6.18 which was released yesterday and split out Comm and CommManager into a separate package and changed the baseclasses (removing LoggingConfigurable as a baseclass which is what accepted parent). That release seems to have broken half the ecosystem and they already yanked that release from PyPI. They'll hopefully restore that.

@mattpap
Copy link
Contributor

mattpap commented Nov 22, 2022

@philippjfr, I removed the defunct version like this ipykernel 6.*,!=6.18.0 (in meta.yaml) and published 1.3.0.

@philippjfr
Copy link
Contributor Author

Perfect, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IpyCanvas raising errors Wrong widget protocol version Required updates for ipywidgets 8.0
2 participants