From: Mike Bayer Date: Wed, 23 Feb 2022 19:02:07 +0000 (-0500) Subject: disable pyright from pep 484 X-Git-Tag: rel_2_0_0b1~472 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19f13584b07b03a6ee775c197e0e8cda681e9d5a;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git disable pyright from pep 484 new version of pyright is suddenly emitting an error that makes no sense for a particular line of code, breaking builds. As we already have mypy which is generally more conservative in its checking, disable pyright from CI for now until it changes its behaviors less often. Change-Id: I862de1b2c8a180df95c74c1c6dafa96d86c36ef1 --- diff --git a/lib/sqlalchemy/util/_collections.py b/lib/sqlalchemy/util/_collections.py index bbb08d91f2..84735316d2 100644 --- a/lib/sqlalchemy/util/_collections.py +++ b/lib/sqlalchemy/util/_collections.py @@ -511,7 +511,7 @@ class LRUCache(typing.MutableMapping[_KT, _VT]): capacity: int threshold: float - size_alert: Callable[["LRUCache[_KT, _VT]"], None] + size_alert: Optional[Callable[["LRUCache[_KT, _VT]"], None]] def __init__(self, capacity=100, threshold=0.5, size_alert=None): self.capacity = capacity diff --git a/tox.ini b/tox.ini index c3420a00f7..961add4b0d 100644 --- a/tox.ini +++ b/tox.ini @@ -133,10 +133,12 @@ deps= greenlet != 0.4.17 importlib_metadata; python_version < '3.8' mypy - pyright + # pyright commands = mypy ./lib/sqlalchemy - pyright + # pyright changes too often with not-exactly-correct errors + # suddently appearing for it to be stable enough for CI + # pyright [testenv:mypy] deps=