From: Mike Bayer Date: Thu, 7 May 2026 15:54:58 +0000 (-0400) Subject: support mypy 2.0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2aa60e24d69f0d388853a889d51ddb4f2ce3c9ef;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git support mypy 2.0 mypy just went to 2.0. and there seems to be... exactly one "type: ignore" to remove and...that's it? well OK! Change-Id: I29f919641acc0e970b566c850063db7ecad70ed9 (cherry picked from commit dcb36d73bbf6a8e6e780aae3c5ae40e8d03bec3a) --- diff --git a/lib/sqlalchemy/dialects/mysql/reflection.py b/lib/sqlalchemy/dialects/mysql/reflection.py index c9dfb13086..df0b88ebb0 100644 --- a/lib/sqlalchemy/dialects/mysql/reflection.py +++ b/lib/sqlalchemy/dialects/mysql/reflection.py @@ -704,7 +704,7 @@ def cleanup_text(raw_text: str) -> str: if "\\" in raw_text: raw_text = re.sub( _control_char_regexp, - lambda s: _control_char_map[s[0]], # type: ignore[index] + lambda s: _control_char_map[s[0]], # type: ignore[unused-ignore,index] # noqa: E501 raw_text, ) return raw_text.replace("''", "'") diff --git a/pyproject.toml b/pyproject.toml index 9f4f7ef18f..628ff4af61 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,7 +95,7 @@ lint = [ mypy = [ {include-group = "tests-greenlet"}, - "mypy>=1.20.0", + "mypy>=2", "nox", # because we check noxfile.py "pytest>8,<10", # alembic/testing imports pytest "types-greenlet", diff --git a/tox.ini b/tox.ini index 3fa98f7dd4..f94bd3b674 100644 --- a/tox.ini +++ b/tox.ini @@ -205,7 +205,7 @@ commands= deps= greenlet >= 1 importlib_metadata; python_version < '3.8' - mypy >= 1.19.0 + mypy >= 2 types-greenlet commands = mypy {env:MYPY_COLOR} ./lib/sqlalchemy