From 3f506842619ea835b0267de052a4ed94cbc7368d Mon Sep 17 00:00:00 2001 From: Kirill Kouzoubov Date: Sat, 8 Oct 2022 14:45:26 +1100 Subject: [PATCH] Remove dependency on zmq/tornado #23 This should allow installation on pyolite --- jupyter_ui_poll/_poll.py | 8 ++++---- setup.cfg | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/jupyter_ui_poll/_poll.py b/jupyter_ui_poll/_poll.py index 9949c5e..e99413e 100644 --- a/jupyter_ui_poll/_poll.py +++ b/jupyter_ui_poll/_poll.py @@ -18,14 +18,14 @@ TypeVar, ) -import zmq from IPython import get_ipython -from tornado.queues import QueueEmpty from ._async_thread import AsyncThread T = TypeVar("T") +ZMQ_POLLOUT = 2 # zmq.POLLOUT without zmq dependency + class KernelWrapper: _current: Optional["KernelWrapper"] = None @@ -97,7 +97,7 @@ async def replay(self): sys.stderr.flush() if shell_stream is not None: # 6+ kernel._publish_status("idle", "shell") - shell_stream.flush(zmq.POLLOUT) + shell_stream.flush(ZMQ_POLLOUT) else: kernel._publish_status("idle") @@ -106,7 +106,7 @@ async def do_one_iteration(self): rr = self._kernel.do_one_iteration() if isawaitable(rr): await rr - except QueueEmpty: + except Exception: # pylint: disable=broad-except # it's probably a bug in ipykernel, # .do_one_iteration() should not throw return diff --git a/setup.cfg b/setup.cfg index a29fedc..b3e4d21 100644 --- a/setup.cfg +++ b/setup.cfg @@ -36,8 +36,6 @@ setup_requires = setuptools install_requires = ipython - tornado - pyzmq [options.extras_require]