Upgrade pyright, improve pyright config files (#8072)

This commit is contained in:
Alex Waygood
2022-06-16 18:50:50 +01:00
committed by GitHub
parent a2ef47660a
commit 6b0c8df9ec
12 changed files with 59 additions and 29 deletions

View File

@@ -125,6 +125,15 @@ sqlalchemy.engine.url.URL.normalized_query
# runtime has extra internal arguments that are inconsistent across micro versions
sqlalchemy.testing.engines.testing_engine
# __new__ signature conflicts with __init__ signature (which is more precise),
# so __new__ is deliberately omitted in the stub
sqlalchemy.sql.annotation.Annotated.__new__
# At runtime __new__ is defined, but we define __init__ in the stub
# because otherwise all subclasses would be identified by pyright
# as having conflicting __new__/__init__ methods
sqlalchemy.orm.unitofwork.PostSortRec.__new__
# unclear problems
sqlalchemy.sql.elements.quoted_name.lower
sqlalchemy.sql.elements.quoted_name.upper

View File

@@ -49,7 +49,10 @@ class Preprocess(IterateMappersMixin):
class PostSortRec:
disabled: Any
def __new__(cls, uow, *args): ...
# At runtime __new__ is defined, not __init__,
# But if we define __new__ here then all subclasses are identified by pyright
# as having __init__ methods that are inconsistent with their __new__ methods
def __init__(self, uow, *args) -> None: ...
def execute_aggregate(self, uow, recs) -> None: ...
class ProcessAll(IterateMappersMixin, PostSortRec):

View File

@@ -7,7 +7,6 @@ class SupportsCloneAnnotations(SupportsAnnotations): ...
class SupportsWrappingAnnotations(SupportsAnnotations): ...
class Annotated:
def __new__(cls, *args): ...
__dict__: Any
def __init__(self, element, values) -> None: ...
def __reduce__(self): ...