Skip to content

Commit 108ccb7

Browse files
committed
Remove deprecated shell_streams shim
shell_streams (plural) was deprecated in ipykernel 6.0 (2021) in favor of shell_stream (singular). Remove the trait, default handler, observer, and associated test.
1 parent 770afbe commit 108ccb7

File tree

2 files changed

+0
-47
lines changed

2 files changed

+0
-47
lines changed

ipykernel/kernelbase.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -110,45 +110,10 @@ def _update_eventloop(self, change):
110110
profile_dir = Instance("IPython.core.profiledir.ProfileDir", allow_none=True)
111111
shell_stream = Instance(ZMQStream, allow_none=True)
112112

113-
shell_streams: List[t.Any] = List(
114-
help="""Deprecated shell_streams alias. Use shell_stream
115-
116-
.. versionchanged:: 6.0
117-
shell_streams is deprecated. Use shell_stream.
118-
"""
119-
)
120-
121113
implementation: str
122114
implementation_version: str
123115
banner: str
124116

125-
@default("shell_streams")
126-
def _shell_streams_default(self): # pragma: no cover
127-
warnings.warn(
128-
"Kernel.shell_streams is deprecated in ipykernel 6.0. Use Kernel.shell_stream",
129-
DeprecationWarning,
130-
stacklevel=2,
131-
)
132-
if self.shell_stream is not None:
133-
return [self.shell_stream]
134-
return []
135-
136-
@observe("shell_streams")
137-
def _shell_streams_changed(self, change): # pragma: no cover
138-
warnings.warn(
139-
"Kernel.shell_streams is deprecated in ipykernel 6.0. Use Kernel.shell_stream",
140-
DeprecationWarning,
141-
stacklevel=2,
142-
)
143-
if len(change.new) > 1:
144-
warnings.warn(
145-
"Kernel only supports one shell stream. Additional streams will be ignored.",
146-
RuntimeWarning,
147-
stacklevel=2,
148-
)
149-
if change.new:
150-
self.shell_stream = change.new[0]
151-
152117
control_stream = Instance(ZMQStream, allow_none=True)
153118

154119
debug_shell_socket = Any()

tests/test_kernel_direct.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,6 @@ async def test_direct_debug_request(kernel):
103103
assert reply["header"]["msg_type"] == "debug_reply"
104104

105105

106-
async def test_deprecated_features(kernel):
107-
with warnings.catch_warnings():
108-
warnings.simplefilter("ignore", DeprecationWarning)
109-
header = kernel._parent_header
110-
assert isinstance(header, dict)
111-
shell_streams = kernel.shell_streams
112-
assert len(shell_streams) == 1
113-
assert shell_streams[0] == kernel.shell_stream
114-
warnings.simplefilter("ignore", RuntimeWarning)
115-
kernel.shell_streams = [kernel.shell_stream, kernel.shell_stream]
116-
117-
118106
async def test_process_control(kernel):
119107
from jupyter_client.session import DELIM
120108

0 commit comments

Comments
 (0)