Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions ipykernel/zmqshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from jupyter_client.session import Session, extract_header
from jupyter_core.paths import jupyter_runtime_dir
from traitlets import Any, CBool, CBytes, Dict, Instance, Type, default, observe
from traitlets.config import Config

from ipykernel import connect_qtconsole, get_connection_file, get_connection_info
from ipykernel.displayhook import ZMQShellDisplayHook
Expand Down Expand Up @@ -472,6 +473,20 @@ def subshell(self, arg_s):
class ZMQInteractiveShell(InteractiveShell):
"""A subclass of InteractiveShell for ZMQ."""

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

# tqdm has an incorrect detection of ZMQInteractiveShell when launch via
# a scheduler that bypass IPKernelApp Think of JupyterHub cluster
# spawners and co. as of end of Feb 2025, the maintainer has been
# unresponsive for 5 months, to our fix, so we implement a workaround. I
# don't like it but we have few other choices.
# See https://github.com/tqdm/tqdm/pull/1628
if "IPKernelApp" not in self.config:
self.config["IPKernelApp"] = Config(
{"tqdm": "dummy value for https://github.com/tqdm/tqdm/pull/1628"}
)

displayhook_class = Type(ZMQShellDisplayHook)
display_pub_class = Type(ZMQDisplayPublisher)
data_pub_class = Any() # type:ignore[assignment]
Expand Down
Loading