From: Mike Bayer Date: Mon, 26 Sep 2022 22:05:42 +0000 (-0400) Subject: adjust for mypy 0.981 X-Git-Tag: rel_2_0_0b1~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c07c68c36815de6cb3aeeeb87a94824310cb551;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git adjust for mypy 0.981 new release is out today, fix a very small number of new issues. Change-Id: I443c78f3384319d56deb2c9309118ffb750bbf41 --- diff --git a/lib/sqlalchemy/ext/associationproxy.py b/lib/sqlalchemy/ext/associationproxy.py index f238f4f8ae..6285c4ce38 100644 --- a/lib/sqlalchemy/ext/associationproxy.py +++ b/lib/sqlalchemy/ext/associationproxy.py @@ -199,7 +199,7 @@ class _ProxyFactoryProtocol(Protocol): creator: _CreatorProtocol[Any], value_attr: str, parent: AssociationProxyInstance[Any], - ) -> _T: + ) -> Any: ... diff --git a/lib/sqlalchemy/util/_concurrency_py3k.py b/lib/sqlalchemy/util/_concurrency_py3k.py index 17b4b34988..969e8d92ea 100644 --- a/lib/sqlalchemy/util/_concurrency_py3k.py +++ b/lib/sqlalchemy/util/_concurrency_py3k.py @@ -36,10 +36,10 @@ if typing.TYPE_CHECKING: ... def throw(self, *arg: Any) -> Any: - ... + return None def switch(self, value: Any) -> Any: - ... + return None def getcurrent() -> greenlet: ... diff --git a/tox.ini b/tox.ini index 3b2c1b6742..e7f17e2e9e 100644 --- a/tox.ini +++ b/tox.ini @@ -129,7 +129,7 @@ commands= deps= greenlet != 0.4.17 importlib_metadata; python_version < '3.8' - mypy >= 0.971 + mypy >= 0.981 commands = mypy ./lib/sqlalchemy # pyright changes too often with not-exactly-correct errors @@ -142,7 +142,7 @@ deps= pytest-xdist greenlet != 0.4.17 importlib_metadata; python_version < '3.8' - mypy + mypy >= 0.981 patch==1.* commands =