Skip to content

Commit dca55bf

Browse files
[pre-commit.ci] pre-commit autoupdate (#1108)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Steven Silvester <[email protected]>
1 parent aa53dce commit dca55bf

18 files changed

+33
-20
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ repos:
2121
- id: trailing-whitespace
2222

2323
- repo: https://github.com/python-jsonschema/check-jsonschema
24-
rev: 0.21.0
24+
rev: 0.22.0
2525
hooks:
2626
- id: check-github-workflows
2727

@@ -31,12 +31,12 @@ repos:
3131
- id: mdformat
3232

3333
- repo: https://github.com/psf/black
34-
rev: 23.1.0
34+
rev: 23.3.0
3535
hooks:
3636
- id: black
3737

3838
- repo: https://github.com/charliermarsh/ruff-pre-commit
39-
rev: v0.0.254
39+
rev: v0.0.260
4040
hooks:
4141
- id: ruff
4242
args: ["--fix"]

ipykernel/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
version_info = tuple(parts)
1818

1919
kernel_protocol_version_info = (5, 3)
20-
kernel_protocol_version = "%s.%s" % kernel_protocol_version_info
20+
kernel_protocol_version = "{}.{}".format(*kernel_protocol_version_info)

ipykernel/comm/comm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def __init__(
8080
"The `ipykernel.comm.Comm` class has been deprecated. Please use the `comm` module instead."
8181
"For creating comms, use the function `from comm import create_comm`.",
8282
DeprecationWarning,
83+
stacklevel=2,
8384
)
8485

8586
# Handle differing arguments between base classes.

ipykernel/gui/gtk3embed.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
import sys
1515
import warnings
1616

17-
warnings.warn("The Gtk3 event loop for ipykernel is deprecated", category=DeprecationWarning)
17+
warnings.warn(
18+
"The Gtk3 event loop for ipykernel is deprecated", category=DeprecationWarning, stacklevel=2
19+
)
1820

1921
# Third-party
2022
import gi

ipykernel/gui/gtkembed.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
import sys
1515
import warnings
1616

17-
warnings.warn("The Gtk3 event loop for ipykernel is deprecated", category=DeprecationWarning)
17+
warnings.warn(
18+
"The Gtk3 event loop for ipykernel is deprecated", category=DeprecationWarning, stacklevel=2
19+
)
1820

1921
# Third-party
2022
import gobject

ipykernel/iostream.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ def _setup_pipe_in(self):
134134
except zmq.ZMQError as e:
135135
warnings.warn(
136136
"Couldn't bind IOPub Pipe to 127.0.0.1: %s" % e
137-
+ "\nsubprocess output will be unavailable."
137+
+ "\nsubprocess output will be unavailable.",
138+
stacklevel=2,
138139
)
139140
self._pipe_flag = False
140141
pipe_in.close()

ipykernel/ipkernel.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,5 +704,6 @@ def __init__(self, *args, **kwargs): # pragma: no cover
704704
warnings.warn(
705705
"Kernel is a deprecated alias of ipykernel.ipkernel.IPythonKernel",
706706
DeprecationWarning,
707+
stacklevel=2,
707708
)
708709
super().__init__(*args, **kwargs)

ipykernel/kernelspec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def start(self):
227227
)
228228
opts = parser.parse_args(self.argv)
229229
if opts.env:
230-
opts.env = {k: v for (k, v) in opts.env}
230+
opts.env = dict(opts.env)
231231
try:
232232
dest = install(
233233
user=opts.user,

ipykernel/parentpoller.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ def run(self):
115115
"""Parent poll failed. If the frontend dies,
116116
the kernel may be left running. Please let us know
117117
about your system (bitness, Python, etc.) at
118-
118+
119+
stacklevel=2,
119120
)
120121
return

ipykernel/pickleutil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def get_object(self, g=None):
300300
data = self.buffers[0]
301301
if self.pickled:
302302
# we just pickled it
303-
return pickle.loads(data)
303+
return pickle.loads(data) # noqa
304304
else:
305305
return frombuffer(data, dtype=self.dtype).reshape(self.shape)
306306

0 commit comments

Comments
 (0)