From 62391805837044c0a98859d456dde114454707da Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 27 Apr 2024 04:56:13 +0000 Subject: [PATCH 1/2] Bump mypy from 1.9.0 to 1.10.0 in /misc/requirements Bumps [mypy](https://github.com/python/mypy) from 1.9.0 to 1.10.0. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/1.9.0...v1.10.0) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- misc/requirements/requirements_mypy.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/requirements/requirements_mypy.txt b/misc/requirements/requirements_mypy.txt index be66d1f1..4f7ff32d 100644 --- a/misc/requirements/requirements_mypy.txt +++ b/misc/requirements/requirements_mypy.txt @@ -1,2 +1,2 @@ -mypy==1.9.0 +mypy==1.10.0 PyQt5-stubs==5.15.6.0 From 0194ec352c40f9edece4bb8f17984f3b33bb823b Mon Sep 17 00:00:00 2001 From: karlch Date: Fri, 10 May 2024 10:58:18 +0200 Subject: [PATCH 2/2] Mypy: add workaround for wrong type in ternary See https://github.com/python/mypy/issues/12056 --- vimiv/utils/imageheader.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vimiv/utils/imageheader.py b/vimiv/utils/imageheader.py index db6bc3f7..2d749f0a 100644 --- a/vimiv/utils/imageheader.py +++ b/vimiv/utils/imageheader.py @@ -53,7 +53,7 @@ import functools -from typing import Optional, List, Callable, Tuple, BinaryIO +from typing import Optional, List, Callable, Tuple, BinaryIO, cast from vimiv.qt.gui import QImageReader @@ -127,7 +127,8 @@ def check_verified(header: bytes, file: BinaryIO) -> bool: _registry.remove((filetype, check_verified)) return False - check_register = check_verified if validate else check + # See: https://github.com/python/mypy/issues/12056 + check_register = cast(CheckFuncT, check_verified if validate else check) if priority: _registry.insert(0, (filetype, check_register))