Skip to content

Commit 22b4f0f

Browse files
committed
TQDM workaround due to unresponsive maintainer
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`
1 parent b3a0999 commit 22b4f0f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

ipykernel/zmqshell.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,20 @@ def subshell(self, arg_s):
472472
class ZMQInteractiveShell(InteractiveShell):
473473
"""A subclass of InteractiveShell for ZMQ."""
474474

475+
def __init__(self, *args, **kwargs):
476+
super().__init__(*args, **kwargs)
477+
478+
# tqdm has an incorrect detection of ZMQInteractiveShell when launch via
479+
# a scheduler that bypass IPKernelApp Think of JupyterHub cluster
480+
# spawners and co. as of end of Feb 2025, the maintainer has been
481+
# unresponsive for 5 months, to our fix, so we implement a workaround. I
482+
# don't like it but we have few other choices.
483+
# See https://github.com/tqdm/tqdm/pull/1628
484+
if "IPKernelApp" not in self.config:
485+
self.config["IPKernelApp"] = {
486+
"tqdm": "dummy value for https://github.com/tqdm/tqdm/pull/1628"
487+
}
488+
475489
displayhook_class = Type(ZMQShellDisplayHook)
476490
display_pub_class = Type(ZMQDisplayPublisher)
477491
data_pub_class = Any() # type:ignore[assignment]

0 commit comments

Comments
 (0)