|
38 | 38 | from jupyter_client.session import Session |
39 | 39 | from tornado import ioloop |
40 | 40 | from tornado.queues import Queue, QueueEmpty |
41 | | -from traitlets import ( |
| 41 | +from traitlets.config.configurable import SingletonConfigurable |
| 42 | +from traitlets.traitlets import ( |
42 | 43 | Any, |
43 | 44 | Bool, |
44 | 45 | Dict, |
|
51 | 52 | default, |
52 | 53 | observe, |
53 | 54 | ) |
54 | | -from traitlets.config.configurable import SingletonConfigurable |
55 | 55 | from zmq.eventloop.zmqstream import ZMQStream |
56 | 56 |
|
57 | 57 | from ipykernel.jsonutil import json_clean |
@@ -95,6 +95,10 @@ def _update_eventloop(self, change): |
95 | 95 | """ |
96 | 96 | ) |
97 | 97 |
|
| 98 | + implementation: str |
| 99 | + implementation_version: str |
| 100 | + banner: str |
| 101 | + |
98 | 102 | @default("shell_streams") |
99 | 103 | def _shell_streams_default(self): |
100 | 104 | warnings.warn( |
@@ -131,7 +135,7 @@ def _shell_streams_changed(self, change): |
131 | 135 | iopub_socket = Any() |
132 | 136 | iopub_thread = Any() |
133 | 137 | stdin_socket = Any() |
134 | | - log = Instance(logging.Logger, allow_none=True) |
| 138 | + log: logging.Logger = Instance(logging.Logger, allow_none=True) # type:ignore[assignment] |
135 | 139 |
|
136 | 140 | # identities: |
137 | 141 | int_id = Integer(-1) |
@@ -263,7 +267,7 @@ def __init__(self, **kwargs): |
263 | 267 | for msg_type in self.control_msg_types: |
264 | 268 | self.control_handlers[msg_type] = getattr(self, msg_type) |
265 | 269 |
|
266 | | - self.control_queue: Queue[Any] = Queue() |
| 270 | + self.control_queue: Queue[t.Any] = Queue() |
267 | 271 |
|
268 | 272 | def dispatch_control(self, msg): |
269 | 273 | self.control_queue.put_nowait(msg) |
@@ -531,7 +535,7 @@ def schedule_dispatch(self, dispatch, *args): |
531 | 535 | def start(self): |
532 | 536 | """register dispatchers for streams""" |
533 | 537 | self.io_loop = ioloop.IOLoop.current() |
534 | | - self.msg_queue: Queue[Any] = Queue() |
| 538 | + self.msg_queue: Queue[t.Any] = Queue() |
535 | 539 | self.io_loop.add_callback(self.dispatch_queue) |
536 | 540 |
|
537 | 541 | self.control_stream.on_recv(self.dispatch_control, copy=False) |
@@ -866,7 +870,7 @@ async def comm_info_request(self, stream, ident, parent): |
866 | 870 | if hasattr(self, "comm_manager"): |
867 | 871 | comms = { |
868 | 872 | k: dict(target_name=v.target_name) |
869 | | - for (k, v) in self.comm_manager.comms.items() |
| 873 | + for (k, v) in self.comm_manager.comms.items() # type:ignore[attr-defined] |
870 | 874 | if v.target_name == target_name or target_name is None |
871 | 875 | } |
872 | 876 | else: |
|
0 commit comments