Skip to content

Commit 265d2c0

Browse files
committed
pre-commit updates and fixes
1 parent d119118 commit 265d2c0

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

.github/workflows/python-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
os: [ubuntu-latest, windows-latest, macos-latest]
18-
python-version: ["3.8", "3.12"]
18+
python-version: ["3.8", "3.12", "3.13"]
1919
include:
2020
- os: windows-latest
2121
python-version: "3.9"

.pre-commit-config.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ci:
44

55
repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v4.5.0
7+
rev: v5.0.0
88
hooks:
99
- id: check-case-conflict
1010
- id: check-ast
@@ -21,12 +21,12 @@ repos:
2121
- id: trailing-whitespace
2222

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

2828
- repo: https://github.com/executablebooks/mdformat
29-
rev: 0.7.17
29+
rev: 0.7.22
3030
hooks:
3131
- id: mdformat
3232
additional_dependencies:
@@ -39,13 +39,13 @@ repos:
3939
types_or: [yaml, html, json]
4040

4141
- repo: https://github.com/adamchainz/blacken-docs
42-
rev: "1.16.0"
42+
rev: "1.19.1"
4343
hooks:
4444
- id: blacken-docs
4545
additional_dependencies: [black==23.7.0]
4646

4747
- repo: https://github.com/codespell-project/codespell
48-
rev: "v2.2.6"
48+
rev: "v2.4.1"
4949
hooks:
5050
- id: codespell
5151
args: ["-L", "sur,nd"]
@@ -58,15 +58,15 @@ repos:
5858
- id: rst-inline-touching-normal
5959

6060
- repo: https://github.com/pre-commit/mirrors-mypy
61-
rev: "v1.8.0"
61+
rev: "v1.15.0"
6262
hooks:
6363
- id: mypy
6464
files: comm
6565
stages: [manual]
6666
additional_dependencies: ["traitlets>=5.13"]
6767

6868
- repo: https://github.com/astral-sh/ruff-pre-commit
69-
rev: v0.2.0
69+
rev: v0.11.0
7070
hooks:
7171
- id: ruff
7272
types_or: [python, jupyter]
@@ -75,7 +75,7 @@ repos:
7575
types_or: [python, jupyter]
7676

7777
- repo: https://github.com/scientific-python/cookie
78-
rev: "2024.01.24"
78+
rev: "2025.01.22"
7979
hooks:
8080
- id: sp-repo-review
8181
additional_dependencies: ["repo-review[cli]"]

comm/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
the Jupyter kernel protocol.
88
It also provides a base Comm implementation and a default CommManager for the IPython case.
99
"""
10+
1011
from __future__ import annotations
1112

1213
from typing import Any
@@ -15,9 +16,9 @@
1516

1617
__version__ = "0.2.2"
1718
__all__ = [
19+
"__version__",
1820
"create_comm",
1921
"get_comm_manager",
20-
"__version__",
2122
]
2223

2324
_comm_manager = None

comm/base_comm.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Default classes for Comm and CommManager, for usage in IPython.
2-
"""
1+
"""Default classes for Comm and CommManager, for usage in IPython."""
32

43
# Copyright (c) IPython Development Team.
54
# Distributed under the terms of the Modified BSD License.
@@ -53,7 +52,7 @@ def __init__(
5352
self.primary = primary
5453
self.target_name = target_name
5554
self.target_module = target_module
56-
self.topic = topic if topic else ("comm-%s" % self.comm_id).encode("ascii")
55+
self.topic = topic if topic else (f"comm-{self.comm_id}").encode("ascii")
5756

5857
self._open_data = _open_data if _open_data else {}
5958
self._close_data = _close_data if _close_data else {}
@@ -71,11 +70,11 @@ def __init__(
7170

7271
def publish_msg(
7372
self,
74-
msg_type: str, # noqa: ARG002
75-
data: MaybeDict = None, # noqa: ARG002
76-
metadata: MaybeDict = None, # noqa: ARG002
77-
buffers: BuffersType = None, # noqa: ARG002
78-
**keys: t.Any, # noqa: ARG002
73+
msg_type: str,
74+
data: MaybeDict = None,
75+
metadata: MaybeDict = None,
76+
buffers: BuffersType = None,
77+
**keys: t.Any,
7978
) -> None:
8079
msg = "publish_msg Comm method is not implemented"
8180
raise NotImplementedError(msg)
@@ -314,4 +313,4 @@ def comm_close(self, stream: ZMQStream, ident: str, msg: MessageType) -> None:
314313
logger.error("Exception in comm_close for %s", comm_id, exc_info=True)
315314

316315

317-
__all__ = ["CommManager", "BaseComm"]
316+
__all__ = ["BaseComm", "CommManager"]

0 commit comments

Comments
 (0)