Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 17, 2024
1 parent 1f70018 commit 6e69a86
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion ipykernel/comm/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
# Distributed under the terms of the Modified BSD License.

import logging
from typing import Any, Dict

import comm.base_comm
import traitlets
import traitlets.config
from typing import Dict, Any

from .comm import Comm

Expand Down
5 changes: 2 additions & 3 deletions ipykernel/debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@

try:
# This import is required to have the next ones working...
from debugpy.server import api # type: ignore[import-untyped]# noqa: F401

from _pydevd_bundle import ( # type:ignore[import-not-found]
pydevd_frame_utils,
) # isort: skip
)
from debugpy.server import api # type: ignore[import-untyped]# noqa: F401
from _pydevd_bundle.pydevd_suspended_frames import ( # type:ignore[import-not-found] # isort: skip
SuspendedFramesManager,
_FramesTracker,
Expand Down
4 changes: 1 addition & 3 deletions ipykernel/inprocess/ipkernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ async def execute_request(self, stream, ident, parent):
with self._redirected_io():
await super().execute_request(stream, ident, parent)

async def start(
self, *, task_status: TaskStatus[None] = TASK_STATUS_IGNORED
) -> None:
async def start(self, *, task_status: TaskStatus[None] = TASK_STATUS_IGNORED) -> None:
"""Override registration of dispatchers for streams."""
if self.shell:
self.shell.exit_now = False
Expand Down
2 changes: 1 addition & 1 deletion ipykernel/inprocess/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
# Distributed under the terms of the Modified BSD License.

from math import inf
from typing import Any

import zmq
import zmq.asyncio
from anyio import create_memory_object_stream
from traitlets import HasTraits, Instance
from typing import Any

# -----------------------------------------------------------------------------
# Dummy socket class
Expand Down
9 changes: 5 additions & 4 deletions ipykernel/ipkernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,7 @@ async def poll_stopped_queue(self):
while True:
await self.debugger.handle_stopped_event()

async def start(
self, *, task_status: TaskStatus[None] = TASK_STATUS_IGNORED
) -> None:
async def start(self, *, task_status: TaskStatus[None] = TASK_STATUS_IGNORED) -> None:
"""Start the kernel."""
if self.shell:
self.shell.exit_now = False
Expand Down Expand Up @@ -643,7 +641,10 @@ def do_is_complete(self, code):
def do_apply(self, content, bufs, msg_id, reply_metadata):
"""Handle an apply request."""
try:
from ipyparallel.serialize import serialize_object, unpack_apply_message # type: ignore[import-not-found]
from ipyparallel.serialize import ( # type: ignore[import-not-found]
serialize_object,
unpack_apply_message,
)
except ImportError:
from .serialize import serialize_object, unpack_apply_message

Expand Down
4 changes: 1 addition & 3 deletions ipykernel/kernelbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,7 @@ def pre_handler_hook(self):
def post_handler_hook(self):
"""Hook to execute after calling message handler"""

async def start(
self, *, task_status: TaskStatus[None] = TASK_STATUS_IGNORED
) -> None:
async def start(self, *, task_status: TaskStatus[None] = TASK_STATUS_IGNORED) -> None:
"""Process messages on shell and control channels"""
async with create_task_group() as tg:
self.control_stop = threading.Event()
Expand Down
2 changes: 1 addition & 1 deletion ipykernel/pickleutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
try:
from ipyparallel.serialize import ( # type: ignore[import-not-found]
codeutil,
) # noqa: F401,
)
except ImportError:
pass
from traitlets.log import get_logger
Expand Down

0 comments on commit 6e69a86

Please sign in to comment.