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

ipywidgets 7.x change comm manager and channel names #284

Open
morlic opened this issue Nov 14, 2024 · 2 comments
Open

ipywidgets 7.x change comm manager and channel names #284

morlic opened this issue Nov 14, 2024 · 2 comments

Comments

@morlic
Copy link

morlic commented Nov 14, 2024

Metakernel creates a new CommManager which is incompatible with jupyter widgets where a global singleton CommManager is used. In addition, the comm channel name was changed from ipython.widget to jupyter.widget and jupyter.widget.control was added.

https://github.com/Calysto/metakernel/blob/main/metakernel/_metakernel.py#L155

The correct comm registration (based on IPythonKernel) is:

    self.comm_manager = comm.get_comm_manager() # Do not create a new comm manager, the rest of the system uses a singleton
    comm_msg_types = ["comm_open", "comm_msg", "comm_close"]
    for msg_type in comm_msg_types:
        self.shell_handlers[msg_type] = getattr(self.comm_manager, msg_type)

    import ipywidgets as widgets
    widgets.register_comm_target() # Does the registration on behalf of ipywidgets

I'll see if I'll have time for a pull request :)

@morlic
Copy link
Author

morlic commented Nov 14, 2024

jupyter commit - martinRenou/ipywidgets@a284fd4

@dsblank
Copy link
Member

dsblank commented Nov 14, 2024

@morlic thanks for the note, and possible PR :)

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

No branches or pull requests

2 participants