diff --git a/ipykernel/kernelbase.py b/ipykernel/kernelbase.py index 7fa1fb9dc..62d1b2be4 100644 --- a/ipykernel/kernelbase.py +++ b/ipykernel/kernelbase.py @@ -110,45 +110,10 @@ def _update_eventloop(self, change): profile_dir = Instance("IPython.core.profiledir.ProfileDir", allow_none=True) shell_stream = Instance(ZMQStream, allow_none=True) - shell_streams: List[t.Any] = List( - help="""Deprecated shell_streams alias. Use shell_stream - - .. versionchanged:: 6.0 - shell_streams is deprecated. Use shell_stream. - """ - ) - implementation: str implementation_version: str banner: str - @default("shell_streams") - def _shell_streams_default(self): # pragma: no cover - warnings.warn( - "Kernel.shell_streams is deprecated in ipykernel 6.0. Use Kernel.shell_stream", - DeprecationWarning, - stacklevel=2, - ) - if self.shell_stream is not None: - return [self.shell_stream] - return [] - - @observe("shell_streams") - def _shell_streams_changed(self, change): # pragma: no cover - warnings.warn( - "Kernel.shell_streams is deprecated in ipykernel 6.0. Use Kernel.shell_stream", - DeprecationWarning, - stacklevel=2, - ) - if len(change.new) > 1: - warnings.warn( - "Kernel only supports one shell stream. Additional streams will be ignored.", - RuntimeWarning, - stacklevel=2, - ) - if change.new: - self.shell_stream = change.new[0] - control_stream = Instance(ZMQStream, allow_none=True) debug_shell_socket = Any() @@ -216,15 +181,6 @@ def _default_ident(self): # Asyncio lock for main shell thread. _main_asyncio_lock: asyncio.Lock - @property - def _parent_header(self): - warnings.warn( - "Kernel._parent_header is deprecated in ipykernel 6. Use .get_parent()", - DeprecationWarning, - stacklevel=2, - ) - return self.get_parent() - # Time to sleep after flushing the stdout/err buffers in each execute # cycle. While this introduces a hard limit on the minimal latency of the # execute cycle, it helps prevent output synchronization problems for diff --git a/tests/test_kernel_direct.py b/tests/test_kernel_direct.py index f4a2e59b7..4880093b3 100644 --- a/tests/test_kernel_direct.py +++ b/tests/test_kernel_direct.py @@ -4,7 +4,6 @@ # Distributed under the terms of the Modified BSD License. import os -import warnings import pytest @@ -103,18 +102,6 @@ async def test_direct_debug_request(kernel): assert reply["header"]["msg_type"] == "debug_reply" -async def test_deprecated_features(kernel): - with warnings.catch_warnings(): - warnings.simplefilter("ignore", DeprecationWarning) - header = kernel._parent_header - assert isinstance(header, dict) - shell_streams = kernel.shell_streams - assert len(shell_streams) == 1 - assert shell_streams[0] == kernel.shell_stream - warnings.simplefilter("ignore", RuntimeWarning) - kernel.shell_streams = [kernel.shell_stream, kernel.shell_stream] - - async def test_process_control(kernel): from jupyter_client.session import DELIM