Upgrading ipykernel 6 to 7
Breaking6.31.0 → 7.4.0Breaking6Security1Platform3Deprecated1New11Changed19Fixed31Other117
BreakingUpgrade verdict
5 breaking changes and 3 platform requirement changes and a security fix.
In plain terms
- Removes modules deprecated since 4.3 (2016).
- Removes deprecated ipyparallel methods that are now broken.
- The separate control message queue is gone, which may affect tools that relied on it.
- Most users should be fine, but libraries that rely on internal assumptions may break; you can pin ipykernel below 7 if needed.
Must act Top 5 of 10 that need code or config changes
Python requirement changed in 7.4.0: >=3.9 → >=3.11.
Adds nest-asyncio2 >=1.7.0.
Drops nest-asyncio, psutil.
What you must change
Breaking5
Removes modules deprecated since 4.3 (2016).
Removes deprecated ipyparallel methods that are now broken.
Removes the control queue.
Marks the release as potentially backwards incompatible due to architectural changes, though it aims to be compatible when subshells are unused.
Replaces Tornado with AnyIO.
TornadoAnyIOSecurity1
Creates the debugger tmp directory with 0o700 permissions.
Platform3
Bumps minimum Python to 3.11, updates linting and drops dead branches.
Drops support for Python 3.9.
Drops support for Python 3.8.
Deprecations to plan for
Deprecated1
Suggests making implementations of some function always return awaitable.
API changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- removed:
method ControlThread.run() - removed:
method ControlThread.stop() - removed:
variable CONTROL_THREAD_NAME - changed:
class ControlThread(Thread) → class ControlThread(BaseThread)
- removed:
class ZMQDataPublisher(Configurable) - removed:
field ZMQDataPublisher.parent_header - removed:
field ZMQDataPublisher.pub_socket - removed:
field ZMQDataPublisher.session - removed:
field ZMQDataPublisher.topic - removed:
function publish_data(data) - removed:
method ZMQDataPublisher.publish_data(data) - removed:
method ZMQDataPublisher.set_parent(parent)
- changed:
constructor Debugger(log, debugpy_stream, event_callback, shell_socket, session, just_my_code=…) → constructor Debugger(log, debugpy_stream, event_callback, shell_socket, session, kernel_modules, just_my_code=…, filter_internal_frames=…)
- removed:
field ZMQShellDisplayHook.parent_header - added:
constructor ZMQShellDisplayHook(*args, **kwargs) - added:
method ZMQDisplayHook.reset_thread_parent(token) - added:
method ZMQDisplayHook.set_thread_parent(parent) - added:
method ZMQShellDisplayHook.register_hook(hook) - added:
method ZMQShellDisplayHook.reset_thread_parent(token) - added:
method ZMQShellDisplayHook.set_thread_parent(parent) - added:
method ZMQShellDisplayHook.unregister_hook(hook) - added:
property ZMQDisplayHook.parent_header - added:
property ZMQShellDisplayHook.parent_header
- added:
function get_shell_stream(kernel)
- changed:
constructor Heartbeat(context, addr=…) → constructor Heartbeat(context, addr=…, *, curve_publickey=…, curve_secretkey=…)
- changed:
method InProcessKernelClient.execute(code, silent=…, store_history=…, user_expressions=…, allow_stdin=…) → method InProcessKernelClient.execute(code: str, silent: bool=…, store_history: bool=…, user_expressions: dict[str, Any] | None=…, allow_stdin: bool | None=…, stop_on_error: bool=…) -> str - changed:
method InProcessKernelClient.get_connection_info() → method InProcessKernelClient.get_connection_info(session: bool=…) -> KernelConnectionInfo
- changed:
constructor IOPubThread(socket, pipe=…) → constructor IOPubThread(socket, pipe=…, session=…) - changed:
method OutStream.write(string: str) -> Optional[int] → method OutStream.write(string: str) -> int | None - added:
method OutStream.reset_thread_parent(token) - added:
method OutStream.set_thread_parent(parent) - added:
variable logger
- added:
field IPythonKernel.compiler_class - added:
field IPythonKernel.debugger_class
- changed:
method IPKernelApp.write_connection_file() → method IPKernelApp.write_connection_file(**kwargs: Any) -> None - added:
field IPKernelApp.curve_publickey: Bytes | None - added:
field IPKernelApp.curve_secretkey: Bytes | None - added:
field IPKernelApp.shell_channel_thread
- removed:
async method Kernel.abort_request(stream, ident, parent) - removed:
async method Kernel.apply_request(stream, ident, parent) - removed:
async method Kernel.clear_request(stream, idents, parent) - removed:
async method Kernel.dispatch_queue() - removed:
async method Kernel.do_one_iteration() - removed:
async method Kernel.process_one(wait=…) - removed:
field Kernel.aborted - removed:
method Kernel.do_apply(content, bufs, msg_id, reply_metadata) - removed:
method Kernel.do_clear() - removed:
method Kernel.schedule_dispatch(dispatch, *args) - changed:
async method Kernel.dispatch_shell(msg) → async method Kernel.dispatch_shell(msg, /, subshell_id: str | None=…, *, concurrent: bool=…) - changed:
field Kernel.processes: dict[str, psutil.Process] → field Kernel.processes: dict[int, t.Any] - changed:
method Kernel.do_complete(code, cursor_pos) → async method Kernel.do_complete(code, cursor_pos) - changed:
method Kernel.do_execute(code, silent, store_history=…, user_expressions=…, allow_stdin=…, *, cell_meta=…, cell_id=…) → async method Kernel.do_execute(code, silent, store_history=…, user_expressions=…, allow_stdin=…, *, cell_meta=…, cell_id=…) - changed:
method Kernel.do_history(hist_access_type, output, raw, session=…, start=…, stop=…, n=…, pattern=…, unique=…) → async method Kernel.do_history(hist_access_type, output, raw, session=…, start=…, stop=…, n=…, pattern=…, unique=…) - changed:
method Kernel.do_inspect(code, cursor_pos, detail_level=…, omit_sections=…) → async method Kernel.do_inspect(code, cursor_pos, detail_level=…, omit_sections=…) - changed:
method Kernel.do_is_complete(code) → async method Kernel.do_is_complete(code) - changed:
method Kernel.do_shutdown(restart) → async method Kernel.do_shutdown(restart) - changed:
method Kernel.getpass(prompt=…, stream=…) → method Kernel.getpass(prompt: str=…, stream: t.TextIO | None=…, *, echo_char: str | None=…) -> str - added:
async method Kernel.create_subshell_request(socket, ident, parent) -> None - added:
async method Kernel.delete_subshell_request(socket, ident, parent) -> None - added:
async method Kernel.list_subshell_request(socket, ident, parent) -> None - added:
async method Kernel.shell_channel_thread_main(msg) - added:
async method Kernel.shell_main(subshell_id: str | None, msg) - added:
field Kernel.filter_internal_frames - added:
field Kernel.shell_channel_thread - added:
variable T - added:
variable psutil: t.Any | None
- changed:
constructor ParentPollerUnix() → constructor ParentPollerUnix(parent_pid=…)
- removed:
class CannedArray(CannedObject) - removed:
class CannedBuffer(CannedBytes) - removed:
class CannedBytes(CannedObject) - removed:
class CannedCell(CannedObject) - removed:
class CannedClass(CannedObject) - removed:
class CannedFunction(CannedObject) - removed:
class CannedMemoryView(CannedBytes) - removed:
class CannedObject - removed:
class Reference(CannedObject) - removed:
constructor CannedArray(obj) - removed:
constructor CannedBytes(obj) - removed:
constructor CannedCell(cell) - removed:
constructor CannedClass(cls) - removed:
constructor CannedFunction(f) - removed:
constructor CannedObject(obj, keys=…, hook=…) - removed:
constructor Reference(name) - removed:
field CannedBuffer.wrap - removed:
field CannedMemoryView.wrap - removed:
function can(obj) - removed:
function can_class(obj) - removed:
function can_dict(obj) - removed:
function can_sequence(obj) - removed:
function interactive(f) - removed:
function istype(obj, check) - removed:
function uncan(obj, g=…) - removed:
function uncan_dict(obj, g=…) - removed:
function uncan_sequence(obj, g=…) - removed:
function use_cloudpickle() - removed:
function use_dill() - removed:
method CannedArray.get_object(g=…) - removed:
method CannedBytes.get_object(g=…) - removed:
method CannedCell.get_object(g=…) - removed:
method CannedClass.get_object(g=…) - removed:
method CannedFunction.get_object(g=…) - removed:
method CannedObject.get_object(g=…) - removed:
method Reference.get_object(g=…) - removed:
static method CannedBytes.wrap(buf: typing.Union[memoryview, bytes, typing.SupportsBytes]) -> bytes - removed:
variable PICKLE_PROTOCOL - removed:
variable buffer - removed:
variable can_map - removed:
variable cell_type - removed:
variable class_type - removed:
variable sequence_types - removed:
variable uncan_map: dict[type, typing.Any]
- removed:
function deserialize_object(buffers, g=…) - removed:
function pack_apply_message(f, args, kwargs, buffer_threshold=…, item_threshold=…) - removed:
function serialize_object(obj, buffer_threshold=…, item_threshold=…) - removed:
function unpack_apply_message(bufs, g=…, copy=…)
- added:
class ShellChannelThread(BaseThread) - added:
constructor ShellChannelThread(context: zmq.Context[Any], **kwargs) - added:
method ShellChannelThread.run() -> None - added:
property ShellChannelThread.manager -> SubshellManager
- added:
class SocketPair - added:
constructor SocketPair(context: zmq.Context[Any], name: str) - added:
field SocketPair.from_socket: zmq.Socket[Any] - added:
field SocketPair.to_socket: zmq.Socket[Any] - added:
field SocketPair.to_stream: ZMQStream | None - added:
method SocketPair.close() - added:
method SocketPair.on_recv(io_loop: IOLoop, on_recv_callback, copy: bool=…)
- added:
class SubshellThread(BaseThread) - added:
constructor SubshellThread(subshell_id: str, context: zmq.Context[Any], **kwargs) - added:
method SubshellThread.run() -> None
- added:
class SubshellManager - added:
class UnknownSubshellError(KeyError) - added:
constructor SubshellManager(context: zmq.Context[t.Any], shell_channel_io_loop: IOLoop, shell_stream: ZMQStream) - added:
constructor UnknownSubshellError(subshell_id: str) -> None - added:
method SubshellManager.close() -> None - added:
method SubshellManager.get_shell_channel_to_subshell_pair(subshell_id: str | None) -> SocketPair - added:
method SubshellManager.get_shell_channel_to_subshell_socket(subshell_id: str | None) -> zmq.Socket[t.Any] - added:
method SubshellManager.get_subshell_aborting(subshell_id: str) -> bool - added:
method SubshellManager.get_subshell_asyncio_lock(subshell_id: str) -> asyncio.Lock - added:
method SubshellManager.get_subshell_to_shell_channel_socket(subshell_id: str | None) -> zmq.Socket[t.Any] - added:
method SubshellManager.list_subshell() -> list[str] - added:
method SubshellManager.set_on_recv_callback(on_recv_callback) - added:
method SubshellManager.set_subshell_aborting(subshell_id: str, aborting: bool) -> None - added:
method SubshellManager.subshell_id_from_thread_id(thread_id: int) -> str | None
- added:
class BaseThread(Thread) - added:
constructor BaseThread(**kwargs) - added:
function make_selector_io_loop() -> IOLoop - added:
method BaseThread.run() -> None - added:
method BaseThread.stop() -> None - added:
variable CONTROL_THREAD_NAME - added:
variable SHELL_CHANNEL_THREAD_NAME
- added:
class LazyDict(Mapping[str, t.Any]) - added:
constructor LazyDict(dict) - added:
variable T - added:
variable U - added:
variable V
- removed:
field ZMQDisplayPublisher.parent_header - removed:
field ZMQInteractiveShell.parent_header - changed:
method ZMQDisplayPublisher.publish(data, metadata=…, transient=…, update=…) → method ZMQDisplayPublisher.publish(data, metadata=…, *, transient=…, update=…, **kwargs) - changed:
method ZMQInteractiveShell.enable_gui(gui) → method ZMQInteractiveShell.enable_gui(gui: typing.Any=…) -> None - added:
constructor ZMQDisplayPublisher(*args, **kwargs) - added:
constructor ZMQInteractiveShell(*args, **kwargs) - added:
method KernelMagics.subshell(arg_s) - added:
method ZMQDisplayPublisher.reset_thread_parent(token) - added:
method ZMQDisplayPublisher.set_thread_parent(parent) - added:
method ZMQInteractiveShell.reset_thread_parent(tokens) - added:
method ZMQInteractiveShell.set_thread_parent(parent) - added:
property ZMQDisplayPublisher.parent_header - added:
property ZMQInteractiveShell.parent_header