From 8cbda7f4fcec82a846be7daf0930b80a90ce170f Mon Sep 17 00:00:00 2001 From: Jacob Williamson Date: Mon, 2 Nov 2026 17:14:52 +0000 Subject: [PATCH 1/8] Fix tests for latest bluesky --- pyproject.toml | 2 +- tests/unit_tests/i15_1/test_centre_sample.py | 42 +++++++++------- .../i15_1/test_static_collection.py | 50 ++++++++----------- uv.lock | 8 +-- 4 files changed, 51 insertions(+), 51 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2310631..3eb4ba8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ dependencies = [ "deepdiff", "heliotrapi >= v0.3.3", "ophyd-async[ca,pva] >=0.21.2", - "bluesky == 1.15.1", + "bluesky >= 1.16.0", "daq-config-server >= 1.5.3", "dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@main", ] diff --git a/tests/unit_tests/i15_1/test_centre_sample.py b/tests/unit_tests/i15_1/test_centre_sample.py index 06b91ef..7c1ca65 100644 --- a/tests/unit_tests/i15_1/test_centre_sample.py +++ b/tests/unit_tests/i15_1/test_centre_sample.py @@ -129,15 +129,18 @@ def test_centre_sample_plan_makes_expected_calls( ) msgs = assert_message_and_return_remaining( msgs, - predicate=lambda msg: msg.command == "read" and msg.obj.name == "robot", - ) - msgs = assert_message_and_return_remaining( - msgs, - predicate=lambda msg: msg.command == "read" and msg.obj.name == "xtal", - ) - msgs = assert_message_and_return_remaining( - msgs, - predicate=lambda msg: msg.command == "read" and msg.obj.name == "tth", + predicate=lambda msg: ( + msg.command == "read" + and msg.obj is common_collection_devices.robot + and msg.args + == ( + common_collection_devices.xtal, + common_collection_devices.tth, + common_collection_devices.fast_attenuator, + common_collection_devices.slow_attenuator, + common_collection_devices.hexapod, + ) + ), ) msgs = assert_message_and_return_remaining( msgs, @@ -206,15 +209,18 @@ def test_centre_sample_plan_makes_expected_calls( ) msgs = assert_message_and_return_remaining( msgs, - predicate=lambda msg: msg.command == "read" and msg.obj.name == "robot", - ) - msgs = assert_message_and_return_remaining( - msgs, - predicate=lambda msg: msg.command == "read" and msg.obj.name == "xtal", - ) - msgs = assert_message_and_return_remaining( - msgs, - predicate=lambda msg: msg.command == "read" and msg.obj.name == "tth", + predicate=lambda msg: ( + msg.command == "read" + and msg.obj is common_collection_devices.robot + and msg.args + == ( + common_collection_devices.xtal, + common_collection_devices.tth, + common_collection_devices.fast_attenuator, + common_collection_devices.slow_attenuator, + common_collection_devices.hexapod, + ) + ), ) msgs = assert_message_and_return_remaining( msgs, diff --git a/tests/unit_tests/i15_1/test_static_collection.py b/tests/unit_tests/i15_1/test_static_collection.py index 2ee01ff..65f711b 100644 --- a/tests/unit_tests/i15_1/test_static_collection.py +++ b/tests/unit_tests/i15_1/test_static_collection.py @@ -124,28 +124,19 @@ def test_static_collection_plan_makes_expected_calls( msg.command == "declare_stream" and msg.kwargs["name"] == "baseline" ), ) - msgs = assert_message_and_return_remaining( - msgs, - predicate=lambda msg: msg.command == "read" and msg.obj.name == "robot", - ) - msgs = assert_message_and_return_remaining( - msgs, - predicate=lambda msg: msg.command == "read" and msg.obj.name == "xtal", - ) - msgs = assert_message_and_return_remaining( - msgs, - predicate=lambda msg: msg.command == "read" and msg.obj.name == "tth", - ) - msgs = assert_message_and_return_remaining( - msgs, - predicate=lambda msg: ( - msg.command == "read" and msg.obj.name == "fast_attenuator" - ), - ) msgs = assert_message_and_return_remaining( msgs, predicate=lambda msg: ( - msg.command == "read" and msg.obj.name == "slow_attenuator" + msg.command == "read" + and msg.obj is common_collection_devices.robot + and msg.args + == ( + common_collection_devices.xtal, + common_collection_devices.tth, + common_collection_devices.fast_attenuator, + common_collection_devices.slow_attenuator, + common_collection_devices.hexapod, + ) ), ) msgs = assert_message_and_return_remaining( @@ -200,15 +191,18 @@ def test_static_collection_plan_makes_expected_calls( ) msgs = assert_message_and_return_remaining( msgs, - predicate=lambda msg: msg.command == "read" and msg.obj.name == "robot", - ) - msgs = assert_message_and_return_remaining( - msgs, - predicate=lambda msg: msg.command == "read" and msg.obj.name == "xtal", - ) - msgs = assert_message_and_return_remaining( - msgs, - predicate=lambda msg: msg.command == "read" and msg.obj.name == "tth", + predicate=lambda msg: ( + msg.command == "read" + and msg.obj is common_collection_devices.robot + and msg.args + == ( + common_collection_devices.xtal, + common_collection_devices.tth, + common_collection_devices.fast_attenuator, + common_collection_devices.slow_attenuator, + common_collection_devices.hexapod, + ) + ), ) msgs = assert_message_and_return_remaining( msgs, diff --git a/uv.lock b/uv.lock index 56d0bb8..7860714 100644 --- a/uv.lock +++ b/uv.lock @@ -287,7 +287,7 @@ wheels = [ [[package]] name = "bluesky" -version = "1.15.1" +version = "1.16.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "cycler" }, @@ -302,9 +302,9 @@ dependencies = [ { name = "tqdm" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/e4/83/2e5d1956a1c4cd3d4f0bb34605cc2b11f2ce33e48249773292b27e6bba88/bluesky-1.15.1.tar.gz", hash = "sha256:956e161a8f34f698af28edcd501db118fa793a6c43241001e30ed8c6aaabd95c", size = 513978, upload-time = "2026-05-06T14:06:40.116Z" } +sdist = { url = "https://files.pythonhosted.org/packages/24/fb/9d72f62bb19fa10fad013a6039e51162ebaac84713a06a167083c4b68775/bluesky-1.16.0.tar.gz", hash = "sha256:e89884e5eb4e4e502d4f1e929f6862ed6827ad48272a928583bf67d2f1745261", size = 516370, upload-time = "2026-10-29T17:13:07.145Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/8e/99/cc217b2a727fdf730d0c0064bc8c03473dfe5d0528f2bd0c4f59fdab4179/bluesky-1.15.1-py3-none-any.whl", hash = "sha256:7b3a0f04cf2bb0a7907771e014e59fe6fced777347df8df84adec7239f6c3d2a", size = 372701, upload-time = "2026-05-06T14:06:38.618Z" }, + { url = "https://files.pythonhosted.org/packages/da/ca/ad113309c25d01d2166a0ed17fcdcfa453dbf267147d9e9530928dda82a6/bluesky-1.16.0-py3-none-any.whl", hash = "sha256:674b6547bcab7f4dcaf5d403ce2225d52711cbfa363853ce5e2cf5119b802d60", size = 369254, upload-time = "2026-10-29T17:13:05.466Z" }, ] [[package]] @@ -1061,7 +1061,7 @@ dev = [ [package.metadata] requires-dist = [ - { name = "bluesky", specifier = "==1.15.1" }, + { name = "bluesky", specifier = ">=1.16.0" }, { name = "daq-config-server", specifier = ">=1.5.3" }, { name = "deepdiff" }, { name = "dls-dodal", git = "https://github.com/DiamondLightSource/dodal.git?rev=main" }, From 4f328205b432edeb7235e73578206ce6069456a6 Mon Sep 17 00:00:00 2001 From: Jacob Williamson Date: Mon, 2 Nov 2026 17:33:09 +0000 Subject: [PATCH 2/8] Add local dodal step to pre-commit hooks --- .github/workflows/ci.yml | 1 + .pre-commit-config.yaml | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4838c36..a8018ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,7 @@ jobs: uses: ./.github/workflows/_tox.yml with: tox: pre-commit,type-checking + skip_hooks: local-dodal test: strategy: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 10d7415..b1a4800 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,6 +31,13 @@ repos: entry: uv sync files: ^(uv\.lock|pyproject\.toml)$ + - id: local-dodal + name: install local editable dodal + language: system + pass_filenames: false + entry: uv pip install -e ../dodal + files: ^(uv\.lock|pyproject\.toml)$ + - repo: https://github.com/gitleaks/gitleaks rev: v8.30.1 hooks: From c2b0bbf45100697c6bc269e9ea10e9f1edc84970 Mon Sep 17 00:00:00 2001 From: Jacob Williamson Date: Mon, 2 Nov 2026 17:40:21 +0000 Subject: [PATCH 3/8] Add pyright node-js to dev deps --- pyproject.toml | 1 + uv.lock | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3eb4ba8..b472f1b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,6 +42,7 @@ requires-python = ">=3.11" dev = [ "pre-commit", "pyright", + "pyright[nodejs]", "pytest", "pytest-cov", "ruff", diff --git a/uv.lock b/uv.lock index 7860714..ff42cf6 100644 --- a/uv.lock +++ b/uv.lock @@ -1049,7 +1049,7 @@ dependencies = [ [package.dev-dependencies] dev = [ { name = "pre-commit" }, - { name = "pyright" }, + { name = "pyright", extra = ["nodejs"] }, { name = "pytest" }, { name = "pytest-asyncio" }, { name = "pytest-cov" }, @@ -1083,6 +1083,7 @@ requires-dist = [ dev = [ { name = "pre-commit" }, { name = "pyright" }, + { name = "pyright", extras = ["nodejs"] }, { name = "pytest" }, { name = "pytest-asyncio" }, { name = "pytest-cov" }, @@ -2380,6 +2381,22 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/54/c8/12811c9b48fde162bb72b6f2e78fada9a247a09d7bb5be2050a5d099c77b/nodeenv-1.11.0-py2.py3-none-any.whl", hash = "sha256:edaa16e6c14d7cf395d75d4bbd5a26390f4dc06501a33b4e76282b02cc688a25", size = 34277, upload-time = "2026-09-26T11:29:19.933Z" }, ] +[[package]] +name = "nodejs-wheel-binaries" +version = "24.19.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/c0/76/7e97195e14346598565a0de4ca8bdbd5e634b3fb5b1ba590b7b1b89f8a63/nodejs_wheel_binaries-24.19.0.tar.gz", hash = "sha256:db217eef8cab8551667863379b08db4d9067403f6cbbe87481eb40edceb8aa9b", size = 8058, upload-time = "2026-08-19T21:47:19.671Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8c/52/0774b52c7be8151ad9d5aff44edc100c3f13d6d8eb3765f63ffa40e69fe8/nodejs_wheel_binaries-24.19.0-py2.py3-none-macosx_13_0_arm64.whl", hash = "sha256:e12cbfd69089504e42fb14194ce734a9dcf3eb38c820ca63dd511d36fb964e9c", size = 56047203, upload-time = "2026-08-19T21:46:43.448Z" }, + { url = "https://files.pythonhosted.org/packages/67/3a/4fdbbfecf2c23d52c0e3f68de7f7c1b3c97a26d328c69c5f6c49c48e340e/nodejs_wheel_binaries-24.19.0-py2.py3-none-macosx_13_0_x86_64.whl", hash = "sha256:1c890adf4b7e6556ccc1ca66c866bb81884b6c9a581dee4e530dc7f78fb9d514", size = 56219459, upload-time = "2026-08-19T21:46:48.45Z" }, + { url = "https://files.pythonhosted.org/packages/5f/a8/0147149415195c59b8a72a594916bfb80d6be4d586f9fbfda313889e0efc/nodejs_wheel_binaries-24.19.0-py2.py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:4e029dadfae1295876063c96b236f673487e8c27379fe146c1e2250283520227", size = 60588256, upload-time = "2026-08-19T21:46:53.298Z" }, + { url = "https://files.pythonhosted.org/packages/f4/89/6631d0982353da1bb7bc00bb1988f702822c62b42634f57999ee53b5c337/nodejs_wheel_binaries-24.19.0-py2.py3-none-manylinux_2_28_x86_64.whl", hash = "sha256:4196a947bcc883f2003ab101762d729f3e99b5e86b75bd09151563403e2eceb8", size = 61123607, upload-time = "2026-08-19T21:46:58.117Z" }, + { url = "https://files.pythonhosted.org/packages/32/a2/fa30f0841e4602995782e124359f9b910c7b481d98decf61ef0b2fc3ebfb/nodejs_wheel_binaries-24.19.0-py2.py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:352e048ab4dd35e7de5f338d1cc4fcbf77a0e93da30bf7336a8217ee246b31d7", size = 62632842, upload-time = "2026-08-19T21:47:03.42Z" }, + { url = "https://files.pythonhosted.org/packages/18/01/22d97ca72213f66cc386ee638db30c2e62757fdf761c6029074bced83d1c/nodejs_wheel_binaries-24.19.0-py2.py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:28d078b2ced9e2069516e652dc4b1380e7a1a7f2d3934eccd1611586d283ba4c", size = 63250653, upload-time = "2026-08-19T21:47:07.938Z" }, + { url = "https://files.pythonhosted.org/packages/88/d1/e3be8fa327a795bcaf7a19cd84299e338a7bce32ff0665fdce9cfa22573c/nodejs_wheel_binaries-24.19.0-py2.py3-none-win_amd64.whl", hash = "sha256:67e3abeb9c3830cae8c8487ae8a2af7cc27dfa75af06145cee5ca7d1857c81bd", size = 42448503, upload-time = "2026-08-19T21:47:12.093Z" }, + { url = "https://files.pythonhosted.org/packages/1d/37/34cf28ba1691a060174948a9927fe61091982d6048b2e403071a9acce443/nodejs_wheel_binaries-24.19.0-py2.py3-none-win_arm64.whl", hash = "sha256:d9074c665ea68b04e183d82482c86dc907d3a9bd15eb6cf85542cb785266bb36", size = 40090155, upload-time = "2026-08-19T21:47:16.032Z" }, +] + [[package]] name = "nose2" version = "0.16.0" @@ -3459,6 +3476,11 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d7/ba/18b6e682ead424ad24bcc134339ae5d1b931cd9ae260540592a058a91279/pyright-1.1.414-py3-none-any.whl", hash = "sha256:2a6b4b3298c9eec174c5ed83bd338de6eee82df2992f3e1930e6199d381be36f", size = 6225049, upload-time = "2026-09-10T12:26:51.427Z" }, ] +[package.optional-dependencies] +nodejs = [ + { name = "nodejs-wheel-binaries" }, +] + [[package]] name = "pytest" version = "9.1.1" From 44f195b32a357c22881fb4f4a5f3218d270cd13c Mon Sep 17 00:00:00 2001 From: Jacob Williamson Date: Mon, 2 Nov 2026 17:49:01 +0000 Subject: [PATCH 4/8] Pin dodal --- pyproject.toml | 2 +- uv.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b472f1b..4f47b0c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ dependencies = [ "ophyd-async[ca,pva] >=0.21.2", "bluesky >= 1.16.0", "daq-config-server >= 1.5.3", - "dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@main", + "dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@improve_zebra_typing", ] dynamic = ["version"] diff --git a/uv.lock b/uv.lock index ff42cf6..145be29 100644 --- a/uv.lock +++ b/uv.lock @@ -1064,7 +1064,7 @@ requires-dist = [ { name = "bluesky", specifier = ">=1.16.0" }, { name = "daq-config-server", specifier = ">=1.5.3" }, { name = "deepdiff" }, - { name = "dls-dodal", git = "https://github.com/DiamondLightSource/dodal.git?rev=main" }, + { name = "dls-dodal", git = "https://github.com/DiamondLightSource/dodal.git?rev=improve_zebra_typing" }, { name = "h5py" }, { name = "heliotrapi", specifier = ">=0.3.3" }, { name = "ispyb" }, @@ -1148,8 +1148,8 @@ wheels = [ [[package]] name = "dls-dodal" -version = "3.0.5.dev4+gb48576c3d" -source = { git = "https://github.com/DiamondLightSource/dodal.git?rev=main#b48576c3d3352440fdc3e027b2151dc7ba680e72" } +version = "3.0.7.dev1+g6715d559b" +source = { git = "https://github.com/DiamondLightSource/dodal.git?rev=improve_zebra_typing#6715d559bd1fd1d89cc2e538832eb038871c3eed" } dependencies = [ { name = "aiofiles" }, { name = "aiohttp" }, From 4a095d0c81475fd43d2720c4be8745d8e61061a2 Mon Sep 17 00:00:00 2001 From: Jacob Williamson Date: Mon, 2 Nov 2026 17:52:54 +0000 Subject: [PATCH 5/8] Fix CI --- .github/workflows/_tox.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/_tox.yml b/.github/workflows/_tox.yml index e7abe84..51d80e6 100644 --- a/.github/workflows/_tox.yml +++ b/.github/workflows/_tox.yml @@ -5,6 +5,11 @@ on: type: string description: What to run under tox required: true + skip_hooks: + description: "Comma-separated pre-commit hook IDs to skip" + required: false + type: string + default: "" jobs: @@ -19,4 +24,6 @@ jobs: uses: astral-sh/setup-uv@v10.0.0 - name: Run tox + env: + SKIP: ${{ inputs.skip_hooks }} run: uv run --locked tox -e ${{ inputs.tox }} From 0f973e1670edd155f8482e31daa512b3c9e95ab3 Mon Sep 17 00:00:00 2001 From: Jacob Williamson Date: Tue, 3 Nov 2026 10:12:51 +0000 Subject: [PATCH 6/8] Remove local dodal change --- .github/workflows/_tox.yml | 6 ------ .github/workflows/ci.yml | 6 ++---- .pre-commit-config.yaml | 7 ------- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/.github/workflows/_tox.yml b/.github/workflows/_tox.yml index 51d80e6..13039b0 100644 --- a/.github/workflows/_tox.yml +++ b/.github/workflows/_tox.yml @@ -5,12 +5,6 @@ on: type: string description: What to run under tox required: true - skip_hooks: - description: "Comma-separated pre-commit hook IDs to skip" - required: false - type: string - default: "" - jobs: run: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8018ec..2ac73c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,16 +5,14 @@ on: branches: - main tags: - - '*' + - "*" pull_request: jobs: - lint: uses: ./.github/workflows/_tox.yml with: tox: pre-commit,type-checking - skip_hooks: local-dodal test: strategy: @@ -29,7 +27,7 @@ jobs: dist: uses: ./.github/workflows/_dist.yml - + release: needs: [dist, test] if: github.ref_type == 'tag' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b1a4800..10d7415 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,13 +31,6 @@ repos: entry: uv sync files: ^(uv\.lock|pyproject\.toml)$ - - id: local-dodal - name: install local editable dodal - language: system - pass_filenames: false - entry: uv pip install -e ../dodal - files: ^(uv\.lock|pyproject\.toml)$ - - repo: https://github.com/gitleaks/gitleaks rev: v8.30.1 hooks: From 8581cc80c39180097498ab54ba13f51b05838cce Mon Sep 17 00:00:00 2001 From: Jacob Williamson Date: Tue, 3 Nov 2026 10:13:46 +0000 Subject: [PATCH 7/8] Pin back to dodal main --- pyproject.toml | 2 +- uv.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4f47b0c..b472f1b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ dependencies = [ "ophyd-async[ca,pva] >=0.21.2", "bluesky >= 1.16.0", "daq-config-server >= 1.5.3", - "dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@improve_zebra_typing", + "dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@main", ] dynamic = ["version"] diff --git a/uv.lock b/uv.lock index 145be29..1a32a62 100644 --- a/uv.lock +++ b/uv.lock @@ -1064,7 +1064,7 @@ requires-dist = [ { name = "bluesky", specifier = ">=1.16.0" }, { name = "daq-config-server", specifier = ">=1.5.3" }, { name = "deepdiff" }, - { name = "dls-dodal", git = "https://github.com/DiamondLightSource/dodal.git?rev=improve_zebra_typing" }, + { name = "dls-dodal", git = "https://github.com/DiamondLightSource/dodal.git?rev=main" }, { name = "h5py" }, { name = "heliotrapi", specifier = ">=0.3.3" }, { name = "ispyb" }, @@ -1148,8 +1148,8 @@ wheels = [ [[package]] name = "dls-dodal" -version = "3.0.7.dev1+g6715d559b" -source = { git = "https://github.com/DiamondLightSource/dodal.git?rev=improve_zebra_typing#6715d559bd1fd1d89cc2e538832eb038871c3eed" } +version = "3.0.7.dev1+g01e660fba" +source = { git = "https://github.com/DiamondLightSource/dodal.git?rev=main#01e660fba218677d284cbaa5b21ce70f198e8365" } dependencies = [ { name = "aiofiles" }, { name = "aiohttp" }, From 6406f1f8f4dd5d2260e647896eef883d2f8200a0 Mon Sep 17 00:00:00 2001 From: Jacob Williamson Date: Tue, 3 Nov 2026 10:14:34 +0000 Subject: [PATCH 8/8] Fix --- .github/workflows/_tox.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/_tox.yml b/.github/workflows/_tox.yml index 13039b0..bb8bc6e 100644 --- a/.github/workflows/_tox.yml +++ b/.github/workflows/_tox.yml @@ -18,6 +18,4 @@ jobs: uses: astral-sh/setup-uv@v10.0.0 - name: Run tox - env: - SKIP: ${{ inputs.skip_hooks }} run: uv run --locked tox -e ${{ inputs.tox }}