From 23ce287c5831028b94965ed1ee18d3b89aff9da6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Mar 2026 19:22:10 +0000 Subject: [PATCH 1/3] Bump mypy from 1.19.1 to 1.20.0 Bumps [mypy](https://github.com/python/mypy) from 1.19.1 to 1.20.0. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.19.1...v1.20.0) --- updated-dependencies: - dependency-name: mypy dependency-version: 1.20.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 79da4bf2c94..f7a93222897 100644 --- a/requirements.txt +++ b/requirements.txt @@ -194,7 +194,7 @@ matplotlib-inline==0.2.1 # ipython mistune==3.2.0 # via nbconvert -mypy==1.19.1 +mypy==1.20.0 # via qcodes (pyproject.toml) mypy-extensions==1.1.0 # via mypy From 4dcdd57e7319bc23dc3c2f5931c552b5960511f1 Mon Sep 17 00:00:00 2001 From: "Jens H. Nielsen" Date: Tue, 31 Mar 2026 21:17:10 +0200 Subject: [PATCH 2/3] Add support for mypy 1.20 --- src/qcodes/extensions/infer.py | 6 +++--- src/qcodes/instrument_drivers/AlazarTech/dll_wrapper.py | 4 ++-- .../Keysight/keysightb1500/KeysightB1500_module.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qcodes/extensions/infer.py b/src/qcodes/extensions/infer.py index d22b4060fd6..a88c98783d0 100644 --- a/src/qcodes/extensions/infer.py +++ b/src/qcodes/extensions/infer.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Sequence -from typing import TYPE_CHECKING, ClassVar, TypeVar, cast +from typing import TYPE_CHECKING, ClassVar, TypeVar from qcodes.instrument import Instrument, InstrumentBase, InstrumentModule from qcodes.parameters import DelegateParameter, Parameter, ParameterBase @@ -230,7 +230,7 @@ def get_chain_links_of_type( ) -> tuple[C, ...]: """Gets all parameters in a chain of linked parameters that match a given type""" chain_links: list[C] = [ - cast("C", param) + param for param in get_parameter_chain(parameter) if isinstance(param, link_param_type) ] @@ -265,7 +265,7 @@ def get_parent_instruments_from_chain_of_type( param_chain = get_parameter_chain(parameter) return tuple( [ - cast("TInstrument", param.instrument) + param.instrument for param in param_chain if isinstance(param.instrument, instrument_type) ] diff --git a/src/qcodes/instrument_drivers/AlazarTech/dll_wrapper.py b/src/qcodes/instrument_drivers/AlazarTech/dll_wrapper.py index 15ef4368503..d7573bb5836 100644 --- a/src/qcodes/instrument_drivers/AlazarTech/dll_wrapper.py +++ b/src/qcodes/instrument_drivers/AlazarTech/dll_wrapper.py @@ -179,10 +179,10 @@ def __apply_signatures(self) -> None: if ret_type is RETURN_CODE: # since RETURN_CODE is a NewType checking that # ret_type is RETURN_CODE only narrows the type - # of it to type. The type checker therefor does not know + # of it to type. The type checker therefore does not know # that this type has a __supertype__ attribute ret_type = ( - ret_type.__supertype__ # pyright: ignore[reportFunctionMemberAccess] + ret_type.__supertype__ # type: ignore[attr-defined] ) c_func.errcheck = _check_error_code elif ret_type in ( diff --git a/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_module.py b/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_module.py index 9a219dc378c..479399c571b 100644 --- a/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_module.py +++ b/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_module.py @@ -378,7 +378,7 @@ def clear_timer_count(self) -> None: class StatusMixin: def __init__(self) -> None: - self.names = tuple(["param1", "param2"]) + self.names: tuple[str, ...] = ("param1", "param2") def status_summary(self) -> dict[str, str]: return_dict: dict[str, str] = {} From e9c1ff3bb14c6c4e87dffe86a3f5d7486093b78c Mon Sep 17 00:00:00 2001 From: "Jens H. Nielsen" Date: Tue, 31 Mar 2026 21:17:29 +0200 Subject: [PATCH 3/3] Bump mypy --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 416bde6b136..4515823ee8d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,7 +69,7 @@ test = [ "hypothesis>=6.130.0", "lxml>=4.9.4", "lxml-stubs>=0.4.0", - "mypy>=1.16.0", + "mypy>=1.20.0", "pandas-stubs>=1.2.0.1", "pytest>=8.2.0", "pytest-asyncio>=0.24.0",