Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.12"]
python-version: ["3.8", "3.12", "3.13"]
include:
- os: windows-latest
python-version: "3.9"
Expand Down
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-case-conflict
- id: check-ast
Expand All @@ -21,12 +21,12 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.27.4
rev: 0.31.3
hooks:
- id: check-github-workflows

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
rev: 0.7.22
hooks:
- id: mdformat
additional_dependencies:
Expand All @@ -39,13 +39,13 @@ repos:
types_or: [yaml, html, json]

- repo: https://github.com/adamchainz/blacken-docs
rev: "1.16.0"
rev: "1.19.1"
hooks:
- id: blacken-docs
additional_dependencies: [black==23.7.0]

- repo: https://github.com/codespell-project/codespell
rev: "v2.2.6"
rev: "v2.4.1"
hooks:
- id: codespell
args: ["-L", "sur,nd"]
Expand All @@ -58,15 +58,15 @@ repos:
- id: rst-inline-touching-normal

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.8.0"
rev: "v1.15.0"
hooks:
- id: mypy
files: comm
stages: [manual]
additional_dependencies: ["traitlets>=5.13"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.0
rev: v0.11.0
hooks:
- id: ruff
types_or: [python, jupyter]
Expand All @@ -75,7 +75,7 @@ repos:
types_or: [python, jupyter]

- repo: https://github.com/scientific-python/cookie
rev: "2024.01.24"
rev: "2025.01.22"
hooks:
- id: sp-repo-review
additional_dependencies: ["repo-review[cli]"]
3 changes: 2 additions & 1 deletion comm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
the Jupyter kernel protocol.
It also provides a base Comm implementation and a default CommManager for the IPython case.
"""

from __future__ import annotations

from typing import Any
Expand All @@ -15,9 +16,9 @@

__version__ = "0.2.2"
__all__ = [
"__version__",
"create_comm",
"get_comm_manager",
"__version__",
]

_comm_manager = None
Expand Down
17 changes: 8 additions & 9 deletions comm/base_comm.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Default classes for Comm and CommManager, for usage in IPython.
"""
"""Default classes for Comm and CommManager, for usage in IPython."""

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

self._open_data = _open_data if _open_data else {}
self._close_data = _close_data if _close_data else {}
Expand All @@ -71,11 +70,11 @@ def __init__(

def publish_msg(
self,
msg_type: str, # noqa: ARG002
data: MaybeDict = None, # noqa: ARG002
metadata: MaybeDict = None, # noqa: ARG002
buffers: BuffersType = None, # noqa: ARG002
**keys: t.Any, # noqa: ARG002
msg_type: str,
data: MaybeDict = None,
metadata: MaybeDict = None,
buffers: BuffersType = None,
**keys: t.Any,
) -> None:
msg = "publish_msg Comm method is not implemented"
raise NotImplementedError(msg)
Expand Down Expand Up @@ -314,4 +313,4 @@ def comm_close(self, stream: ZMQStream, ident: str, msg: MessageType) -> None:
logger.error("Exception in comm_close for %s", comm_id, exc_info=True)


__all__ = ["CommManager", "BaseComm"]
__all__ = ["BaseComm", "CommManager"]
Loading