Skip to content

Commit 0f09aa6

Browse files
[pre-commit.ci] pre-commit autoupdate (#1089)Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Steven Silvester <steven.silvester@ieee.org>
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/python-jsonschema/check-jsonschema: 0.19.2 → 0.21.0](python-jsonschema/check-jsonschema@0.19.2...0.21.0) - [github.com/psf/black: 22.12.0 → 23.1.0](psf/black@22.12.0...23.1.0) - [github.com/charliermarsh/ruff-pre-commit: v0.0.236 → v0.0.243](astral-sh/ruff-pre-commit@v0.0.236...v0.0.243) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * sync deps and lint * lint * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * lint * bump pyzmq dep * lint --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Steven Silvester <steven.silvester@ieee.org>
1 parent 1d67450 commit 0f09aa6

File tree

12 files changed

+14
-24
lines changed

12 files changed

+14
-24
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.19.2
24+
rev: 0.21.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: 22.12.0
34+
rev: 23.1.0
3535
hooks:
3636
- id: black
3737

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

ipykernel/compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def murmur2_x86(data, seed):
2929

3030
val = length & 0x03
3131
k = 0
32-
if val == 3: # noqa
32+
if val == 3:
3333
k = (ord(data[rounded_end + 2]) & 0xFF) << 16
3434
if val in [2, 3]:
3535
k |= (ord(data[rounded_end + 1]) & 0xFF) << 8

ipykernel/inprocess/tests/test_kernel.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def kc():
4848

4949

5050
def test_with_cell_id(kc):
51-
5251
with patch_cell_id():
5352
kc.execute("1+1")
5453

ipykernel/iostream.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,6 @@ def write(self, string: str) -> Optional[int]: # type:ignore[override]
557557
msg = "I/O operation on closed file"
558558
raise ValueError(msg)
559559
else:
560-
561560
is_child = not self._is_master_process()
562561
# only touch the buffer in the IO thread to avoid races
563562
with self._buffer_lock:

ipykernel/ipkernel.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
try:
3030
from IPython.core.interactiveshell import _asyncio_runner # type:ignore[attr-defined]
3131
except ImportError:
32-
_asyncio_runner = None
32+
_asyncio_runner = None # type:ignore
3333

3434
try:
3535
from IPython.core.completer import provisionalcompleter as _provisionalcompleter
@@ -366,7 +366,6 @@ async def run_cell(*args, **kwargs):
366366

367367
with_cell_id = _accepts_cell_id(shell.run_cell)
368368
try:
369-
370369
# default case: runner is asyncio and asyncio is already running
371370
# TODO: this should check every case for "are we inside the runner",
372371
# not just asyncio
@@ -626,7 +625,7 @@ def do_apply(self, content, bufs, msg_id, reply_metadata):
626625
try:
627626
from ipyparallel.serialize import serialize_object, unpack_apply_message
628627
except ImportError:
629-
from .serialize import serialize_object, unpack_apply_message # type:ignore
628+
from .serialize import serialize_object, unpack_apply_message
630629

631630
shell = self.shell
632631
try:

ipykernel/jsonutil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def json_clean(obj): # pragma: no cover
9898
it simply sanitizes it so that there will be no encoding errors later.
9999
100100
"""
101-
if int(JUPYTER_CLIENT_MAJOR_VERSION) >= 7: # noqa
101+
if int(JUPYTER_CLIENT_MAJOR_VERSION) >= 7:
102102
return obj
103103

104104
# types that are 'atomic' and ok in json as-is.

ipykernel/kernelapp.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,11 +471,8 @@ def init_io(self):
471471
sys.stderr.flush()
472472
sys.stderr = outstream_factory(self.session, self.iopub_thread, "stderr", echo=e_stderr)
473473
if hasattr(sys.stderr, "_original_stdstream_copy"):
474-
475474
for handler in self.log.handlers:
476-
if isinstance(handler, StreamHandler) and (
477-
handler.stream.buffer.fileno() == 2 # noqa
478-
):
475+
if isinstance(handler, StreamHandler) and (handler.stream.buffer.fileno() == 2):
479476
self.log.debug("Seeing logger to stderr, rerouting to raw filedescriptor.")
480477

481478
handler.stream = TextIOWrapper(

ipykernel/kernelbase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ async def usage_request(self, stream, ident, parent):
999999
cpu_percent = psutil.cpu_percent()
10001000
# https://psutil.readthedocs.io/en/latest/index.html?highlight=cpu#psutil.cpu_percent
10011001
# The first time cpu_percent is called it will return a meaningless 0.0 value which you are supposed to ignore.
1002-
if cpu_percent is not None and cpu_percent != 0.0: # noqa
1002+
if cpu_percent is not None and cpu_percent != 0.0:
10031003
reply_content["host_cpu_percent"] = cpu_percent
10041004
reply_content["cpu_count"] = psutil.cpu_count(logical=True)
10051005
reply_content["host_virtual_memory"] = dict(psutil.virtual_memory()._asdict())

ipykernel/serialize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def unpack_apply_message(bufs, g=None, copy=True):
181181
"""unpack f,args,kwargs from buffers packed by pack_apply_message()
182182
Returns: original f,args,kwargs"""
183183
bufs = list(bufs) # allow us to pop
184-
assert len(bufs) >= 2, "not enough buffers!" # noqa
184+
assert len(bufs) >= 2, "not enough buffers!"
185185
pf = bufs.pop(0)
186186
f = uncan(pickle.loads(pf), g)
187187
pinfo = bufs.pop(0)

ipykernel/tests/test_kernel.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ def test_sys_path_profile_dir():
117117
def test_subprocess_print():
118118
"""printing from forked mp.Process"""
119119
with new_kernel() as kc:
120-
121120
_check_master(kc, expected=True)
122121
flush_channels(kc)
123122
np = 5
@@ -146,7 +145,6 @@ def test_subprocess_print():
146145
def test_subprocess_noprint():
147146
"""mp.Process without print doesn't trigger iostream mp_mode"""
148147
with kernel() as kc:
149-
150148
np = 5
151149
code = "\n".join(
152150
[
@@ -174,7 +172,6 @@ def test_subprocess_noprint():
174172
def test_subprocess_error():
175173
"""error in mp.Process doesn't crash"""
176174
with new_kernel() as kc:
177-
178175
code = "\n".join(
179176
[
180177
"import multiprocessing as mp",
@@ -459,7 +456,6 @@ def test_interrupt_during_pdb_set_trace():
459456

460457

461458
def test_control_thread_priority():
462-
463459
N = 5
464460
with new_kernel() as kc:
465461
msg_id = kc.execute("pass")

0 commit comments

Comments
 (0)