From 3091544cf432b93eefd2bf0ba02108067bc4b66c Mon Sep 17 00:00:00 2001 From: Jack Harper Date: Wed, 27 Aug 2025 16:30:32 +0100 Subject: [PATCH 1/4] drop python 3.10 --- .github/workflows/Lint-and-test.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test-against-main.yml | 2 +- pyproject.toml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Lint-and-test.yml b/.github/workflows/Lint-and-test.yml index 4e9258b1..0caaebfc 100644 --- a/.github/workflows/Lint-and-test.yml +++ b/.github/workflows/Lint-and-test.yml @@ -6,7 +6,7 @@ jobs: strategy: matrix: os: [ "ubuntu-latest", "windows-latest" ] - version: ['3.10', '3.11', '3.12'] + version: ['3.11', '3.12', '3.13'] fail-fast: false steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 96d90711..b053356a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" - name: Install pypa/build run: >- python3 -m diff --git a/.github/workflows/test-against-main.yml b/.github/workflows/test-against-main.yml index bb6b2b13..492bdc4b 100644 --- a/.github/workflows/test-against-main.yml +++ b/.github/workflows/test-against-main.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - version: ['3.11', "3.12"] + version: ['3.11', "3.12", "3.13"] steps: - uses: actions/checkout@v5 - uses: actions/setup-python@v5 diff --git a/pyproject.toml b/pyproject.toml index 34d1fb65..77d5c07f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ name = "ibex-bluesky-core" # REQUIRED, is the only field that cannot be marked dynamic = ["version"] description = "Core bluesky plan stubs & devices for use at ISIS" readme = "README.md" -requires-python = ">=3.10" +requires-python = ">=3.11" license-files = ["LICENSE"] authors = [ @@ -33,9 +33,9 @@ classifiers = [ # that you indicate you support Python 3. These classifiers are *not* # checked by "pip install". See instead "requires-python" key in this file. "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3 :: Only", ] From a1a43ed0b0dc188e36a477efa387aec7cc539643 Mon Sep 17 00:00:00 2001 From: Jack Harper Date: Wed, 27 Aug 2025 16:54:14 +0100 Subject: [PATCH 2/4] remove python ver conditional import --- tests/devices/test_block.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/devices/test_block.py b/tests/devices/test_block.py index c1a3729e..fb5df0f7 100644 --- a/tests/devices/test_block.py +++ b/tests/devices/test_block.py @@ -24,12 +24,6 @@ ) from tests.conftest import MOCK_PREFIX -if sys.version_info < (3, 11): - aio_timeout_error = asyncio.exceptions.TimeoutError -else: - aio_timeout_error = TimeoutError - - async def _make_block(clazz): block = clazz(float, MOCK_PREFIX, "float_block") await block.connect(mock=True) @@ -191,7 +185,7 @@ async def test_block_set_with_timeout(): set_mock_value(block.readback, 10) - with pytest.raises(aio_timeout_error): + with pytest.raises(TimeoutError): await block.set(20) func.assert_called_once_with(20, 10) @@ -233,7 +227,7 @@ async def test_block_set_waiting_for_global_moving_flag_timeout(): set_mock_value(block.global_moving, True) with patch("ibex_bluesky_core.devices.block.asyncio.sleep") as mock_aio_sleep: - with pytest.raises(aio_timeout_error): + with pytest.raises(TimeoutError): await block.set(10) # Only check first call, as wait_for_value from ophyd_async gives us a few more... assert mock_aio_sleep.mock_calls[0] == call(GLOBAL_MOVING_FLAG_PRE_WAIT) @@ -360,13 +354,13 @@ async def test_block_mot_set(mot_block): async def test_block_failing_write(timeout_is_error): block = await _block_with_write_config(BlockWriteConfig(timeout_is_error=timeout_is_error)) - get_mock_put(block.setpoint).side_effect = aio_timeout_error + get_mock_put(block.setpoint).side_effect = TimeoutError - with pytest.raises(aio_timeout_error) if timeout_is_error else nullcontext(): + with pytest.raises(TimeoutError) if timeout_is_error else nullcontext(): await block.set(1) async def test_block_failing_write_with_default_write_config(writable_block): - get_mock_put(writable_block.setpoint).side_effect = aio_timeout_error - with pytest.raises(aio_timeout_error): + get_mock_put(writable_block.setpoint).side_effect = TimeoutError + with pytest.raises(TimeoutError): await writable_block.set(1) From e5f582af51b71e891e600420b53f86b716c98ff7 Mon Sep 17 00:00:00 2001 From: Jack Harper Date: Wed, 27 Aug 2025 17:06:03 +0100 Subject: [PATCH 3/4] ruff check fixes --- tests/devices/test_block.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/devices/test_block.py b/tests/devices/test_block.py index fb5df0f7..06b51e7e 100644 --- a/tests/devices/test_block.py +++ b/tests/devices/test_block.py @@ -1,6 +1,4 @@ # pyright: reportMissingParameterType=false -import asyncio -import sys from contextlib import nullcontext from unittest.mock import ANY, MagicMock, call, patch @@ -24,6 +22,7 @@ ) from tests.conftest import MOCK_PREFIX + async def _make_block(clazz): block = clazz(float, MOCK_PREFIX, "float_block") await block.connect(mock=True) From 664de04ff3ce0143dbf6e541dffc3f8741923540 Mon Sep 17 00:00:00 2001 From: Jack Harper Date: Thu, 28 Aug 2025 14:21:47 +0100 Subject: [PATCH 4/4] pin ophyd-async to 0.13.1 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 77d5c07f..1b4b449e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ classifiers = [ dependencies = [ "bluesky", # Bluesky framework - "ophyd-async[ca] == 0.12.3", # Device abstraction + "ophyd-async[ca] == 0.13.1", # Device abstraction "matplotlib", # Plotting "lmfit", # Fitting "scipy", # Definitions of erf/erfc functions