]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
support mypy 2.0
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 7 May 2026 15:54:58 +0000 (11:54 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 7 May 2026 15:56:54 +0000 (11:56 -0400)
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)

lib/sqlalchemy/dialects/mysql/reflection.py
pyproject.toml
tox.ini

index c9dfb13086f3c29089da938277e28383a406ed30..df0b88ebb0761e0b37180f37da46e9551071afd5 100644 (file)
@@ -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("''", "'")
index 9f4f7ef18fb9d914be4cf4593dac296cf2ed5de0..628ff4af61bc178e4f3f571767cb474996811f47 100644 (file)
@@ -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 3fa98f7dd409daf06320b9a51f9983553099ccb1..f94bd3b6747ac6e391458893eb79368fe23816d4 100644 (file)
--- 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