]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
happy mypy day
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 28 Nov 2025 16:48:22 +0000 (11:48 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 28 Nov 2025 16:48:22 +0000 (11:48 -0500)
Change-Id: Ic72aeea508e73344927692f62332b2b62a8cbdea

lib/sqlalchemy/engine/_processors_cy.py
lib/sqlalchemy/engine/_row_cy.py
lib/sqlalchemy/engine/_util_cy.py
lib/sqlalchemy/engine/row.py
lib/sqlalchemy/orm/mapped_collection.py
lib/sqlalchemy/sql/_util_cy.py
lib/sqlalchemy/util/_collections_cy.py
lib/sqlalchemy/util/_immutabledict_cy.py
lib/sqlalchemy/util/langhelpers.py
pyproject.toml

index 2d9cbab0bc5d7d7419e9024195f5e3df88837574..5da3e3c941ceca61f61dbf9c5616ad02aef2a3e6 100644 (file)
@@ -4,7 +4,7 @@
 #
 # This module is part of SQLAlchemy and is released under
 # the MIT License: https://www.opensource.org/licenses/mit-license.php
-# mypy: disable-error-code="misc"
+# mypy: disable-error-code="misc, untyped-decorator"
 from __future__ import annotations
 
 from datetime import date as date_cls
index 29d8f6548c4afcf48223c8a37e27b9a72bdbb7d3..320bba11cf5d9a8d3d22553c3bd30cc5a3de2bb7 100644 (file)
@@ -6,6 +6,7 @@
 # the MIT License: https://www.opensource.org/licenses/mit-license.php
 # mypy: disable-error-code="misc,no-redef,valid-type,no-untyped-call"
 # mypy: disable-error-code="index,no-any-return,arg-type,assignment"
+# mypy: disable-error-code="untyped-decorator"
 from __future__ import annotations
 
 from typing import Any
index dd56c65d2a81f1dbf7df3728db1bfb41256faf84..b9f08bb0e2b96c660a14adc3929384a7a9812b03 100644 (file)
@@ -4,7 +4,7 @@
 #
 # This module is part of SQLAlchemy and is released under
 # the MIT License: https://www.opensource.org/licenses/mit-license.php
-# mypy: disable-error-code="misc, type-arg"
+# mypy: disable-error-code="misc, type-arg, untyped-decorator"
 from __future__ import annotations
 
 from collections.abc import Mapping
index 0744569f831cdc0a6f49468fc52730a00778ef3d..14ed442ab19a9c51ecceda42a2ed8afcfc8b0c57 100644 (file)
@@ -43,7 +43,7 @@ else:
 _Ts = TypeVarTuple("_Ts")
 
 
-class Row(BaseRow, _RowBase[Unpack[_Ts]], Generic[Unpack[_Ts]]):
+class Row(BaseRow, _RowBase[Unpack[_Ts]], Generic[Unpack[_Ts]]):  # type: ignore[misc]  # noqa: E501
     """Represent a single result row.
 
     The :class:`.Row` object represents a row of a database result.  It is
index a5885fc9d03caa9c370543b224beeecb08585a5c..a3e2e9b34a5f0e90b3e1b0ec045a30893a00b447 100644 (file)
@@ -443,8 +443,8 @@ class KeyFuncDict(Dict[_KT, _VT]):
                 f"parameter on the mapped collection factory."
             )
 
-    @collection.appender  # type: ignore[misc]
-    @collection.internally_instrumented  # type: ignore[misc]
+    @collection.appender  # type: ignore[untyped-decorator]
+    @collection.internally_instrumented  # type: ignore[untyped-decorator]
     def set(
         self,
         value: _KT,
@@ -472,8 +472,8 @@ class KeyFuncDict(Dict[_KT, _VT]):
 
         self.__setitem__(key, value, _sa_initiator)  # type: ignore[call-arg]
 
-    @collection.remover  # type: ignore[misc]
-    @collection.internally_instrumented  # type: ignore[misc]
+    @collection.remover  # type: ignore[untyped-decorator]
+    @collection.internally_instrumented  # type: ignore[untyped-decorator]
     def remove(
         self,
         value: _KT,
index ddb8680196df2325b5db17ae3dbe8e60c4fd81b6..d4ae4669d647d3df0b88d7818fdfeae89b846f7e 100644 (file)
@@ -4,6 +4,7 @@
 #
 # This module is part of SQLAlchemy and is released under
 # the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: disable-error-code="untyped-decorator"
 
 from __future__ import annotations
 
@@ -94,8 +95,8 @@ class anon_map(Dict[_AM_KEY, _AM_VALUE]):
     else:
         _index: int = 0  # type: ignore[no-redef]
 
-    @cython.cfunc  # type:ignore[misc]
-    @cython.inline  # type:ignore[misc]
+    @cython.cfunc
+    @cython.inline
     def _add_missing(self: anon_map, key: _AM_KEY, /) -> int:
         val: int = self._index
         self._index += 1
index 65c3b5a68474ee3103ca1e4e0ae6f9fa368f8a46..d823ed4b96eecc1a241472fc6acb001e043a45b2 100644 (file)
@@ -5,6 +5,7 @@
 # This module is part of SQLAlchemy and is released under
 # the MIT License: https://www.opensource.org/licenses/mit-license.php
 # mypy: disable-error-code="misc, no-any-return, no-untyped-def, override"
+# mypy: disable-error-code="untyped-decorator"
 
 from __future__ import annotations
 
index 5eb018fbdbb488577d88196758ddeb3f8cc0915d..9a32f19a76072bab2e58a52576d563b1f7a9aa14 100644 (file)
@@ -4,7 +4,7 @@
 #
 # This module is part of SQLAlchemy and is released under
 # the MIT License: https://www.opensource.org/licenses/mit-license.php
-# mypy: disable-error-code="misc, arg-type"
+# mypy: disable-error-code="misc, arg-type, untyped-decorator"
 from __future__ import annotations
 
 from typing import Any
index a8313d08e10e6bb2da03085d9c0352b2433db93a..7bd293d40c470ea414b2bde1f8e89072c5b8c4a9 100644 (file)
@@ -75,7 +75,7 @@ if compat.py314:
         return None
 
     # this is ported from py3.13.0a7
-    _BASE_GET_ANNOTATIONS = type.__dict__["__annotations__"].__get__  # type: ignore  # noqa: E501
+    _BASE_GET_ANNOTATIONS = type.__dict__["__annotations__"].__get__
 
     def _get_dunder_annotations(obj):
         if isinstance(obj, type):
index 16ce68e5140639768793d26ffac1588cdcbe3ab0..26ac357af1a1ebeb94918e73870fc5d96181e559 100644 (file)
@@ -45,7 +45,7 @@ Discussions = "https://github.com/sqlalchemy/sqlalchemy/discussions"
 [project.optional-dependencies]
 asyncio = ["greenlet>=1"]
 mypy = [
-    "mypy >= 1.7",
+    "mypy >= 1.19",
     "types-greenlet >= 2",
 ]
 mssql = ["pyodbc"]
@@ -190,7 +190,7 @@ lint = [
 
 mypy = [
     {include-group = "tests-greenlet"},
-    "mypy>=1.16.0",
+    "sqlalchemy[mypy]",
     "nox",  # because we check noxfile.py
     "pytest>8,<10",  # alembic/testing imports pytest
     "types-greenlet",