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=dcb36d73bbf6a8e6e780aae3c5ae40e8d03bec3a;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 --- diff --git a/lib/sqlalchemy/dialects/mysql/reflection.py b/lib/sqlalchemy/dialects/mysql/reflection.py index 1cc643e840..bf72ec02e4 100644 --- a/lib/sqlalchemy/dialects/mysql/reflection.py +++ b/lib/sqlalchemy/dialects/mysql/reflection.py @@ -701,7 +701,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 9cc90ee099..9c03972be5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,7 @@ Discussions = "https://github.com/sqlalchemy/sqlalchemy/discussions" [project.optional-dependencies] asyncio = ["greenlet>=1"] mypy = [ - "mypy >= 1.20", + "mypy >= 2", "types-greenlet >= 2", ] mssql = ["pyodbc"] diff --git a/tox.ini b/tox.ini index 5f051f295f..484e4055db 100644 --- a/tox.ini +++ b/tox.ini @@ -203,7 +203,7 @@ commands= [testenv:pep484] deps= greenlet >= 1 - mypy >= 1.17.0 + mypy >= 2 types-greenlet commands = mypy {env:MYPY_COLOR} ./lib/sqlalchemy