From 19f13584b07b03a6ee775c197e0e8cda681e9d5a Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 23 Feb 2022 14:02:07 -0500 Subject: [PATCH] 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 --- lib/sqlalchemy/util/_collections.py | 2 +- tox.ini | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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= -- 2.47.3