From fa805fd2c722566c478f042350ec801c32d49d06 Mon Sep 17 00:00:00 2001 From: Nicholas Devenish Date: Tue, 28 Apr 2026 12:49:36 +0100 Subject: [PATCH 1/3] Move dev dependencies into a PEP 735 dependency group Replaces requirements_dev.txt with a [dependency-groups] dev table in pyproject.toml, and updates CI to install via `pip install --group dev`. --- .github/workflows/python.yml | 2 +- pyproject.toml | 10 ++++++++++ requirements_dev.txt | 9 --------- 3 files changed, 11 insertions(+), 10 deletions(-) delete mode 100644 requirements_dev.txt diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index b612fca..7e1557e 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -41,7 +41,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements_dev.txt dist/*.whl + pip install --group dev dist/*.whl - name: Test with pytest run: | pytest tests diff --git a/pyproject.toml b/pyproject.toml index 89c1064..df9572c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,16 @@ Bug-Tracker = "https://github.com/DiamondLightSource/python-workflows/issues" [project.optional-dependencies] prometheus = ["prometheus-client"] +[dependency-groups] +dev = [ + "prometheus-client", + "pytest", + "pytest-cov", + "pytest-mock", + "pytest-timeout", + "websocket-client", +] + [project.entry-points."libtbx.dispatcher.script"] "workflows.validate_recipe" = "workflows.validate_recipe" diff --git a/requirements_dev.txt b/requirements_dev.txt deleted file mode 100644 index d6c0415..0000000 --- a/requirements_dev.txt +++ /dev/null @@ -1,9 +0,0 @@ -bidict==0.23.1 -pika==1.3.2 -prometheus_client==0.21.0 -pytest==9.0.3 -pytest-cov==7.1.0 -pytest-mock==3.14.0 -pytest-timeout==2.3.1 -stomp-py==8.1.2 -websocket-client==1.8.0 \ No newline at end of file From 51e92a39828a69eb52d415ab9fa4299c5aa7e0f7 Mon Sep 17 00:00:00 2001 From: Nicholas Devenish Date: Tue, 28 Apr 2026 12:49:50 +0100 Subject: [PATCH 2/3] Update Python requirements against NEP 29 Bumps the CI matrix to 3.12, 3.13, 3.14. NEP 29 dropped 3.11 on 2026-04-24, so 3.10 and 3.11 are no longer in scope. --- .github/workflows/python.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 7e1557e..ec0fc4e 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v6 diff --git a/pyproject.toml b/pyproject.toml index df9572c..ff55da1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ classifiers = [ "Topic :: Software Development :: Libraries :: Python Modules", ] license = { text = "BSD-3-Clause" } -requires-python = ">=3.10" +requires-python = ">=3.12" dependencies = [ "bidict", "pika", From 925c6a6ed2b01aa01f50c1f1da90e85de02c019c Mon Sep 17 00:00:00 2001 From: Nicholas Devenish Date: Tue, 28 Apr 2026 13:03:10 +0100 Subject: [PATCH 3/3] Pin fork start method in frontend for Python 3.14 Python 3.14 changed the multiprocessing default from fork to forkserver on Linux, which pickles the target process. The Frontend's service instances carry pipes and transport state that aren't pickleable, so the previous reliance on fork semantics no longer works out of the box. Force the fork start method at module load to preserve existing behaviour. fork is deprecated upstream and will eventually need a real refactor. --- src/workflows/frontend/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/workflows/frontend/__init__.py b/src/workflows/frontend/__init__.py index ff3226f..01962dd 100644 --- a/src/workflows/frontend/__init__.py +++ b/src/workflows/frontend/__init__.py @@ -16,6 +16,12 @@ basestring = (str, bytes) +# Pin the fork start method: service instances carry pipes and transport +# state that aren't pickleable, so spawn/forkserver (the 3.14+ default on +# Linux) can't serialize them. fork is deprecated upstream and will +# eventually need a real refactor. +multiprocessing.set_start_method("fork", force=True) + class Frontend: """The frontend class encapsulates the actual service. It controls the