Skip to content

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

Open
@morlic

Description

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 :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions