From 1237bb7c95d261f7afeb7f7a6b3183822a560c32 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 23:58:01 +0000 Subject: [PATCH 1/3] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.15.9 → v0.16.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.9...v0.16.10) - [github.com/pre-commit/mirrors-mypy: v1.20.0 → v2.4.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.20.0...v2.4.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3423792..4b06014 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: - id: check-yaml - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.9 + rev: v0.16.10 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --show-fixes] @@ -32,7 +32,7 @@ repos: # Type checking - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.20.0 + rev: v2.4.0 hooks: - id: mypy files: 'src/.*\.py$' From 9af4258ce44f3e954f09c4fe09bfe0d30d6d5720 Mon Sep 17 00:00:00 2001 From: Nicholas Devenish Date: Fri, 6 Nov 2026 13:57:44 +0000 Subject: [PATCH 2/3] Update pre-commit hooks: ruff v0.17.4, mypy v2.4.1 --- .pre-commit-config.yaml | 4 ++-- src/workflows/recipe/{README.MD => README.md} | 0 src/workflows/services/{README.MD => README.md} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename src/workflows/recipe/{README.MD => README.md} (100%) rename src/workflows/services/{README.MD => README.md} (100%) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4b06014..04e0869 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: - id: check-yaml - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.16.10 + rev: v0.17.4 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --show-fixes] @@ -32,7 +32,7 @@ repos: # Type checking - repo: https://github.com/pre-commit/mirrors-mypy - rev: v2.4.0 + rev: v2.4.1 hooks: - id: mypy files: 'src/.*\.py$' diff --git a/src/workflows/recipe/README.MD b/src/workflows/recipe/README.md similarity index 100% rename from src/workflows/recipe/README.MD rename to src/workflows/recipe/README.md diff --git a/src/workflows/services/README.MD b/src/workflows/services/README.md similarity index 100% rename from src/workflows/services/README.MD rename to src/workflows/services/README.md From 07f63374550540ebe651c990581797c26a2544c2 Mon Sep 17 00:00:00 2001 From: Nicholas Devenish Date: Fri, 6 Nov 2026 13:57:45 +0000 Subject: [PATCH 3/3] Fix pre-commit failures from ruff 0.17 and mypy 2.4.1 - Rename README.MD files to README.md. ruff-format now runs on markdown; pre-commit matches the .MD extension case-insensitively, but ruff does not, so it parsed these files as Python. - Annotate CommonTransport.__callback_interceptor so mypy doesn't infer it as a method and reject the self argument. --- README.rst | 2 +- src/workflows/recipe/README.md | 2 +- src/workflows/transport/common_transport.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index ed71f7d..55f58bd 100644 --- a/README.rst +++ b/README.rst @@ -39,4 +39,4 @@ To achieve more complex workflows services can be interconnected using `recipes`_ whereby the output of one service can be directed onwards to other services. -.. _recipes: https://github.com/DiamondLightSource/python-workflows/tree/main/src/workflows/recipe/README.MD +.. _recipes: https://github.com/DiamondLightSource/python-workflows/tree/main/src/workflows/recipe/README.md diff --git a/src/workflows/recipe/README.md b/src/workflows/recipe/README.md index e26b769..2e026bb 100644 --- a/src/workflows/recipe/README.md +++ b/src/workflows/recipe/README.md @@ -1,6 +1,6 @@ ## Recipes -A [service](../services/README.MD) listens on a [channel](../transport/README.MD), acts on incoming messages, and produces some output. +A [service](../services/README.md) listens on a [channel](../transport/README.md), acts on incoming messages, and produces some output. The place where this output is sent to could be hardcoded, ie. written into the source code of the service. This makes the service structure rigid, and connecting one service to the output of another requires coordinating the source code of both services. Naturally, this approach does not scale well. diff --git a/src/workflows/transport/common_transport.py b/src/workflows/transport/common_transport.py index 551af0a..f133aea 100644 --- a/src/workflows/transport/common_transport.py +++ b/src/workflows/transport/common_transport.py @@ -24,7 +24,7 @@ class CommonTransport: Contains e.g. the logic to manage subscriptions and transactions. """ - __callback_interceptor = None + __callback_interceptor: Callable[[MessageCallback], MessageCallback] | None = None __subscriptions: dict[int, dict[str, Any]] = {} __subscription_id: int = 0 __transactions: set[int] = set()