Skip to content

Commit c6d5ad6

Browse files
authored
Unpin pytest-asyncio and update ruff config (#1209)
1 parent 05c6153 commit c6d5ad6

16 files changed

+74
-75
lines changed

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
]
3838

3939
try:
40-
import enchant
40+
import enchant # noqa: F401
4141

4242
extensions += ["sphinxcontrib.spelling"]
4343
except ImportError:

hatch_build.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""A custom hatch build hook for ipykernel."""
2-
import os
32
import shutil
43
import sys
54
from pathlib import Path

ipykernel/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
kernel_protocol_version_info,
55
version_info,
66
)
7-
from .connect import *
7+
from .connect import * # noqa: F403

ipykernel/compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def murmur2_x86(data, seed):
4545
return h
4646

4747

48-
convert_to_long_pathname = lambda filename: filename
48+
convert_to_long_pathname = lambda filename: filename # noqa: E731
4949

5050
if sys.platform == "win32":
5151
try:

ipykernel/datapub.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1+
# Copyright (c) IPython Development Team.
2+
# Distributed under the terms of the Modified BSD License.
3+
14
"""Publishing native (typically pickled) objects.
25
"""
36

47
import warnings
58

6-
warnings.warn(
7-
"ipykernel.datapub is deprecated. It has moved to ipyparallel.datapub",
8-
DeprecationWarning,
9-
stacklevel=2,
10-
)
11-
12-
# Copyright (c) IPython Development Team.
13-
# Distributed under the terms of the Modified BSD License.
14-
159
from traitlets import Any, CBytes, Dict, Instance
1610
from traitlets.config import Configurable
1711

@@ -26,6 +20,12 @@
2620

2721
from jupyter_client.session import Session, extract_header
2822

23+
warnings.warn(
24+
"ipykernel.datapub is deprecated. It has moved to ipyparallel.datapub",
25+
DeprecationWarning,
26+
stacklevel=2,
27+
)
28+
2929

3030
class ZMQDataPublisher(Configurable):
3131
"""A zmq data publisher."""

ipykernel/debugger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
try:
2323
# This import is required to have the next ones working...
24-
from debugpy.server import api
24+
from debugpy.server import api # noqa: F401
2525

2626
from _pydevd_bundle import pydevd_frame_utils # isort: skip
2727
from _pydevd_bundle.pydevd_suspended_frames import ( # isort: skip

ipykernel/eventloops.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -484,24 +484,24 @@ def set_qt_api_env_from_gui(gui):
484484
else:
485485
if gui == "qt5":
486486
try:
487-
import PyQt5
487+
import PyQt5 # noqa: F401
488488

489489
os.environ["QT_API"] = "pyqt5"
490490
except ImportError:
491491
try:
492-
import PySide2
492+
import PySide2 # noqa: F401
493493

494494
os.environ["QT_API"] = "pyside2"
495495
except ImportError:
496496
os.environ["QT_API"] = "pyqt5"
497497
elif gui == "qt6":
498498
try:
499-
import PyQt6
499+
import PyQt6 # noqa: F401
500500

501501
os.environ["QT_API"] = "pyqt6"
502502
except ImportError:
503503
try:
504-
import PySide6
504+
import PySide6 # noqa: F401
505505

506506
os.environ["QT_API"] = "pyside6"
507507
except ImportError:
@@ -516,7 +516,7 @@ def set_qt_api_env_from_gui(gui):
516516

517517
# Do the actual import now that the environment variable is set to make sure it works.
518518
try:
519-
from IPython.external.qt_for_kernel import QtCore, QtGui
519+
pass
520520
except Exception as e:
521521
# Clear the environment variable for the next attempt.
522522
if "QT_API" in os.environ:

ipykernel/gui/gtk3embed.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414
import sys
1515
import warnings
1616

17-
warnings.warn(
18-
"The Gtk3 event loop for ipykernel is deprecated", category=DeprecationWarning, stacklevel=2
19-
)
20-
2117
# Third-party
2218
import gi
2319

2420
gi.require_version("Gdk", "3.0")
2521
gi.require_version("Gtk", "3.0")
26-
from gi.repository import GObject, Gtk
22+
from gi.repository import GObject, Gtk # noqa: E402
23+
24+
warnings.warn(
25+
"The Gtk3 event loop for ipykernel is deprecated", category=DeprecationWarning, stacklevel=2
26+
)
2727

2828
# -----------------------------------------------------------------------------
2929
# Classes and functions

ipykernel/gui/gtkembed.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
import sys
1515
import warnings
1616

17-
warnings.warn(
18-
"The Gtk3 event loop for ipykernel is deprecated", category=DeprecationWarning, stacklevel=2
19-
)
20-
2117
# Third-party
2218
import gobject
2319
import gtk
2420

21+
warnings.warn(
22+
"The Gtk3 event loop for ipykernel is deprecated", category=DeprecationWarning, stacklevel=2
23+
)
24+
2525
# -----------------------------------------------------------------------------
2626
# Classes and functions
2727
# -----------------------------------------------------------------------------

ipykernel/ipkernel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ async def do_execute(
381381
should_run_async = shell.should_run_async
382382
accepts_params = _accepts_parameters(run_cell, ["cell_id"])
383383
else:
384-
should_run_async = lambda cell: False # noqa: ARG005
384+
should_run_async = lambda cell: False # noqa: ARG005, E731
385385
# older IPython,
386386
# use blocking run_cell and wrap it in coroutine
387387

0 commit comments

Comments
 (0)