diff --git a/packages/pyright-internal/typeshed-fallback/commit.txt b/packages/pyright-internal/typeshed-fallback/commit.txt index 4ba3303cc..528132fb5 100644 --- a/packages/pyright-internal/typeshed-fallback/commit.txt +++ b/packages/pyright-internal/typeshed-fallback/commit.txt @@ -1 +1 @@ -da895e39448498971d437def4c4e464c419f2043 +387ef818837a44696e1efe5e935324869d1cf437 diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/VERSIONS b/packages/pyright-internal/typeshed-fallback/stdlib/VERSIONS index f3f9aaee3..e82161d97 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/VERSIONS +++ b/packages/pyright-internal/typeshed-fallback/stdlib/VERSIONS @@ -139,6 +139,7 @@ imghdr: 2.7- imp: 2.7- importlib: 2.7- importlib.metadata: 3.8- +importlib.metadata._meta: 3.10- importlib.resources: 3.7- inspect: 2.7- io: 2.7- diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_bisect.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_bisect.pyi index 6da6e7f58..1f67dadd8 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_bisect.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_bisect.pyi @@ -1,21 +1,31 @@ import sys -from _typeshed import SupportsLessThan +from _typeshed import SupportsRichComparison from typing import Callable, MutableSequence, Sequence, TypeVar _T = TypeVar("_T") if sys.version_info >= (3, 10): def bisect_left( - a: Sequence[_T], x: _T, lo: int = ..., hi: int | None = ..., *, key: Callable[[_T], SupportsLessThan] | None = ... + a: Sequence[_T], x: _T, lo: int = ..., hi: int | None = ..., *, key: Callable[[_T], SupportsRichComparison] | None = ... ) -> int: ... def bisect_right( - a: Sequence[_T], x: _T, lo: int = ..., hi: int | None = ..., *, key: Callable[[_T], SupportsLessThan] | None = ... + a: Sequence[_T], x: _T, lo: int = ..., hi: int | None = ..., *, key: Callable[[_T], SupportsRichComparison] | None = ... ) -> int: ... def insort_left( - a: MutableSequence[_T], x: _T, lo: int = ..., hi: int | None = ..., *, key: Callable[[_T], SupportsLessThan] | None = ... + a: MutableSequence[_T], + x: _T, + lo: int = ..., + hi: int | None = ..., + *, + key: Callable[[_T], SupportsRichComparison] | None = ..., ) -> None: ... def insort_right( - a: MutableSequence[_T], x: _T, lo: int = ..., hi: int | None = ..., *, key: Callable[[_T], SupportsLessThan] | None = ... + a: MutableSequence[_T], + x: _T, + lo: int = ..., + hi: int | None = ..., + *, + key: Callable[[_T], SupportsRichComparison] | None = ..., ) -> None: ... else: diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_codecs.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_codecs.pyi index 5e4a9ad6d..a44a8a1a7 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_codecs.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_codecs.pyi @@ -24,10 +24,22 @@ def escape_decode(__data: str | bytes, __errors: str | None = ...) -> tuple[str, def escape_encode(__data: bytes, __errors: str | None = ...) -> tuple[bytes, int]: ... def latin_1_decode(__data: bytes, __errors: str | None = ...) -> tuple[str, int]: ... def latin_1_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ... -def raw_unicode_escape_decode(__data: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ... + +if sys.version_info >= (3, 9): + def raw_unicode_escape_decode(__data: str | bytes, __errors: str | None = ..., __final: bool = ...) -> tuple[str, int]: ... + +else: + def raw_unicode_escape_decode(__data: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ... + def raw_unicode_escape_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ... def readbuffer_encode(__data: str | bytes, __errors: str | None = ...) -> tuple[bytes, int]: ... -def unicode_escape_decode(__data: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ... + +if sys.version_info >= (3, 9): + def unicode_escape_decode(__data: str | bytes, __errors: str | None = ..., __final: bool = ...) -> tuple[str, int]: ... + +else: + def unicode_escape_decode(__data: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ... + def unicode_escape_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ... if sys.version_info < (3, 8): diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_csv.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_csv.pyi index 734c5654e..65f0ca27f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_csv.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_csv.pyi @@ -1,8 +1,5 @@ from typing import Any, Iterable, Iterator, List, Protocol, Type, Union -# __version__ is deliberately not defined here or in csv.pyi, -# as it appears to have been hardcoded at "1.0" for a very long time! - QUOTE_ALL: int QUOTE_MINIMAL: int QUOTE_NONE: int diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_curses.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_curses.pyi index 80e7776c1..d2eb1e1a4 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_curses.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_curses.pyi @@ -1,5 +1,6 @@ import sys -from typing import IO, Any, BinaryIO, NamedTuple, Union, overload +from _typeshed import SupportsRead +from typing import IO, Any, NamedTuple, Union, overload _chtype = Union[str, bytes, int] @@ -293,9 +294,14 @@ def erasechar() -> bytes: ... def filter() -> None: ... def flash() -> None: ... def flushinp() -> None: ... + +if sys.version_info >= (3, 9): + def get_escdelay() -> int: ... + def get_tabsize() -> int: ... + def getmouse() -> tuple[int, int, int, int, int]: ... def getsyx() -> tuple[int, int]: ... -def getwin(__file: BinaryIO) -> _CursesWindow: ... +def getwin(__file: SupportsRead[bytes]) -> _CursesWindow: ... def halfdelay(__tenths: int) -> None: ... def has_colors() -> bool: ... @@ -337,6 +343,11 @@ def resetty() -> None: ... def resize_term(__nlines: int, __ncols: int) -> None: ... def resizeterm(__nlines: int, __ncols: int) -> None: ... def savetty() -> None: ... + +if sys.version_info >= (3, 9): + def set_escdelay(__ms: int) -> None: ... + def set_tabsize(__size: int) -> None: ... + def setsyx(__y: int, __x: int) -> None: ... def setupterm(term: str | None = ..., fd: int = ...) -> None: ... def start_color() -> None: ... @@ -344,7 +355,7 @@ def termattrs() -> int: ... def termname() -> bytes: ... def tigetflag(__capname: str) -> int: ... def tigetnum(__capname: str) -> int: ... -def tigetstr(__capname: str) -> bytes: ... +def tigetstr(__capname: str) -> bytes | None: ... def tparm( __str: bytes, __i1: int = ..., @@ -362,7 +373,7 @@ def unctrl(__ch: _chtype) -> bytes: ... def unget_wch(__ch: int | str) -> None: ... def ungetch(__ch: _chtype) -> None: ... def ungetmouse(__id: int, __x: int, __y: int, __z: int, __bstate: int) -> None: ... -def update_lines_cols() -> int: ... +def update_lines_cols() -> None: ... def use_default_colors() -> None: ... def use_env(__flag: bool) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_operator.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_operator.pyi index a945a0be7..408ec7ca2 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_operator.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_operator.pyi @@ -1,4 +1,5 @@ import sys +from _typeshed import SupportsAnyComparison from typing import ( Any, AnyStr, @@ -14,7 +15,6 @@ from typing import ( SupportsAbs, Tuple, TypeVar, - Union, overload, ) from typing_extensions import ParamSpec, SupportsIndex, final @@ -35,27 +35,13 @@ class _SupportsNeg(Protocol[_T_co]): class _SupportsPos(Protocol[_T_co]): def __pos__(self) -> _T_co: ... -# Different to _typeshed.SupportsLessThan -class _SupportsLT(Protocol): - def __lt__(self, other: Any) -> Any: ... - -class _SupportsGT(Protocol): - def __gt__(self, other: Any) -> Any: ... - -class _SupportsLE(Protocol): - def __le__(self, other: Any) -> Any: ... - -class _SupportsGE(Protocol): - def __ge__(self, other: Any) -> Any: ... - -_SupportsComparison = Union[_SupportsLE, _SupportsGE, _SupportsGT, _SupportsLT] - -def lt(__a: _SupportsComparison, __b: _SupportsComparison) -> Any: ... -def le(__a: _SupportsComparison, __b: _SupportsComparison) -> Any: ... +# All four comparison functions must have the same signature, or we get false-positive errors +def lt(__a: SupportsAnyComparison, __b: SupportsAnyComparison) -> Any: ... +def le(__a: SupportsAnyComparison, __b: SupportsAnyComparison) -> Any: ... def eq(__a: object, __b: object) -> Any: ... def ne(__a: object, __b: object) -> Any: ... -def ge(__a: _SupportsComparison, __b: _SupportsComparison) -> Any: ... -def gt(__a: _SupportsComparison, __b: _SupportsComparison) -> Any: ... +def ge(__a: SupportsAnyComparison, __b: SupportsAnyComparison) -> Any: ... +def gt(__a: SupportsAnyComparison, __b: SupportsAnyComparison) -> Any: ... def not_(__a: object) -> bool: ... def truth(__a: object) -> bool: ... def is_(__a: object, __b: object) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_socket.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_socket.pyi index 846f64d5a..828981772 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_socket.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_socket.pyi @@ -527,6 +527,8 @@ class socket: family: int type: int proto: int + @property + def timeout(self) -> float | None: ... def __init__(self, family: int = ..., type: int = ..., proto: int = ..., fileno: _FD | None = ...) -> None: ... def bind(self, __address: _Address | bytes) -> None: ... def close(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_thread.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_thread.pyi index 2f4252981..55ca3e80c 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_thread.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_thread.pyi @@ -1,4 +1,5 @@ import sys +from _typeshed import structseq from threading import Thread from types import TracebackType from typing import Any, Callable, NoReturn, Optional, Tuple, Type @@ -32,7 +33,9 @@ TIMEOUT_MAX: float if sys.version_info >= (3, 8): def get_native_id() -> int: ... # only available on some platforms @final - class _ExceptHookArgs(Tuple[Type[BaseException], Optional[BaseException], Optional[TracebackType], Optional[Thread]]): + class _ExceptHookArgs( + structseq[Any], Tuple[Type[BaseException], Optional[BaseException], Optional[TracebackType], Optional[Thread]] + ): @property def exc_type(self) -> Type[BaseException]: ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_typeshed/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_typeshed/__init__.pyi index 8c0005294..a7f8c5147 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_typeshed/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_typeshed/__init__.pyi @@ -7,7 +7,7 @@ import ctypes import mmap import sys from os import PathLike -from typing import AbstractSet, Any, Awaitable, Container, Iterable, Protocol, TypeVar, Union +from typing import AbstractSet, Any, Awaitable, ClassVar, Container, Generic, Iterable, Protocol, Type, TypeVar, Union from typing_extensions import Literal, final _KT = TypeVar("_KT") @@ -35,15 +35,25 @@ class SupportsNext(Protocol[_T_co]): class SupportsAnext(Protocol[_T_co]): def __anext__(self) -> Awaitable[_T_co]: ... -class SupportsLessThan(Protocol): - def __lt__(self, __other: Any) -> bool: ... +# Comparison protocols -SupportsLessThanT = TypeVar("SupportsLessThanT", bound=SupportsLessThan) # noqa: Y001 +class SupportsDunderLT(Protocol): + def __lt__(self, __other: Any) -> Any: ... -class SupportsGreaterThan(Protocol): - def __gt__(self, __other: Any) -> bool: ... +class SupportsDunderGT(Protocol): + def __gt__(self, __other: Any) -> Any: ... -SupportsGreaterThanT = TypeVar("SupportsGreaterThanT", bound=SupportsGreaterThan) # noqa: Y001 +class SupportsDunderLE(Protocol): + def __le__(self, __other: Any) -> Any: ... + +class SupportsDunderGE(Protocol): + def __ge__(self, __other: Any) -> Any: ... + +class SupportsAllComparisons(SupportsDunderLT, SupportsDunderGT, SupportsDunderLE, SupportsDunderGE, Protocol): ... + +SupportsRichComparison = Union[SupportsDunderLT, SupportsDunderGT] +SupportsRichComparisonT = TypeVar("SupportsRichComparisonT", bound=SupportsRichComparison) # noqa: Y001 +SupportsAnyComparison = Union[SupportsDunderLE, SupportsDunderGE, SupportsDunderGT, SupportsDunderLT] class SupportsDivMod(Protocol[_T_contra, _T_co]): def __divmod__(self, __other: _T_contra) -> _T_co: ... @@ -189,3 +199,20 @@ else: @final class NoneType: def __bool__(self) -> Literal[False]: ... + +# This is an internal CPython type that is like, but subtly different from, a NamedTuple +# Subclasses of this type are found in multiple modules. +# In typeshed, `structseq` is only ever used as a mixin in combination with a fixed-length `Tuple` +# See discussion at #6546 & #6560 +# `structseq` classes are unsubclassable, so are all decorated with `@final`. +class structseq(Generic[_T_co]): + n_fields: ClassVar[int] + n_unnamed_fields: ClassVar[int] + n_sequence_fields: ClassVar[int] + # The first parameter will generally only take an iterable of a specific length. + # E.g. `os.uname_result` takes any iterable of length exactly 5. + # + # The second parameter will accept a dict of any kind without raising an exception, + # but only has any meaning if you supply it a dict where the keys are strings. + # https://github.com/python/typeshed/pull/6560#discussion_r767149830 + def __new__(cls: Type[_T], sequence: Iterable[_T_co], dict: dict[str, Any] = ...) -> _T: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_typeshed/xml.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_typeshed/xml.pyi index d53b743af..231c2b86e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_typeshed/xml.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_typeshed/xml.pyi @@ -1,7 +1,6 @@ # See the README.md file in this directory for more information. -from typing import Any -from typing_extensions import Protocol +from typing import Any, Protocol # As defined https://docs.python.org/3/library/xml.dom.html#domimplementation-objects class DOMImplementation(Protocol): diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/ast.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/ast.pyi index 8f9865679..8494a3a99 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/ast.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/ast.pyi @@ -165,6 +165,57 @@ if sys.version_info >= (3, 8): feature_version: None | int | _typing.Tuple[int, int] = ..., ) -> Module: ... @overload + def parse( + source: str | bytes, + filename: str | bytes, + mode: Literal["eval"], + *, + type_comments: bool = ..., + feature_version: None | int | _typing.Tuple[int, int] = ..., + ) -> Expression: ... + @overload + def parse( + source: str | bytes, + filename: str | bytes, + mode: Literal["func_type"], + *, + type_comments: bool = ..., + feature_version: None | int | _typing.Tuple[int, int] = ..., + ) -> FunctionType: ... + @overload + def parse( + source: str | bytes, + filename: str | bytes, + mode: Literal["single"], + *, + type_comments: bool = ..., + feature_version: None | int | _typing.Tuple[int, int] = ..., + ) -> Interactive: ... + @overload + def parse( + source: str | bytes, + *, + mode: Literal["eval"], + type_comments: bool = ..., + feature_version: None | int | _typing.Tuple[int, int] = ..., + ) -> Expression: ... + @overload + def parse( + source: str | bytes, + *, + mode: Literal["func_type"], + type_comments: bool = ..., + feature_version: None | int | _typing.Tuple[int, int] = ..., + ) -> FunctionType: ... + @overload + def parse( + source: str | bytes, + *, + mode: Literal["single"], + type_comments: bool = ..., + feature_version: None | int | _typing.Tuple[int, int] = ..., + ) -> Interactive: ... + @overload def parse( source: str | bytes, filename: str | bytes = ..., @@ -178,6 +229,14 @@ else: @overload def parse(source: str | bytes, filename: str | bytes = ..., mode: Literal["exec"] = ...) -> Module: ... @overload + def parse(source: str | bytes, filename: str | bytes, mode: Literal["eval"]) -> Expression: ... + @overload + def parse(source: str | bytes, filename: str | bytes, mode: Literal["single"]) -> Interactive: ... + @overload + def parse(source: str | bytes, *, mode: Literal["eval"]) -> Expression: ... + @overload + def parse(source: str | bytes, *, mode: Literal["single"]) -> Interactive: ... + @overload def parse(source: str | bytes, filename: str | bytes = ..., mode: str = ...) -> AST: ... if sys.version_info >= (3, 9): diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/__init__.pyi index 53293e95a..f2f7c6b0d 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/__init__.pyi @@ -73,39 +73,46 @@ from .transports import ( if sys.version_info < (3, 11): from .coroutines import coroutine as coroutine -if sys.version_info >= (3, 7): - from .events import get_running_loop as get_running_loop + +if sys.version_info >= (3, 9): + from .threads import to_thread as to_thread + if sys.version_info >= (3, 8): from .exceptions import ( CancelledError as CancelledError, IncompleteReadError as IncompleteReadError, InvalidStateError as InvalidStateError, LimitOverrunError as LimitOverrunError, - SendfileNotAvailableError as SendfileNotAvailableError, TimeoutError as TimeoutError, ) else: - if sys.version_info >= (3, 7): - from .events import SendfileNotAvailableError as SendfileNotAvailableError from .futures import CancelledError as CancelledError, InvalidStateError as InvalidStateError, TimeoutError as TimeoutError from .streams import IncompleteReadError as IncompleteReadError, LimitOverrunError as LimitOverrunError +if sys.version_info >= (3, 8): + from .exceptions import SendfileNotAvailableError as SendfileNotAvailableError +elif sys.version_info >= (3, 7): + from .events import SendfileNotAvailableError as SendfileNotAvailableError + if sys.version_info >= (3, 7): + from .events import get_running_loop as get_running_loop from .protocols import BufferedProtocol as BufferedProtocol - -if sys.version_info >= (3, 7): from .runners import run as run - -if sys.version_info >= (3, 7): - from .tasks import all_tasks as all_tasks, create_task as create_task, current_task as current_task -if sys.version_info >= (3, 9): - from .threads import to_thread as to_thread + from .tasks import ( + _enter_task as _enter_task, + _leave_task as _leave_task, + _register_task as _register_task, + _unregister_task as _unregister_task, + all_tasks as all_tasks, + create_task as create_task, + current_task as current_task, + ) DefaultEventLoopPolicy: Type[AbstractEventLoopPolicy] + if sys.platform == "win32": from .windows_events import * - -if sys.platform != "win32": +else: from .streams import open_unix_connection as open_unix_connection, start_unix_server as start_unix_server from .unix_events import ( AbstractChildWatcher as AbstractChildWatcher, diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/proactor_events.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/proactor_events.pyi index 6c8c558e5..1e9cff1b1 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/proactor_events.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/proactor_events.pyi @@ -1,7 +1,7 @@ import sys from socket import socket -from typing import Any, Mapping, Type -from typing_extensions import Literal, Protocol +from typing import Any, Mapping, Protocol, Type +from typing_extensions import Literal from . import base_events, constants, events, futures, streams, transports diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/builtins.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/builtins.pyi index 298192c7a..c8f32b2dc 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/builtins.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/builtins.pyi @@ -13,14 +13,12 @@ from _typeshed import ( StrOrBytesPath, SupportsAnext, SupportsDivMod, - SupportsGreaterThan, - SupportsGreaterThanT, SupportsKeysAndGetItem, SupportsLenAndGetItem, - SupportsLessThan, - SupportsLessThanT, SupportsNext, SupportsRDivMod, + SupportsRichComparison, + SupportsRichComparisonT, SupportsTrunc, SupportsWrite, ) @@ -30,8 +28,6 @@ from typing import ( IO, AbstractSet, Any, - AsyncIterable, - AsyncIterator, BinaryIO, ByteString, Callable, @@ -78,6 +74,14 @@ _T5 = TypeVar("_T5") _TT = TypeVar("_TT", bound="type") _TBE = TypeVar("_TBE", bound="BaseException") _R = TypeVar("_R") # Return-type TypeVar +_SupportsNextT = TypeVar("_SupportsNextT", bound=SupportsNext[Any], covariant=True) +_SupportsAnextT = TypeVar("_SupportsAnextT", bound=SupportsAnext[Any], covariant=True) + +class _SupportsIter(Protocol[_T_co]): + def __iter__(self) -> _T_co: ... + +class _SupportsAiter(Protocol[_T_co]): + def __aiter__(self) -> _T_co: ... class object: __doc__: str | None @@ -772,7 +776,6 @@ class list(MutableSequence[_T], Generic[_T]): def __init__(self) -> None: ... @overload def __init__(self, __iterable: Iterable[_T]) -> None: ... - def clear(self) -> None: ... def copy(self) -> list[_T]: ... def append(self, __object: _T) -> None: ... def extend(self, __iterable: Iterable[_T]) -> None: ... @@ -782,12 +785,11 @@ class list(MutableSequence[_T], Generic[_T]): def count(self, __value: _T) -> int: ... def insert(self, __index: SupportsIndex, __object: _T) -> None: ... def remove(self, __value: _T) -> None: ... - def reverse(self) -> None: ... # Signature of `list.sort` should be kept inline with `collections.UserList.sort()` @overload - def sort(self: list[SupportsLessThanT], *, key: None = ..., reverse: bool = ...) -> None: ... + def sort(self: list[SupportsRichComparisonT], *, key: None = ..., reverse: bool = ...) -> None: ... @overload - def sort(self, *, key: Callable[[_T], SupportsLessThan], reverse: bool = ...) -> None: ... + def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> None: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T]: ... def __str__(self) -> str: ... @@ -816,6 +818,7 @@ class list(MutableSequence[_T], Generic[_T]): def __class_getitem__(cls, __item: Any) -> GenericAlias: ... class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): + # __init__ should be kept roughly in line with `collections.UserDict.__init__`, which has similar semantics @overload def __init__(self: dict[_KT, _VT]) -> None: ... @overload @@ -829,20 +832,11 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): @overload def __init__(self: dict[str, str], __iterable: Iterable[list[str]]) -> None: ... def __new__(cls: Type[_T1], *args: Any, **kwargs: Any) -> _T1: ... - def clear(self) -> None: ... def copy(self) -> dict[_KT, _VT]: ... - def popitem(self) -> tuple[_KT, _VT]: ... - def setdefault(self, __key: _KT, __default: _VT = ...) -> _VT: ... - @overload - def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... - @overload - def update(self, __m: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None: ... - @overload - def update(self, **kwargs: _VT) -> None: ... def keys(self) -> dict_keys[_KT, _VT]: ... def values(self) -> dict_values[_KT, _VT]: ... def items(self) -> dict_items[_KT, _VT]: ... - # Signature of `dict.fromkeys` should be kept identical to `fromkeys` methods in `collections.OrderedDict`/`collections.ChainMap` + # Signature of `dict.fromkeys` should be kept identical to `fromkeys` methods of `OrderedDict`/`ChainMap`/`UserDict` in `collections` # TODO: the true signature of `dict.fromkeys` is not expressable in the current type system. # See #3800 & https://github.com/python/typing/issues/548#issuecomment-683336963. @classmethod @@ -869,7 +863,6 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): class set(MutableSet[_T], Generic[_T]): def __init__(self, __iterable: Iterable[_T] = ...) -> None: ... def add(self, __element: _T) -> None: ... - def clear(self) -> None: ... def copy(self) -> set[_T]: ... def difference(self, *s: Iterable[Any]) -> set[_T]: ... def difference_update(self, *s: Iterable[Any]) -> None: ... @@ -879,7 +872,6 @@ class set(MutableSet[_T], Generic[_T]): def isdisjoint(self, __s: Iterable[Any]) -> bool: ... def issubset(self, __s: Iterable[Any]) -> bool: ... def issuperset(self, __s: Iterable[Any]) -> bool: ... - def pop(self) -> _T: ... def remove(self, __element: _T) -> None: ... def symmetric_difference(self, __s: Iterable[_T]) -> set[_T]: ... def symmetric_difference_update(self, __s: Iterable[_T]) -> None: ... @@ -1004,7 +996,7 @@ class _PathLike(Protocol[_AnyStr_co]): def __fspath__(self) -> _AnyStr_co: ... if sys.version_info >= (3, 10): - def aiter(__async_iterable: AsyncIterable[_T]) -> AsyncIterator[_T]: ... + def aiter(__async_iterable: _SupportsAiter[_SupportsAnextT]) -> _SupportsAnextT: ... @overload async def anext(__i: SupportsAnext[_T]) -> _T: ... @overload @@ -1082,12 +1074,12 @@ def getattr(__o: object, __name: str, __default: _T) -> Any | _T: ... def globals() -> dict[str, Any]: ... def hasattr(__obj: object, __name: str) -> bool: ... def hash(__obj: object) -> int: ... -def help(*args: Any, **kwds: Any) -> None: ... +def help(request: object = ...) -> None: ... def hex(__number: int | SupportsIndex) -> str: ... def id(__obj: object) -> int: ... def input(__prompt: object = ...) -> str: ... @overload -def iter(__iterable: Iterable[_T]) -> Iterator[_T]: ... +def iter(__iterable: _SupportsIter[_SupportsNextT]) -> _SupportsNextT: ... @overload def iter(__function: Callable[[], _T | None], __sentinel: None) -> Iterator[_T]: ... @overload @@ -1155,32 +1147,32 @@ class map(Iterator[_S], Generic[_S]): @overload def max( - __arg1: SupportsGreaterThanT, __arg2: SupportsGreaterThanT, *_args: SupportsGreaterThanT, key: None = ... -) -> SupportsGreaterThanT: ... + __arg1: SupportsRichComparisonT, __arg2: SupportsRichComparisonT, *_args: SupportsRichComparisonT, key: None = ... +) -> SupportsRichComparisonT: ... @overload -def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], SupportsGreaterThan]) -> _T: ... +def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], SupportsRichComparison]) -> _T: ... @overload -def max(__iterable: Iterable[SupportsGreaterThanT], *, key: None = ...) -> SupportsGreaterThanT: ... +def max(__iterable: Iterable[SupportsRichComparisonT], *, key: None = ...) -> SupportsRichComparisonT: ... @overload -def max(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsGreaterThan]) -> _T: ... +def max(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsRichComparison]) -> _T: ... @overload -def max(__iterable: Iterable[SupportsGreaterThanT], *, key: None = ..., default: _T) -> SupportsGreaterThanT | _T: ... +def max(__iterable: Iterable[SupportsRichComparisonT], *, key: None = ..., default: _T) -> SupportsRichComparisonT | _T: ... @overload -def max(__iterable: Iterable[_T1], *, key: Callable[[_T1], SupportsGreaterThan], default: _T2) -> _T1 | _T2: ... +def max(__iterable: Iterable[_T1], *, key: Callable[[_T1], SupportsRichComparison], default: _T2) -> _T1 | _T2: ... @overload def min( - __arg1: SupportsLessThanT, __arg2: SupportsLessThanT, *_args: SupportsLessThanT, key: None = ... -) -> SupportsLessThanT: ... + __arg1: SupportsRichComparisonT, __arg2: SupportsRichComparisonT, *_args: SupportsRichComparisonT, key: None = ... +) -> SupportsRichComparisonT: ... @overload -def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], SupportsLessThan]) -> _T: ... +def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], SupportsRichComparison]) -> _T: ... @overload -def min(__iterable: Iterable[SupportsLessThanT], *, key: None = ...) -> SupportsLessThanT: ... +def min(__iterable: Iterable[SupportsRichComparisonT], *, key: None = ...) -> SupportsRichComparisonT: ... @overload -def min(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsLessThan]) -> _T: ... +def min(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsRichComparison]) -> _T: ... @overload -def min(__iterable: Iterable[SupportsLessThanT], *, key: None = ..., default: _T) -> SupportsLessThanT | _T: ... +def min(__iterable: Iterable[SupportsRichComparisonT], *, key: None = ..., default: _T) -> SupportsRichComparisonT | _T: ... @overload -def min(__iterable: Iterable[_T1], *, key: Callable[[_T1], SupportsLessThan], default: _T2) -> _T1 | _T2: ... +def min(__iterable: Iterable[_T1], *, key: Callable[[_T1], SupportsRichComparison], default: _T2) -> _T1 | _T2: ... @overload def next(__i: SupportsNext[_T]) -> _T: ... @overload @@ -1391,19 +1383,21 @@ def round(number: SupportsRound[_T], ndigits: SupportsIndex) -> _T: ... # for why arg 3 of `setattr` should be annotated with `Any` and not `object` def setattr(__obj: object, __name: str, __value: Any) -> None: ... @overload -def sorted(__iterable: Iterable[SupportsLessThanT], *, key: None = ..., reverse: bool = ...) -> list[SupportsLessThanT]: ... +def sorted( + __iterable: Iterable[SupportsRichComparisonT], *, key: None = ..., reverse: bool = ... +) -> list[SupportsRichComparisonT]: ... @overload -def sorted(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsLessThan], reverse: bool = ...) -> list[_T]: ... +def sorted(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> list[_T]: ... if sys.version_info >= (3, 8): @overload - def sum(__iterable: Iterable[_T]) -> _T | int: ... + def sum(__iterable: Iterable[_T]) -> _T | Literal[0]: ... @overload def sum(__iterable: Iterable[_T], start: _S) -> _T | _S: ... else: @overload - def sum(__iterable: Iterable[_T]) -> _T | int: ... + def sum(__iterable: Iterable[_T]) -> _T | Literal[0]: ... @overload def sum(__iterable: Iterable[_T], __start: _S) -> _T | _S: ... @@ -1511,6 +1505,8 @@ class BaseException(object): __context__: BaseException | None __suppress_context__: bool __traceback__: TracebackType | None + if sys.version_info >= (3, 11): + __note__: str | None def __init__(self, *args: object) -> None: ... def __str__(self) -> str: ... def __repr__(self) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/codecs.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/codecs.pyi index 01e5903a5..63de22d99 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/codecs.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/codecs.pyi @@ -5,6 +5,11 @@ from abc import abstractmethod from typing import IO, Any, BinaryIO, Callable, Generator, Iterable, Iterator, Protocol, TextIO, Tuple, Type, TypeVar, overload from typing_extensions import Literal +BOM32_BE: bytes +BOM32_LE: bytes +BOM64_BE: bytes +BOM64_LE: bytes + # TODO: this only satisfies the most common interface, where # bytes is the raw form and str is the cooked form. # In the long run, both should become template parameters maybe? diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/collections/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/collections/__init__.pyi index 17094bfb3..d4808d326 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/collections/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/collections/__init__.pyi @@ -1,6 +1,6 @@ import sys from _collections_abc import dict_items, dict_keys, dict_values -from _typeshed import Self, SupportsLessThan, SupportsLessThanT +from _typeshed import Self, SupportsKeysAndGetItem, SupportsRichComparison, SupportsRichComparisonT from typing import Any, Dict, Generic, NoReturn, Tuple, Type, TypeVar, overload from typing_extensions import SupportsIndex, final @@ -35,9 +35,19 @@ else: typename: str, field_names: str | Iterable[str], *, verbose: bool = ..., rename: bool = ..., module: str | None = ... ) -> Type[Tuple[Any, ...]]: ... -class UserDict(MutableMapping[_KT, _VT]): +class UserDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): data: dict[_KT, _VT] - def __init__(self, __dict: Mapping[_KT, _VT] | None = ..., **kwargs: _VT) -> None: ... + # __init__ should be kept roughly in line with `dict.__init__`, which has the same semantics + @overload + def __init__(self: UserDict[_KT, _VT], __dict: None = ...) -> None: ... + @overload + def __init__(self: UserDict[str, _VT], __dict: None = ..., **kwargs: _VT) -> None: ... + @overload + def __init__(self, __dict: SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def __init__(self, __iterable: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + @overload + def __init__(self: UserDict[str, str], __iterable: Iterable[list[str]]) -> None: ... def __len__(self) -> int: ... def __getitem__(self, key: _KT) -> _VT: ... def __setitem__(self, key: _KT, item: _VT) -> None: ... @@ -45,8 +55,15 @@ class UserDict(MutableMapping[_KT, _VT]): def __iter__(self) -> Iterator[_KT]: ... def __contains__(self, key: object) -> bool: ... def copy(self: Self) -> Self: ... + # `UserDict.fromkeys` has the same semantics as `dict.fromkeys`, so should be kept in line with `dict.fromkeys`. + # TODO: Much like `dict.fromkeys`, the true signature of `UserDict.fromkeys` is inexpressable in the current type system. + # See #3800 & https://github.com/python/typing/issues/548#issuecomment-683336963. @classmethod - def fromkeys(cls: Type[Self], iterable: Iterable[_KT], value: _VT | None = ...) -> Self: ... + @overload + def fromkeys(cls, iterable: Iterable[_T], value: None = ...) -> UserDict[_T, Any | None]: ... + @classmethod + @overload + def fromkeys(cls, iterable: Iterable[_T], value: _S) -> UserDict[_T, _S]: ... class UserList(MutableSequence[_T]): data: list[_T] @@ -74,17 +91,15 @@ class UserList(MutableSequence[_T]): def insert(self, i: int, item: _T) -> None: ... def pop(self, i: int = ...) -> _T: ... def remove(self, item: _T) -> None: ... - def clear(self) -> None: ... def copy(self: _S) -> _S: ... def count(self, item: _T) -> int: ... # All arguments are passed to `list.index` at runtime, so the signature should be kept in line with `list.index`. def index(self, item: _T, __start: SupportsIndex = ..., __stop: SupportsIndex = ...) -> int: ... - def reverse(self) -> None: ... # All arguments are passed to `list.sort` at runtime, so the signature should be kept in line with `list.sort`. @overload - def sort(self: UserList[SupportsLessThanT], *, key: None = ..., reverse: bool = ...) -> None: ... + def sort(self: UserList[SupportsRichComparisonT], *, key: None = ..., reverse: bool = ...) -> None: ... @overload - def sort(self, *, key: Callable[[_T], SupportsLessThan], reverse: bool = ...) -> None: ... + def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> None: ... def extend(self, other: Iterable[_T]) -> None: ... _UserStringT = TypeVar("_UserStringT", bound=UserString) @@ -173,7 +188,6 @@ class deque(MutableSequence[_T], Generic[_T]): def __init__(self, iterable: Iterable[_T] = ..., maxlen: int | None = ...) -> None: ... def append(self, __x: _T) -> None: ... def appendleft(self, __x: _T) -> None: ... - def clear(self) -> None: ... def copy(self: _S) -> _S: ... def count(self, __x: _T) -> int: ... def extend(self, __iterable: Iterable[_T]) -> None: ... @@ -183,29 +197,16 @@ class deque(MutableSequence[_T], Generic[_T]): def pop(self) -> _T: ... # type: ignore[override] def popleft(self) -> _T: ... def remove(self, __value: _T) -> None: ... - def reverse(self) -> None: ... def rotate(self, __n: int = ...) -> None: ... def __copy__(self: _S) -> _S: ... def __len__(self) -> int: ... - def __iter__(self) -> Iterator[_T]: ... def __str__(self) -> str: ... - # These methods of deque don't really take slices, but we need to - # define them as taking a slice to satisfy MutableSequence. - @overload - def __getitem__(self, __index: SupportsIndex) -> _T: ... - @overload - def __getitem__(self, __s: slice) -> MutableSequence[_T]: ... - @overload - def __setitem__(self, __i: SupportsIndex, __x: _T) -> None: ... - @overload - def __setitem__(self, __s: slice, __o: Iterable[_T]) -> None: ... - @overload - def __delitem__(self, __i: SupportsIndex) -> None: ... - @overload - def __delitem__(self, __s: slice) -> None: ... + # These methods of deque don't take slices, unlike MutableSequence, hence the type: ignores + def __getitem__(self, __index: SupportsIndex) -> _T: ... # type: ignore[override] + def __setitem__(self, __i: SupportsIndex, __x: _T) -> None: ... # type: ignore[override] + def __delitem__(self, __i: SupportsIndex) -> None: ... # type: ignore[override] def __contains__(self, __o: object) -> bool: ... def __reduce__(self: Self) -> tuple[Type[Self], tuple[()], None, Iterator[_T]]: ... - def __reversed__(self) -> Iterator[_T]: ... def __iadd__(self: _S, __iterable: Iterable[_T]) -> _S: ... def __add__(self: _S, __other: _S) -> _S: ... def __mul__(self: _S, __other: int) -> _S: ... @@ -217,7 +218,7 @@ class Counter(Dict[_T, int], Generic[_T]): @overload def __init__(self, __iterable: None = ..., **kwargs: int) -> None: ... @overload - def __init__(self, __mapping: Mapping[_T, int]) -> None: ... + def __init__(self, __mapping: SupportsKeysAndGetItem[_T, int]) -> None: ... @overload def __init__(self, __iterable: Iterable[_T]) -> None: ... def copy(self: Self) -> Self: ... @@ -237,7 +238,7 @@ class Counter(Dict[_T, int], Generic[_T]): # Dict.update. Not sure if we should use '# type: ignore' instead # and omit the type from the union. @overload - def update(self, __m: Mapping[_T, int], **kwargs: int) -> None: ... + def update(self, __m: SupportsKeysAndGetItem[_T, int], **kwargs: int) -> None: ... @overload def update(self, __m: Iterable[_T] | Iterable[tuple[_T, int]], **kwargs: int) -> None: ... @overload @@ -294,9 +295,11 @@ class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]): @overload def __init__(self, __default_factory: Callable[[], _VT] | None, **kwargs: _VT) -> None: ... @overload - def __init__(self, __default_factory: Callable[[], _VT] | None, __map: Mapping[_KT, _VT]) -> None: ... + def __init__(self, __default_factory: Callable[[], _VT] | None, __map: SupportsKeysAndGetItem[_KT, _VT]) -> None: ... @overload - def __init__(self, __default_factory: Callable[[], _VT] | None, __map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + def __init__( + self, __default_factory: Callable[[], _VT] | None, __map: SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT + ) -> None: ... @overload def __init__(self, __default_factory: Callable[[], _VT] | None, __iterable: Iterable[tuple[_KT, _VT]]) -> None: ... @overload diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/contextlib.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/contextlib.pyi index 876a3647f..fe72d6dd4 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/contextlib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/contextlib.pyi @@ -11,11 +11,12 @@ from typing import ( Generic, Iterator, Optional, + Protocol, Type, TypeVar, overload, ) -from typing_extensions import ParamSpec, Protocol +from typing_extensions import ParamSpec AbstractContextManager = ContextManager if sys.version_info >= (3, 7): @@ -32,14 +33,25 @@ _P = ParamSpec("_P") _ExitFunc = Callable[[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]], bool] _CM_EF = TypeVar("_CM_EF", AbstractContextManager[Any], _ExitFunc) -class _GeneratorContextManager(AbstractContextManager[_T_co]): +class ContextDecorator: def __call__(self, func: _F) -> _F: ... +class _GeneratorContextManager(AbstractContextManager[_T_co], ContextDecorator): ... + # type ignore to deal with incomplete ParamSpec support in mypy def contextmanager(func: Callable[_P, Iterator[_T]]) -> Callable[_P, _GeneratorContextManager[_T]]: ... # type: ignore[misc] +if sys.version_info >= (3, 10): + _AF = TypeVar("_AF", bound=Callable[..., Awaitable[Any]]) + class AsyncContextDecorator: + def __call__(self, func: _AF) -> _AF: ... + class _AsyncGeneratorContextManager(AbstractAsyncContextManager[_T_co], AsyncContextDecorator): ... + +elif sys.version_info >= (3, 7): + class _AsyncGeneratorContextManager(AbstractAsyncContextManager[_T_co]): ... + if sys.version_info >= (3, 7): - def asynccontextmanager(func: Callable[_P, AsyncIterator[_T]]) -> Callable[_P, AbstractAsyncContextManager[_T]]: ... # type: ignore[misc] + def asynccontextmanager(func: Callable[_P, AsyncIterator[_T]]) -> Callable[_P, _AsyncGeneratorContextManager[_T]]: ... # type: ignore[misc] class _SupportsClose(Protocol): def close(self) -> object: ... @@ -55,9 +67,6 @@ if sys.version_info >= (3, 10): _SupportsAcloseT = TypeVar("_SupportsAcloseT", bound=_SupportsAclose) class aclosing(AbstractAsyncContextManager[_SupportsAcloseT]): def __init__(self, thing: _SupportsAcloseT) -> None: ... - _AF = TypeVar("_AF", bound=Callable[..., Awaitable[Any]]) - class AsyncContextDecorator: - def __call__(self, func: _AF) -> _AF: ... class suppress(AbstractContextManager[None]): def __init__(self, *exceptions: Type[BaseException]) -> None: ... @@ -71,9 +80,6 @@ class redirect_stdout(AbstractContextManager[_T_io]): class redirect_stderr(AbstractContextManager[_T_io]): def __init__(self, new_target: _T_io) -> None: ... -class ContextDecorator: - def __call__(self, func: _F) -> _F: ... - class ExitStack(AbstractContextManager[ExitStack]): def __init__(self) -> None: ... def enter_context(self, cm: AbstractContextManager[_T]) -> _T: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/csv.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/csv.pyi index 60dc597f0..0b69cb227 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/csv.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/csv.pyi @@ -25,9 +25,6 @@ if sys.version_info >= (3, 8): else: from collections import OrderedDict as _DictReadMapping -# __version__ is deliberately not defined here or in _csv.pyi, -# as it appears to have been hardcoded at "1.0" for a very long time! - _T = TypeVar("_T") class excel(Dialect): diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/ctypes/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/ctypes/__init__.pyi index b76c59bec..5cf8ce289 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/ctypes/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/ctypes/__init__.pyi @@ -158,7 +158,7 @@ def create_unicode_buffer(init: int | str, size: int | None = ...) -> Array[c_wc if sys.platform == "win32": def DllCanUnloadNow() -> int: ... def DllGetClassObject(rclsid: Any, riid: Any, ppv: Any) -> int: ... # TODO not documented - def FormatError(code: int) -> str: ... + def FormatError(code: int = ...) -> str: ... def GetLastError() -> int: ... def get_errno() -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/dataclasses.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/dataclasses.pyi index 59efbe77a..6dfe83c2d 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/dataclasses.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/dataclasses.pyi @@ -1,7 +1,6 @@ import sys import types -from typing import Any, Callable, Generic, Iterable, Mapping, Tuple, Type, TypeVar, overload -from typing_extensions import Protocol +from typing import Any, Callable, Generic, Iterable, Mapping, Protocol, Tuple, Type, TypeVar, overload if sys.version_info >= (3, 9): from types import GenericAlias @@ -201,6 +200,7 @@ if sys.version_info >= (3, 10): unsafe_hash: bool = ..., frozen: bool = ..., match_args: bool = ..., + kw_only: bool = ..., slots: bool = ..., ) -> type: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/dbm/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/dbm/__init__.pyi index 9b9f92cca..5ecacd91b 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/dbm/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/dbm/__init__.pyi @@ -1,6 +1,6 @@ from _typeshed import Self from types import TracebackType -from typing import Iterator, MutableMapping, Tuple, Type, Union +from typing import Iterator, MutableMapping, Type, Union from typing_extensions import Literal _KeyType = Union[str, bytes] @@ -87,7 +87,7 @@ class _Database(MutableMapping[_KeyType, bytes]): class _error(Exception): ... -error = Tuple[Type[_error], Type[OSError]] +error: tuple[Type[_error], Type[OSError]] def whichdb(filename: str) -> str: ... def open(file: str, flag: _TFlags = ..., mode: int = ...) -> _Database: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/dis.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/dis.pyi index a6ea3e950..ac0632d25 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/dis.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/dis.pyi @@ -20,8 +20,8 @@ from typing import IO, Any, Callable, Iterator, NamedTuple, Union # Strictly this should not have to include Callable, but mypy doesn't use FunctionType # for functions (python/mypy#3171) -_have_code = Union[types.MethodType, types.FunctionType, types.CodeType, type, Callable[..., Any]] -_have_code_or_string = Union[_have_code, str, bytes] +_HaveCodeType = Union[types.MethodType, types.FunctionType, types.CodeType, type, Callable[..., Any]] +_HaveCodeOrStringType = Union[_HaveCodeType, str, bytes] class Instruction(NamedTuple): opname: str @@ -36,7 +36,7 @@ class Instruction(NamedTuple): class Bytecode: codeobj: types.CodeType first_line: int - def __init__(self, x: _have_code_or_string, *, first_line: int | None = ..., current_offset: int | None = ...) -> None: ... + def __init__(self, x: _HaveCodeOrStringType, *, first_line: int | None = ..., current_offset: int | None = ...) -> None: ... def __iter__(self) -> Iterator[Instruction]: ... def __repr__(self) -> str: ... def info(self) -> str: ... @@ -46,19 +46,19 @@ class Bytecode: COMPILER_FLAG_NAMES: dict[int, str] -def findlabels(code: _have_code) -> list[int]: ... -def findlinestarts(code: _have_code) -> Iterator[tuple[int, int]]: ... +def findlabels(code: _HaveCodeType) -> list[int]: ... +def findlinestarts(code: _HaveCodeType) -> Iterator[tuple[int, int]]: ... def pretty_flags(flags: int) -> str: ... -def code_info(x: _have_code_or_string) -> str: ... +def code_info(x: _HaveCodeOrStringType) -> str: ... if sys.version_info >= (3, 7): - def dis(x: _have_code_or_string | None = ..., *, file: IO[str] | None = ..., depth: int | None = ...) -> None: ... + def dis(x: _HaveCodeOrStringType | None = ..., *, file: IO[str] | None = ..., depth: int | None = ...) -> None: ... else: - def dis(x: _have_code_or_string | None = ..., *, file: IO[str] | None = ...) -> None: ... + def dis(x: _HaveCodeOrStringType | None = ..., *, file: IO[str] | None = ...) -> None: ... def distb(tb: types.TracebackType | None = ..., *, file: IO[str] | None = ...) -> None: ... -def disassemble(co: _have_code, lasti: int = ..., *, file: IO[str] | None = ...) -> None: ... -def disco(co: _have_code, lasti: int = ..., *, file: IO[str] | None = ...) -> None: ... -def show_code(co: _have_code, *, file: IO[str] | None = ...) -> None: ... -def get_instructions(x: _have_code, *, first_line: int | None = ...) -> Iterator[Instruction]: ... +def disassemble(co: _HaveCodeType, lasti: int = ..., *, file: IO[str] | None = ...) -> None: ... +def disco(co: _HaveCodeType, lasti: int = ..., *, file: IO[str] | None = ...) -> None: ... +def show_code(co: _HaveCodeType, *, file: IO[str] | None = ...) -> None: ... +def get_instructions(x: _HaveCodeType, *, first_line: int | None = ...) -> Iterator[Instruction]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/headerregistry.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/headerregistry.pyi index 69e7bf315..6a3d6ca5b 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/headerregistry.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/headerregistry.pyi @@ -1,5 +1,6 @@ import sys import types +from collections.abc import Iterable, Mapping from datetime import datetime as _datetime from email._header_value_parser import ( AddressList, @@ -12,28 +13,33 @@ from email._header_value_parser import ( ) from email.errors import MessageDefect from email.policy import Policy -from typing import Any, Iterable, Tuple, Type +from typing import Any, ClassVar, Tuple, Type +from typing_extensions import Literal class BaseHeader(str): + # max_count is actually more of an abstract ClassVar (not defined on the base class, but expected to be defined in subclasses) + max_count: ClassVar[Literal[1] | None] @property def name(self) -> str: ... @property def defects(self) -> Tuple[MessageDefect, ...]: ... - @property - def max_count(self) -> int | None: ... def __new__(cls, name: str, value: Any) -> BaseHeader: ... def init(self, name: str, *, parse_tree: TokenList, defects: Iterable[MessageDefect]) -> None: ... def fold(self, *, policy: Policy) -> str: ... class UnstructuredHeader: + max_count: ClassVar[Literal[1] | None] @staticmethod def value_parser(value: str) -> UnstructuredTokenList: ... @classmethod def parse(cls, value: str, kwds: dict[str, Any]) -> None: ... -class UniqueUnstructuredHeader(UnstructuredHeader): ... +class UniqueUnstructuredHeader(UnstructuredHeader): + max_count: ClassVar[Literal[1]] class DateHeader: + max_count: ClassVar[Literal[1] | None] + def init(self, name: str, *, parse_tree: TokenList, defects: Iterable[MessageDefect], datetime: _datetime) -> None: ... @property def datetime(self) -> _datetime: ... @staticmethod @@ -41,9 +47,12 @@ class DateHeader: @classmethod def parse(cls, value: str | _datetime, kwds: dict[str, Any]) -> None: ... -class UniqueDateHeader(DateHeader): ... +class UniqueDateHeader(DateHeader): + max_count: ClassVar[Literal[1]] class AddressHeader: + max_count: ClassVar[Literal[1] | None] + def init(self, name: str, *, parse_tree: TokenList, defects: Iterable[MessageDefect], groups: Iterable[Group]) -> None: ... @property def groups(self) -> Tuple[Group, ...]: ... @property @@ -53,15 +62,28 @@ class AddressHeader: @classmethod def parse(cls, value: str, kwds: dict[str, Any]) -> None: ... -class UniqueAddressHeader(AddressHeader): ... +class UniqueAddressHeader(AddressHeader): + max_count: ClassVar[Literal[1]] class SingleAddressHeader(AddressHeader): @property def address(self) -> Address: ... -class UniqueSingleAddressHeader(SingleAddressHeader): ... +class UniqueSingleAddressHeader(SingleAddressHeader): + max_count: ClassVar[Literal[1]] class MIMEVersionHeader: + max_count: ClassVar[Literal[1]] + def init( + self, + name: str, + *, + parse_tree: TokenList, + defects: Iterable[MessageDefect], + version: str | None, + major: int | None, + minor: int | None, + ) -> None: ... @property def version(self) -> str | None: ... @property @@ -74,6 +96,8 @@ class MIMEVersionHeader: def parse(cls, value: str, kwds: dict[str, Any]) -> None: ... class ParameterizedMIMEHeader: + max_count: ClassVar[Literal[1]] + def init(self, name: str, *, parse_tree: TokenList, defects: Iterable[MessageDefect], params: Mapping[str, Any]) -> None: ... @property def params(self) -> types.MappingProxyType[str, Any]: ... @classmethod @@ -90,12 +114,15 @@ class ContentTypeHeader(ParameterizedMIMEHeader): def value_parser(value: str) -> ContentType: ... class ContentDispositionHeader(ParameterizedMIMEHeader): + # init is redefined but has the same signature as parent class, so is omitted from the stub @property - def content_disposition(self) -> str: ... + def content_disposition(self) -> str | None: ... @staticmethod def value_parser(value: str) -> ContentDisposition: ... class ContentTransferEncodingHeader: + max_count: ClassVar[Literal[1]] + def init(self, name: str, *, parse_tree: TokenList, defects: Iterable[MessageDefect]) -> None: ... @property def cte(self) -> str: ... @classmethod @@ -106,6 +133,7 @@ class ContentTransferEncodingHeader: if sys.version_info >= (3, 8): from email._header_value_parser import MessageID class MessageIDHeader: + max_count: ClassVar[Literal[1]] @classmethod def parse(cls, value: str, kwds: dict[str, Any]) -> None: ... @staticmethod diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/policy.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/policy.pyi index 1c813cb96..15991c7e0 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/policy.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/policy.pyi @@ -1,17 +1,27 @@ -from abc import abstractmethod +from abc import ABCMeta, abstractmethod from email.contentmanager import ContentManager from email.errors import MessageDefect from email.header import Header from email.message import Message from typing import Any, Callable -class Policy: +class Policy(metaclass=ABCMeta): max_line_length: int | None linesep: str cte_type: str raise_on_defect: bool - mange_from: bool - def __init__(self, **kw: Any) -> None: ... + mangle_from_: bool + message_factory: Callable[[Policy], Message] | None + def __init__( + self, + *, + max_line_length: int | None = ..., + linesep: str = ..., + cte_type: str = ..., + raise_on_defect: bool = ..., + mangle_from_: bool = ..., + message_factory: Callable[[Policy], Message] | None = ..., + ) -> None: ... def clone(self, **kw: Any) -> Policy: ... def handle_defect(self, obj: Message, defect: MessageDefect) -> None: ... def register_defect(self, obj: Message, defect: MessageDefect) -> None: ... @@ -41,6 +51,20 @@ class EmailPolicy(Policy): refold_source: str header_factory: Callable[[str, str], str] content_manager: ContentManager + def __init__( + self, + *, + max_line_length: int | None = ..., + linesep: str = ..., + cte_type: str = ..., + raise_on_defect: bool = ..., + mangle_from_: bool = ..., + message_factory: Callable[[Policy], Message] | None = ..., + utf8: bool = ..., + refold_source: str = ..., + header_factory: Callable[[str, str], str] = ..., + content_manager: ContentManager = ..., + ) -> None: ... def header_source_parse(self, sourcelines: list[str]) -> tuple[str, str]: ... def header_store_parse(self, name: str, value: str) -> tuple[str, str]: ... def header_fetch_parse(self, name: str, value: str) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/enum.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/enum.pyi index e30ff42a9..befee76dc 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/enum.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/enum.pyi @@ -2,17 +2,49 @@ import sys import types from abc import ABCMeta from builtins import property as _builtins_property -from typing import Any, Iterator, Type, TypeVar +from collections.abc import Iterable, Iterator, Mapping +from typing import Any, Dict, Tuple, Type, TypeVar, Union, overload _T = TypeVar("_T") _S = TypeVar("_S", bound=Type[Enum]) +# The following all work: +# >>> from enum import Enum +# >>> from string import ascii_lowercase +# >>> Enum('Foo', names='RED YELLOW GREEN') +# +# >>> Enum('Foo', names=[('RED', 1), ('YELLOW, 2)]) +# +# >>> Enum('Foo', names=((x for x in (ascii_lowercase[i], i)) for i in range(5))) +# +# >>> Enum('Foo', names={'RED': 1, 'YELLOW': 2}) +# +_EnumNames = Union[str, Iterable[str], Iterable[Iterable[Union[str, Any]]], Mapping[str, Any]] + +class _EnumDict(Dict[str, Any]): + def __init__(self) -> None: ... + # Note: EnumMeta actually subclasses type directly, not ABCMeta. # This is a temporary workaround to allow multiple creation of enums with builtins # such as str as mixins, which due to the handling of ABCs of builtin types, cause # spurious inconsistent metaclass structure. See #1595. # Structurally: Iterable[T], Reversible[T], Container[T] where T is the enum itself class EnumMeta(ABCMeta): + if sys.version_info >= (3, 11): + def __new__( + metacls: Type[_T], + cls: str, + bases: Tuple[type, ...], + classdict: _EnumDict, + *, + boundary: FlagBoundary | None = ..., + _simple: bool = ..., + **kwds: Any, + ) -> _T: ... + elif sys.version_info >= (3, 9): + def __new__(metacls: Type[_T], cls: str, bases: Tuple[type, ...], classdict: _EnumDict, **kwds: Any) -> _T: ... # type: ignore + else: + def __new__(metacls: Type[_T], cls: str, bases: Tuple[type, ...], classdict: _EnumDict) -> _T: ... # type: ignore def __iter__(self: Type[_T]) -> Iterator[_T]: ... def __reversed__(self: Type[_T]) -> Iterator[_T]: ... def __contains__(self: Type[Any], member: object) -> bool: ... @@ -20,13 +52,56 @@ class EnumMeta(ABCMeta): @_builtins_property def __members__(self: Type[_T]) -> types.MappingProxyType[str, _T]: ... def __len__(self) -> int: ... + if sys.version_info >= (3, 11): + # Simple value lookup + @overload # type: ignore[override] + def __call__(cls: Type[_T], value: Any, names: None = ...) -> _T: ... + # Functional Enum API + @overload + def __call__( + cls, + value: str, + names: _EnumNames, + *, + module: str | None = ..., + qualname: str | None = ..., + type: type | None = ..., + start: int = ..., + boundary: FlagBoundary | None = ..., + ) -> Type[Enum]: ... + else: + @overload # type: ignore[override] + def __call__(cls: Type[_T], value: Any, names: None = ...) -> _T: ... + @overload + def __call__( + cls, + value: str, + names: _EnumNames, + *, + module: str | None = ..., + qualname: str | None = ..., + type: type | None = ..., + start: int = ..., + ) -> Type[Enum]: ... _member_names_: list[str] # undocumented _member_map_: dict[str, Enum] # undocumented _value2member_map_: dict[Any, Enum] # undocumented +if sys.version_info >= (3, 11): + # In 3.11 `EnumMeta` metaclass is renamed to `EnumType`, but old name also exists. + EnumType = EnumMeta + class Enum(metaclass=EnumMeta): - name: str - value: Any + if sys.version_info >= (3, 11): + @property + def name(self) -> str: ... + @property + def value(self) -> Any: ... + else: + @types.DynamicClassAttribute + def name(self) -> str: ... + @types.DynamicClassAttribute + def value(self) -> Any: ... _name_: str _value_: Any if sys.version_info >= (3, 7): @@ -46,7 +121,13 @@ class Enum(metaclass=EnumMeta): def __reduce_ex__(self, proto: object) -> Any: ... class IntEnum(int, Enum): - value: int + _value_: int + if sys.version_info >= (3, 11): + @property + def value(self) -> int: ... + else: + @types.DynamicClassAttribute + def value(self) -> int: ... def __new__(cls: Type[_T], value: int | _T) -> _T: ... def unique(enumeration: _S) -> _S: ... @@ -55,12 +136,28 @@ _auto_null: Any # subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto() class auto(IntFlag): - value: Any + _value_: Any + if sys.version_info >= (3, 11): + @property + def value(self) -> Any: ... + else: + @types.DynamicClassAttribute + def value(self) -> Any: ... def __new__(cls: Type[_T]) -> _T: ... class Flag(Enum): - name: str | None # type: ignore[assignment] - value: int + _name_: str | None # type: ignore[assignment] + _value_: int + if sys.version_info >= (3, 11): + @property + def name(self) -> str | None: ... # type: ignore[override] + @property + def value(self) -> int: ... + else: + @types.DynamicClassAttribute + def name(self) -> str | None: ... # type: ignore[override] + @types.DynamicClassAttribute + def value(self) -> int: ... def __contains__(self: _T, other: _T) -> bool: ... def __repr__(self) -> str: ... def __str__(self) -> str: ... @@ -81,7 +178,10 @@ class IntFlag(int, Flag): if sys.version_info >= (3, 11): class StrEnum(str, Enum): - def __new__(cls: Type[_T], value: int | _T) -> _T: ... + def __new__(cls: Type[_T], value: str | _T) -> _T: ... + _value_: str + @property + def value(self) -> str: ... class FlagBoundary(StrEnum): STRICT: str CONFORM: str diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/ftplib.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/ftplib.pyi index 3f4f892bb..745669ce0 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/ftplib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/ftplib.pyi @@ -33,10 +33,6 @@ class FTP: lastresp: str file: TextIO | None encoding: str - - # The following variable is intentionally left undocumented. - # See https://bugs.python.org/issue43285 for relevant discussion - # trust_server_pasv_ipv4_address: bool def __enter__(self: Self) -> Self: ... def __exit__( self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/functools.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/functools.pyi index b5e52bf59..78ed5992a 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/functools.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/functools.pyi @@ -1,6 +1,6 @@ import sys import types -from _typeshed import SupportsItems, SupportsLessThan +from _typeshed import SupportsAllComparisons, SupportsItems from typing import Any, Callable, Generic, Hashable, Iterable, NamedTuple, Sequence, Sized, Tuple, Type, TypeVar, overload from typing_extensions import final @@ -45,7 +45,7 @@ WRAPPER_UPDATES: Sequence[str] def update_wrapper(wrapper: _T, wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> _T: ... def wraps(wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> Callable[[_T], _T]: ... def total_ordering(cls: Type[_T]) -> Type[_T]: ... -def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], SupportsLessThan]: ... +def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], SupportsAllComparisons]: ... class partial(Generic[_T]): func: Callable[..., _T] diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/genericpath.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/genericpath.pyi index 56683e323..c9829ae35 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/genericpath.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/genericpath.pyi @@ -1,5 +1,5 @@ import os -from _typeshed import BytesPath, StrOrBytesPath, StrPath, SupportsLessThanT +from _typeshed import BytesPath, StrOrBytesPath, StrPath, SupportsRichComparisonT from typing import Sequence, Tuple, overload from typing_extensions import Literal @@ -11,9 +11,9 @@ def commonprefix(m: Sequence[StrPath]) -> str: ... @overload def commonprefix(m: Sequence[BytesPath]) -> bytes | Literal[""]: ... @overload -def commonprefix(m: Sequence[list[SupportsLessThanT]]) -> Sequence[SupportsLessThanT]: ... +def commonprefix(m: Sequence[list[SupportsRichComparisonT]]) -> Sequence[SupportsRichComparisonT]: ... @overload -def commonprefix(m: Sequence[Tuple[SupportsLessThanT, ...]]) -> Sequence[SupportsLessThanT]: ... +def commonprefix(m: Sequence[Tuple[SupportsRichComparisonT, ...]]) -> Sequence[SupportsRichComparisonT]: ... def exists(path: StrOrBytesPath | int) -> bool: ... def getsize(filename: StrOrBytesPath | int) -> int: ... def isfile(path: StrOrBytesPath | int) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/grp.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/grp.pyi index 08cbe6b86..33f2a9774 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/grp.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/grp.pyi @@ -1,10 +1,17 @@ -from typing import NamedTuple +from _typeshed import structseq +from typing import Any, List, Optional, Tuple +from typing_extensions import final -class struct_group(NamedTuple): - gr_name: str - gr_passwd: str | None - gr_gid: int - gr_mem: list[str] +@final +class struct_group(structseq[Any], Tuple[str, Optional[str], int, List[str]]): + @property + def gr_name(self) -> str: ... + @property + def gr_passwd(self) -> str | None: ... + @property + def gr_gid(self) -> int: ... + @property + def gr_mem(self) -> list[str]: ... def getgrall() -> list[struct_group]: ... def getgrgid(id: int) -> struct_group: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/heapq.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/heapq.pyi index 81ee02582..fd3c2db8a 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/heapq.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/heapq.pyi @@ -1,4 +1,4 @@ -from _typeshed import SupportsLessThan +from _typeshed import SupportsRichComparison from typing import Any, Callable, Iterable, TypeVar _T = TypeVar("_T") @@ -9,6 +9,6 @@ def heappushpop(__heap: list[_T], __item: _T) -> _T: ... def heapify(__heap: list[Any]) -> None: ... def heapreplace(__heap: list[_T], __item: _T) -> _T: ... def merge(*iterables: Iterable[_T], key: Callable[[_T], Any] | None = ..., reverse: bool = ...) -> Iterable[_T]: ... -def nlargest(n: int, iterable: Iterable[_T], key: Callable[[_T], SupportsLessThan] | None = ...) -> list[_T]: ... -def nsmallest(n: int, iterable: Iterable[_T], key: Callable[[_T], SupportsLessThan] | None = ...) -> list[_T]: ... +def nlargest(n: int, iterable: Iterable[_T], key: Callable[[_T], SupportsRichComparison] | None = ...) -> list[_T]: ... +def nsmallest(n: int, iterable: Iterable[_T], key: Callable[[_T], SupportsRichComparison] | None = ...) -> list[_T]: ... def _heapify_max(__x: list[Any]) -> None: ... # undocumented diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/abc.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/abc.pyi index 6c894cffd..9bb370dfd 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/abc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/abc.pyi @@ -12,8 +12,8 @@ from _typeshed import ( from abc import ABCMeta, abstractmethod from importlib.machinery import ModuleSpec from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper -from typing import IO, Any, BinaryIO, Iterator, Mapping, Protocol, Sequence, Union, overload -from typing_extensions import Literal, runtime_checkable +from typing import IO, Any, BinaryIO, Iterator, Mapping, NoReturn, Protocol, Sequence, Union, overload, runtime_checkable +from typing_extensions import Literal _Path = Union[bytes, str] @@ -173,3 +173,10 @@ if sys.version_info >= (3, 9): def read_bytes(self) -> bytes: ... @abstractmethod def read_text(self, encoding: str | None = ...) -> str: ... + class TraversableResources(ResourceReader): + @abstractmethod + def files(self) -> Traversable: ... + def open_resource(self, resource: StrPath) -> BufferedReader: ... # type: ignore[override] + def resource_path(self, resource: Any) -> NoReturn: ... + def is_resource(self, path: StrPath) -> bool: ... + def contents(self) -> Iterator[str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/machinery.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/machinery.pyi index aaa0f32d9..b73f9c527 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/machinery.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/machinery.pyi @@ -1,7 +1,10 @@ import importlib.abc import sys import types -from typing import Any, Callable, Sequence +from typing import Any, Callable, Iterable, Sequence + +if sys.version_info >= (3, 8): + from importlib.metadata import DistributionFinder, PathDistribution class ModuleSpec: def __init__( @@ -97,6 +100,12 @@ class PathFinder: else: @classmethod def invalidate_caches(cls) -> None: ... + if sys.version_info >= (3, 10): + @staticmethod + def find_distributions(context: DistributionFinder.Context = ...) -> Iterable[PathDistribution]: ... + elif sys.version_info >= (3, 8): + @classmethod + def find_distributions(cls, context: DistributionFinder.Context = ...) -> Iterable[PathDistribution]: ... @classmethod def find_spec( cls, fullname: str, path: Sequence[bytes | str] | None = ..., target: types.ModuleType | None = ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/metadata.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/metadata/__init__.pyi similarity index 86% rename from packages/pyright-internal/typeshed-fallback/stdlib/importlib/metadata.pyi rename to packages/pyright-internal/typeshed-fallback/stdlib/importlib/metadata/__init__.pyi index 506b4a00b..c5d9efba9 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/metadata.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/metadata/__init__.pyi @@ -7,9 +7,10 @@ from email.message import Message from importlib.abc import MetaPathFinder from os import PathLike from pathlib import Path -from typing import Any, Iterable, NamedTuple, Tuple, overload +from typing import Any, ClassVar, Iterable, NamedTuple, Pattern, Tuple, overload if sys.version_info >= (3, 10): + from importlib.metadata._meta import PackageMetadata as PackageMetadata def packages_distributions() -> Mapping[str, list[str]]: ... if sys.version_info >= (3, 8): @@ -19,9 +20,18 @@ if sys.version_info >= (3, 8): value: str group: str class EntryPoint(_EntryPointBase): + pattern: ClassVar[Pattern[str]] def load(self) -> Any: ... # Callable[[], Any] or an importable module @property def extras(self) -> list[str]: ... + if sys.version_info >= (3, 9): + @property + def module(self) -> str: ... + @property + def attr(self) -> str: ... + if sys.version_info >= (3, 10): + dist: ClassVar[Distribution | None] + def matches(self, **params: Any) -> bool: ... # undocumented class PackagePath(pathlib.PurePosixPath): def read_text(self, encoding: str = ...) -> str: ... def read_binary(self) -> bytes: ... @@ -61,6 +71,9 @@ if sys.version_info >= (3, 8): def files(self) -> list[PackagePath] | None: ... @property def requires(self) -> list[str] | None: ... + if sys.version_info >= (3, 10): + @property + def name(self) -> str: ... class DistributionFinder(MetaPathFinder): class Context: name: str | None diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/metadata/_meta.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/metadata/_meta.pyi new file mode 100644 index 000000000..a5e573339 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/metadata/_meta.pyi @@ -0,0 +1,18 @@ +from typing import Any, Iterator, Protocol, TypeVar + +_T = TypeVar("_T") + +class PackageMetadata(Protocol): + def __len__(self) -> int: ... + def __contains__(self, item: str) -> bool: ... + def __getitem__(self, key: str) -> str: ... + def __iter__(self) -> Iterator[str]: ... + def get_all(self, name: str, failobj: _T = ...) -> list[Any] | _T: ... + @property + def json(self) -> dict[str, str | list[str]]: ... + +class SimplePath(Protocol): + def joinpath(self) -> SimplePath: ... + def __div__(self) -> SimplePath: ... + def parent(self) -> SimplePath: ... + def read_text(self) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/resources.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/resources.pyi index 194c0bac2..b484d7126 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/resources.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/resources.pyi @@ -23,3 +23,6 @@ if sys.version_info >= (3, 9): from importlib.abc import Traversable def files(package: Package) -> Traversable: ... def as_file(path: Traversable) -> AbstractContextManager[Path]: ... + +if sys.version_info >= (3, 10): + from importlib.abc import ResourceReader as ResourceReader diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/util.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/util.pyi index d6c410c84..96db31468 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/util.pyi @@ -1,5 +1,6 @@ import importlib.abc import importlib.machinery +import sys import types from _typeshed import StrOrBytesPath from typing import Any, Callable @@ -36,3 +37,6 @@ class LazyLoader(importlib.abc.Loader): def factory(cls, loader: importlib.abc.Loader) -> Callable[..., LazyLoader]: ... def create_module(self, spec: importlib.machinery.ModuleSpec) -> types.ModuleType | None: ... def exec_module(self, module: types.ModuleType) -> None: ... + +if sys.version_info >= (3, 7): + def source_hash(source_bytes: bytes) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/inspect.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/inspect.pyi index 82a59d613..bd00d9ba6 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/inspect.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/inspect.pyi @@ -3,7 +3,7 @@ import sys import types from _typeshed import Self from collections import OrderedDict -from collections.abc import Awaitable, Callable, Generator, Mapping, Sequence +from collections.abc import Awaitable, Callable, Generator, Mapping, Sequence, Set as AbstractSet from types import ( AsyncGeneratorType, BuiltinFunctionType, @@ -205,7 +205,8 @@ class _ParameterKind(enum.IntEnum): VAR_KEYWORD: int if sys.version_info >= (3, 8): - description: str + @property + def description(self) -> str: ... class Parameter: def __init__(self, name: str, kind: _ParameterKind, *, default: Any = ..., annotation: Any = ...) -> None: ... @@ -317,7 +318,7 @@ class ClosureVars(NamedTuple): nonlocals: Mapping[str, Any] globals: Mapping[str, Any] builtins: Mapping[str, Any] - unbound: set[str] + unbound: AbstractSet[str] def getclosurevars(func: Callable[..., Any]) -> ClosureVars: ... def unwrap(func: Callable[..., Any], *, stop: Callable[[Any], Any] | None = ...) -> Any: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/logging/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/logging/__init__.pyi index 70d6a1fda..5be934b4f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/logging/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/logging/__init__.pyi @@ -1,6 +1,6 @@ import sys import threading -from _typeshed import StrPath, SupportsWrite +from _typeshed import Self, StrPath, SupportsWrite from collections.abc import Callable, Iterable, Mapping, MutableMapping, Sequence from io import TextIOWrapper from string import Template @@ -59,7 +59,7 @@ class Logger(Filterer): def setLevel(self, level: _Level) -> None: ... def isEnabledFor(self, level: int) -> bool: ... def getEffectiveLevel(self) -> int: ... - def getChild(self, suffix: str) -> Logger: ... + def getChild(self: Self, suffix: str) -> Self: ... # see python/typing#980 if sys.version_info >= (3, 8): def debug( self, @@ -244,14 +244,14 @@ class Logger(Filterer): def hasHandlers(self) -> bool: ... def callHandlers(self, record: LogRecord) -> None: ... # undocumented -CRITICAL: int -FATAL: int -ERROR: int -WARNING: int -WARN: int -INFO: int -DEBUG: int -NOTSET: int +CRITICAL: Literal[50] +FATAL: Literal[50] +ERROR: Literal[40] +WARNING: Literal[30] +WARN: Literal[30] +INFO: Literal[20] +DEBUG: Literal[10] +NOTSET: Literal[0] class Handler(Filterer): level: int # undocumented diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/logging/config.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/logging/config.pyi index cb9ad5995..8ee9e7b33 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/logging/config.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/logging/config.pyi @@ -43,7 +43,12 @@ class _OptionalDictConfigArgs(TypedDict, total=False): class _DictConfigArgs(_OptionalDictConfigArgs, TypedDict): version: Literal[1] -def dictConfig(config: _DictConfigArgs) -> None: ... +# Accept dict[str, Any] to avoid false positives if called with a dict +# type, since dict types are not compatible with TypedDicts. +# +# Also accept a TypedDict type, to allow callers to use TypedDict +# types, and for somewhat stricter type checking of dict literals. +def dictConfig(config: _DictConfigArgs | dict[str, Any]) -> None: ... if sys.version_info >= (3, 10): def fileConfig( diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/os/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/os/__init__.pyi index fc0af0d47..5d4b6b246 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/os/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/os/__init__.pyi @@ -9,6 +9,7 @@ from _typeshed import ( Self, StrOrBytesPath, StrPath, + structseq, ) from builtins import OSError from contextlib import AbstractContextManager @@ -26,7 +27,6 @@ from typing import ( List, Mapping, MutableMapping, - NamedTuple, NoReturn, Protocol, Sequence, @@ -284,55 +284,75 @@ TMP_MAX: int # Undocumented, but used by tempfile # ----- os classes (structures) ----- @final -class stat_result: - # For backward compatibility, the return value of stat() is also - # accessible as a tuple of at least 10 integers giving the most important - # (and portable) members of the stat structure, in the order st_mode, - # st_ino, st_dev, st_nlink, st_uid, st_gid, st_size, st_atime, st_mtime, - # st_ctime. More items may be added at the end by some implementations. - - st_mode: int # protection bits, - st_ino: int # inode number, - st_dev: int # device, - st_nlink: int # number of hard links, - st_uid: int # user id of owner, - st_gid: int # group id of owner, - st_size: int # size of file, in bytes, - st_atime: float # time of most recent access, - st_mtime: float # time of most recent content modification, - st_ctime: float # platform dependent (time of most recent metadata change on Unix, or the time of creation on Windows) - st_atime_ns: int # time of most recent access, in nanoseconds - st_mtime_ns: int # time of most recent content modification in nanoseconds - st_ctime_ns: int # platform dependent (time of most recent metadata change on Unix, or the time of creation on Windows) in nanoseconds - if sys.version_info >= (3, 8) and sys.platform == "win32": - st_reparse_tag: int +class stat_result(structseq[float], Tuple[int, int, int, int, int, int, int, float, float, float]): + # The constructor of this class takes an iterable of variable length (though it must be at least 10). + # + # However, this class behaves like a tuple of 10 elements, + # no matter how long the iterable supplied to the constructor is. + # https://github.com/python/typeshed/pull/6560#discussion_r767162532 + # + # The 10 elements always present are st_mode, st_ino, st_dev, st_nlink, + # st_uid, st_gid, st_size, st_atime, st_mtime, st_ctime. + # + # More items may be added at the end by some implementations. + @property + def st_mode(self) -> int: ... # protection bits, + @property + def st_ino(self) -> int: ... # inode number, + @property + def st_dev(self) -> int: ... # device, + @property + def st_nlink(self) -> int: ... # number of hard links, + @property + def st_uid(self) -> int: ... # user id of owner, + @property + def st_gid(self) -> int: ... # group id of owner, + @property + def st_size(self) -> int: ... # size of file, in bytes, + @property + def st_atime(self) -> float: ... # time of most recent access, + @property + def st_mtime(self) -> float: ... # time of most recent content modification, + # platform dependent (time of most recent metadata change on Unix, or the time of creation on Windows) + @property + def st_ctime(self) -> float: ... + @property + def st_atime_ns(self) -> int: ... # time of most recent access, in nanoseconds + @property + def st_mtime_ns(self) -> int: ... # time of most recent content modification in nanoseconds + # platform dependent (time of most recent metadata change on Unix, or the time of creation on Windows) in nanoseconds + @property + def st_ctime_ns(self) -> int: ... if sys.platform == "win32": - st_file_attributes: int - def __getitem__(self, i: int) -> int: ... - # not documented - def __init__(self, tuple: Tuple[int, ...]) -> None: ... - # On some Unix systems (such as Linux), the following attributes may also - # be available: - st_blocks: int # number of blocks allocated for file - st_blksize: int # filesystem blocksize - st_rdev: int # type of device if an inode device - st_flags: int # user defined flags for file - - # On other Unix systems (such as FreeBSD), the following attributes may be - # available (but may be only filled out if root tries to use them): - st_gen: int # file generation number - st_birthtime: int # time of file creation - - # On Mac OS systems, the following attributes may also be available: - st_rsize: int - st_creator: int - st_type: int + @property + def st_file_attributes(self) -> int: ... + if sys.version_info >= (3, 8): + @property + def st_reparse_tag(self) -> int: ... + else: + @property + def st_blocks(self) -> int: ... # number of blocks allocated for file + @property + def st_blksize(self) -> int: ... # filesystem blocksize + @property + def st_rdev(self) -> int: ... # type of device if an inode device + if sys.platform != "linux": + # These properties are available on MacOS, but not on Windows or Ubuntu. + # On other Unix systems (such as FreeBSD), the following attributes may be + # available (but may be only filled out if root tries to use them): + @property + def st_gen(self) -> int: ... # file generation number + @property + def st_birthtime(self) -> int: ... # time of file creation + if sys.platform == "darwin": + @property + def st_flags(self) -> int: ... # user defined flags for file + # Atributes documented as sometimes appearing, but deliberately omitted from the stub: `st_creator`, `st_rsize`, `st_type`. + # See https://github.com/python/typeshed/pull/6560#issuecomment-991253327 @runtime_checkable class PathLike(Protocol[_AnyStr_co]): def __fspath__(self) -> _AnyStr_co: ... - if sys.version_info >= (3, 9): - def __class_getitem__(cls, item: Any) -> GenericAlias: ... @overload def listdir(path: str | None = ...) -> list[str]: ... @@ -361,45 +381,55 @@ class DirEntry(Generic[AnyStr]): if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any) -> GenericAlias: ... -if sys.platform != "win32": - _Tuple10Int = Tuple[int, int, int, int, int, int, int, int, int, int] - _Tuple11Int = Tuple[int, int, int, int, int, int, int, int, int, int, int] - if sys.version_info >= (3, 7): - # f_fsid was added in https://github.com/python/cpython/pull/4571 - @final - class statvfs_result(_Tuple10Int): # Unix only - def __new__(cls, seq: _Tuple10Int | _Tuple11Int, dict: dict[str, int] = ...) -> statvfs_result: ... - n_fields: int - n_sequence_fields: int - n_unnamed_fields: int +if sys.version_info >= (3, 7): + @final + class statvfs_result(structseq[int], Tuple[int, int, int, int, int, int, int, int, int, int, int]): + @property + def f_bsize(self) -> int: ... + @property + def f_frsize(self) -> int: ... + @property + def f_blocks(self) -> int: ... + @property + def f_bfree(self) -> int: ... + @property + def f_bavail(self) -> int: ... + @property + def f_files(self) -> int: ... + @property + def f_ffree(self) -> int: ... + @property + def f_favail(self) -> int: ... + @property + def f_flag(self) -> int: ... + @property + def f_namemax(self) -> int: ... + @property + def f_fsid(self) -> int: ... - f_bsize: int - f_frsize: int - f_blocks: int - f_bfree: int - f_bavail: int - f_files: int - f_ffree: int - f_favail: int - f_flag: int - f_namemax: int - f_fsid: int - else: - class statvfs_result(_Tuple10Int): # Unix only - n_fields: int - n_sequence_fields: int - n_unnamed_fields: int - - f_bsize: int - f_frsize: int - f_blocks: int - f_bfree: int - f_bavail: int - f_files: int - f_ffree: int - f_favail: int - f_flag: int - f_namemax: int +else: + @final + class statvfs_result(structseq[int], Tuple[int, int, int, int, int, int, int, int, int, int]): + @property + def f_bsize(self) -> int: ... + @property + def f_frsize(self) -> int: ... + @property + def f_blocks(self) -> int: ... + @property + def f_bfree(self) -> int: ... + @property + def f_bavail(self) -> int: ... + @property + def f_files(self) -> int: ... + @property + def f_ffree(self) -> int: ... + @property + def f_favail(self) -> int: ... + @property + def f_flag(self) -> int: ... + @property + def f_namemax(self) -> int: ... # ----- os function stubs ----- def fsencode(filename: StrOrBytesPath) -> bytes: ... @@ -416,6 +446,18 @@ def getpid() -> int: ... def getppid() -> int: ... def strerror(__code: int) -> str: ... def umask(__mask: int) -> int: ... +@final +class uname_result(structseq[str], Tuple[str, str, str, str, str]): + @property + def sysname(self) -> str: ... + @property + def nodename(self) -> str: ... + @property + def release(self) -> str: ... + @property + def version(self) -> str: ... + @property + def machine(self) -> str: ... if sys.platform != "win32": def ctermid() -> str: ... @@ -447,13 +489,6 @@ if sys.platform != "win32": def getsid(__pid: int) -> int: ... def setsid() -> None: ... def setuid(__uid: int) -> None: ... - @final - class uname_result(NamedTuple): - sysname: str - nodename: str - release: str - version: str - machine: str def uname() -> uname_result: ... @overload @@ -469,7 +504,7 @@ if sys.platform != "win32": def putenv(__name: bytes | str, __value: bytes | str) -> None: ... -if sys.platform != "win32": +if sys.platform != "win32" or sys.version_info >= (3, 9): def unsetenv(__name: bytes | str) -> None: ... _Opener = Callable[[str, int], int] @@ -563,7 +598,9 @@ else: def dup2(fd: int, fd2: int, inheritable: bool = ...) -> None: ... def fstat(fd: int) -> stat_result: ... +def ftruncate(__fd: int, __length: int) -> None: ... def fsync(fd: FileDescriptorLike) -> None: ... +def isatty(__fd: int) -> bool: ... def lseek(__fd: int, __position: int, __how: int) -> int: ... def open(path: StrOrBytesPath, flags: int, mode: int = ..., *, dir_fd: int | None = ...) -> int: ... def pipe() -> tuple[int, int]: ... @@ -573,18 +610,15 @@ if sys.platform != "win32": # Unix only def fchmod(fd: int, mode: int) -> None: ... def fchown(fd: int, uid: int, gid: int) -> None: ... - if sys.platform != "darwin": - def fdatasync(fd: FileDescriptorLike) -> None: ... # Unix only, not Mac def fpathconf(__fd: int, __name: str | int) -> int: ... def fstatvfs(__fd: int) -> statvfs_result: ... - def ftruncate(__fd: int, __length: int) -> None: ... def get_blocking(__fd: int) -> bool: ... def set_blocking(__fd: int, __blocking: bool) -> None: ... - def isatty(__fd: int) -> bool: ... def lockf(__fd: int, __command: int, __length: int) -> None: ... def openpty() -> tuple[int, int]: ... # some flavors of Unix if sys.platform != "darwin": - def pipe2(flags: int) -> tuple[int, int]: ... # some flavors of Unix + def fdatasync(fd: FileDescriptorLike) -> None: ... + def pipe2(__flags: int) -> tuple[int, int]: ... # some flavors of Unix def posix_fallocate(fd: int, offset: int, length: int) -> None: ... def posix_fadvise(fd: int, offset: int, length: int, advice: int) -> None: ... def pread(__fd: int, __length: int, __offset: int) -> bytes: ... @@ -605,9 +639,11 @@ if sys.platform != "win32": def writev(__fd: int, __buffers: Sequence[bytes]) -> int: ... @final -class terminal_size(Tuple[int, int]): - columns: int - lines: int +class terminal_size(structseq[int], Tuple[int, int]): + @property + def columns(self) -> int: ... + @property + def lines(self) -> int: ... def get_terminal_size(fd: int = ...) -> terminal_size: ... def get_inheritable(__fd: int) -> bool: ... @@ -632,17 +668,14 @@ def getcwd() -> str: ... def getcwdb() -> bytes: ... def chmod(path: _FdOrAnyPath, mode: int, *, dir_fd: int | None = ..., follow_symlinks: bool = ...) -> None: ... -if sys.platform != "win32": +if sys.platform != "win32" and sys.platform != "linux": def chflags(path: StrOrBytesPath, flags: int, follow_symlinks: bool = ...) -> None: ... # some flavors of Unix - def chown( - path: _FdOrAnyPath, uid: int, gid: int, *, dir_fd: int | None = ..., follow_symlinks: bool = ... - ) -> None: ... # Unix only - -if sys.platform != "win32": - # Unix only - def chroot(path: StrOrBytesPath) -> None: ... def lchflags(path: StrOrBytesPath, flags: int) -> None: ... def lchmod(path: StrOrBytesPath, mode: int) -> None: ... + +if sys.platform != "win32": + def chroot(path: StrOrBytesPath) -> None: ... + def chown(path: _FdOrAnyPath, uid: int, gid: int, *, dir_fd: int | None = ..., follow_symlinks: bool = ...) -> None: ... def lchown(path: StrOrBytesPath, uid: int, gid: int) -> None: ... def link( @@ -825,12 +858,17 @@ else: def system(command: StrOrBytesPath) -> int: ... @final -class times_result(NamedTuple): - user: float - system: float - children_user: float - children_system: float - elapsed: float +class times_result(structseq[float], Tuple[float, float, float, float, float]): + @property + def user(self) -> float: ... + @property + def system(self) -> float: ... + @property + def children_user(self) -> float: ... + @property + def children_system(self) -> float: ... + @property + def elapsed(self) -> float: ... def times() -> times_result: ... def waitpid(__pid: int, __options: int) -> tuple[int, int]: ... @@ -845,12 +883,18 @@ else: def spawnvpe(mode: int, file: StrOrBytesPath, args: _ExecVArgs, env: _ExecEnv) -> int: ... def wait() -> tuple[int, int]: ... # Unix only if sys.platform != "darwin": - class waitid_result(NamedTuple): - si_pid: int - si_uid: int - si_signo: int - si_status: int - si_code: int + @final + class waitid_result(structseq[int], Tuple[int, int, int, int, int]): + @property + def si_pid(self) -> int: ... + @property + def si_uid(self) -> int: ... + @property + def si_signo(self) -> int: ... + @property + def si_status(self) -> int: ... + @property + def si_code(self) -> int: ... def waitid(idtype: int, ident: int, options: int) -> waitid_result: ... def wait3(options: int) -> tuple[int, int, Any]: ... def wait4(pid: int, options: int) -> tuple[int, int, Any]: ... @@ -891,8 +935,11 @@ else: ) -> int: ... if sys.platform != "win32": - class sched_param(NamedTuple): - sched_priority: int + @final + class sched_param(structseq[int], Tuple[int]): + def __new__(cls, sched_priority: int) -> sched_param: ... + @property + def sched_priority(self) -> int: ... def sched_get_priority_min(policy: int) -> int: ... # some flavors of Unix def sched_get_priority_max(policy: int) -> int: ... # some flavors of Unix def sched_yield() -> None: ... # some flavors of Unix diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/posix.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/posix.pyi index 08b55d10a..cdca4235d 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/posix.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/posix.pyi @@ -87,10 +87,137 @@ if sys.platform != "win32": WTERMSIG as WTERMSIG, WUNTRACED as WUNTRACED, X_OK as X_OK, + DirEntry as DirEntry, + _exit as _exit, + abort as abort, + access as access, + chdir as chdir, + chmod as chmod, + chown as chown, + chroot as chroot, + close as close, + closerange as closerange, + confstr as confstr, + confstr_names as confstr_names, + cpu_count as cpu_count, + ctermid as ctermid, + device_encoding as device_encoding, + dup as dup, + dup2 as dup2, + error as error, + execv as execv, + execve as execve, + fchdir as fchdir, + fchmod as fchmod, + fchown as fchown, + fork as fork, + forkpty as forkpty, + fpathconf as fpathconf, + fspath as fspath, + fstat as fstat, + fstatvfs as fstatvfs, + fsync as fsync, + ftruncate as ftruncate, + get_blocking as get_blocking, + get_inheritable as get_inheritable, + get_terminal_size as get_terminal_size, + getcwd as getcwd, + getcwdb as getcwdb, + getegid as getegid, + geteuid as geteuid, + getgid as getgid, + getgrouplist as getgrouplist, + getgroups as getgroups, + getloadavg as getloadavg, + getlogin as getlogin, + getpgid as getpgid, + getpgrp as getpgrp, + getpid as getpid, + getppid as getppid, + getpriority as getpriority, + getsid as getsid, + getuid as getuid, + initgroups as initgroups, + isatty as isatty, + kill as kill, + killpg as killpg, + lchown as lchown, + link as link, listdir as listdir, + lockf as lockf, + lseek as lseek, + lstat as lstat, + major as major, + makedev as makedev, + minor as minor, + mkdir as mkdir, + mkfifo as mkfifo, + mknod as mknod, + nice as nice, + open as open, + openpty as openpty, + pathconf as pathconf, + pathconf_names as pathconf_names, + pipe as pipe, + pread as pread, + putenv as putenv, + pwrite as pwrite, + read as read, + readlink as readlink, + readv as readv, + remove as remove, + rename as rename, + replace as replace, + rmdir as rmdir, + scandir as scandir, + sched_get_priority_max as sched_get_priority_max, + sched_get_priority_min as sched_get_priority_min, + sched_param as sched_param, + sched_yield as sched_yield, + sendfile as sendfile, + set_blocking as set_blocking, + set_inheritable as set_inheritable, + setegid as setegid, + seteuid as seteuid, + setgid as setgid, + setgroups as setgroups, + setpgid as setpgid, + setpgrp as setpgrp, + setpriority as setpriority, + setregid as setregid, + setreuid as setreuid, + setsid as setsid, + setuid as setuid, + stat as stat, stat_result as stat_result, + statvfs as statvfs, + statvfs_result as statvfs_result, + strerror as strerror, + symlink as symlink, + sync as sync, + sysconf as sysconf, + sysconf_names as sysconf_names, + system as system, + tcgetpgrp as tcgetpgrp, + tcsetpgrp as tcsetpgrp, + terminal_size as terminal_size, + times as times, times_result as times_result, + truncate as truncate, + ttyname as ttyname, + umask as umask, + uname as uname, uname_result as uname_result, + unlink as unlink, + unsetenv as unsetenv, + urandom as urandom, + utime as utime, + wait as wait, + wait3 as wait3, + wait4 as wait4, + waitpid as waitpid, + write as write, + writev as writev, ) if sys.platform == "linux": @@ -101,7 +228,15 @@ if sys.platform != "win32": XATTR_CREATE as XATTR_CREATE, XATTR_REPLACE as XATTR_REPLACE, XATTR_SIZE_MAX as XATTR_SIZE_MAX, + getrandom as getrandom, + getxattr as getxattr, + listxattr as listxattr, + removexattr as removexattr, + setxattr as setxattr, ) + else: + from os import chflags as chflags, lchflags as lchflags, lchmod as lchmod + if sys.platform != "darwin": from os import ( POSIX_FADV_DONTNEED as POSIX_FADV_DONTNEED, @@ -110,11 +245,54 @@ if sys.platform != "win32": POSIX_FADV_RANDOM as POSIX_FADV_RANDOM, POSIX_FADV_SEQUENTIAL as POSIX_FADV_SEQUENTIAL, POSIX_FADV_WILLNEED as POSIX_FADV_WILLNEED, + fdatasync as fdatasync, + getresgid as getresgid, + getresuid as getresuid, + pipe2 as pipe2, + posix_fadvise as posix_fadvise, + posix_fallocate as posix_fallocate, + sched_getaffinity as sched_getaffinity, + sched_getparam as sched_getparam, + sched_getscheduler as sched_getscheduler, + sched_rr_get_interval as sched_rr_get_interval, + sched_setaffinity as sched_setaffinity, + sched_setparam as sched_setparam, + sched_setscheduler as sched_setscheduler, + setresgid as setresgid, + setresuid as setresuid, + waitid as waitid, + waitid_result as waitid_result, ) + if sys.version_info >= (3, 9): + from os import waitstatus_to_exitcode as waitstatus_to_exitcode if sys.version_info >= (3, 8): from os import posix_spawn as posix_spawn, posix_spawnp as posix_spawnp + if sys.platform == "linux": + from os import ( + MFD_ALLOW_SEALING as MFD_ALLOW_SEALING, + MFD_CLOEXEC as MFD_CLOEXEC, + MFD_HUGE_1GB as MFD_HUGE_1GB, + MFD_HUGE_1MB as MFD_HUGE_1MB, + MFD_HUGE_2GB as MFD_HUGE_2GB, + MFD_HUGE_2MB as MFD_HUGE_2MB, + MFD_HUGE_8MB as MFD_HUGE_8MB, + MFD_HUGE_16GB as MFD_HUGE_16GB, + MFD_HUGE_16MB as MFD_HUGE_16MB, + MFD_HUGE_32MB as MFD_HUGE_32MB, + MFD_HUGE_64KB as MFD_HUGE_64KB, + MFD_HUGE_256MB as MFD_HUGE_256MB, + MFD_HUGE_512KB as MFD_HUGE_512KB, + MFD_HUGE_512MB as MFD_HUGE_512MB, + MFD_HUGE_MASK as MFD_HUGE_MASK, + MFD_HUGE_SHIFT as MFD_HUGE_SHIFT, + MFD_HUGETLB as MFD_HUGETLB, + memfd_create as memfd_create, + ) + if sys.version_info >= (3, 7): + from os import register_at_fork as register_at_fork + # Not same as os.environ or os.environb # Because of this variable, we can't do "from posix import *" in os/__init__.pyi environ: dict[bytes, bytes] diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/pwd.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/pwd.pyi index 2b931248e..a16175879 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/pwd.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/pwd.pyi @@ -1,17 +1,23 @@ -from typing import ClassVar, Tuple +from _typeshed import structseq +from typing import Any, Tuple +from typing_extensions import final -class struct_passwd(Tuple[str, str, int, int, str, str, str]): - pw_name: str - pw_passwd: str - pw_uid: int - pw_gid: int - pw_gecos: str - pw_dir: str - pw_shell: str - - n_fields: ClassVar[int] - n_sequence_fields: ClassVar[int] - n_unnamed_fields: ClassVar[int] +@final +class struct_passwd(structseq[Any], Tuple[str, str, int, int, str, str, str]): + @property + def pw_name(self) -> str: ... + @property + def pw_passwd(self) -> str: ... + @property + def pw_uid(self) -> int: ... + @property + def pw_gid(self) -> int: ... + @property + def pw_gecos(self) -> str: ... + @property + def pw_dir(self) -> str: ... + @property + def pw_shell(self) -> str: ... def getpwall() -> list[struct_passwd]: ... def getpwuid(__uid: int) -> struct_passwd: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/pydoc.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/pydoc.pyi index 97e71f389..b60ef8f9b 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/pydoc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/pydoc.pyi @@ -109,7 +109,7 @@ class HTMLDoc(Doc): *ignored: Any, ) -> str: ... def formatvalue(self, object: object) -> str: ... - def docroutine( + def docroutine( # type: ignore[override] self, object: object, name: str | None = ..., @@ -118,15 +118,10 @@ class HTMLDoc(Doc): classes: Mapping[str, str] = ..., methods: Mapping[str, str] = ..., cl: type | None = ..., - *ignored: Any, - ) -> str: ... - def docproperty( - self, object: object, name: str | None = ..., mod: str | None = ..., cl: Any | None = ..., *ignored: Any ) -> str: ... + def docproperty(self, object: object, name: str | None = ..., mod: str | None = ..., cl: Any | None = ...) -> str: ... # type: ignore[override] def docother(self, object: object, name: str | None = ..., mod: Any | None = ..., *ignored: Any) -> str: ... - def docdata( - self, object: object, name: str | None = ..., mod: Any | None = ..., cl: Any | None = ..., *ignored: Any - ) -> str: ... + def docdata(self, object: object, name: str | None = ..., mod: Any | None = ..., cl: Any | None = ...) -> str: ... # type: ignore[override] def index(self, dir: str, shadowed: MutableMapping[str, bool] | None = ...) -> str: ... def filelink(self, url: str, path: str) -> str: ... @@ -150,19 +145,13 @@ class TextDoc(Doc): def formattree( self, tree: list[tuple[type, Tuple[type, ...]] | list[Any]], modname: str, parent: type | None = ..., prefix: str = ... ) -> str: ... - def docmodule(self, object: object, name: str | None = ..., mod: Any | None = ..., *ignored: Any) -> str: ... + def docmodule(self, object: object, name: str | None = ..., mod: Any | None = ...) -> str: ... # type: ignore[override] def docclass(self, object: object, name: str | None = ..., mod: str | None = ..., *ignored: Any) -> str: ... def formatvalue(self, object: object) -> str: ... - def docroutine( - self, object: object, name: str | None = ..., mod: str | None = ..., cl: Any | None = ..., *ignored: Any - ) -> str: ... - def docproperty( - self, object: object, name: str | None = ..., mod: Any | None = ..., cl: Any | None = ..., *ignored: Any - ) -> str: ... - def docdata( - self, object: object, name: str | None = ..., mod: str | None = ..., cl: Any | None = ..., *ignored: Any - ) -> str: ... - def docother( + def docroutine(self, object: object, name: str | None = ..., mod: str | None = ..., cl: Any | None = ...) -> str: ... # type: ignore[override] + def docproperty(self, object: object, name: str | None = ..., mod: Any | None = ..., cl: Any | None = ...) -> str: ... # type: ignore[override] + def docdata(self, object: object, name: str | None = ..., mod: str | None = ..., cl: Any | None = ...) -> str: ... # type: ignore[override] + def docother( # type: ignore[override] self, object: object, name: str | None = ..., @@ -170,7 +159,6 @@ class TextDoc(Doc): parent: str | None = ..., maxlen: int | None = ..., doc: Any | None = ..., - *ignored: Any, ) -> str: ... def pager(text: str) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/random.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/random.pyi index 699c56351..4834dab65 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/random.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/random.pyi @@ -1,12 +1,14 @@ import _random import sys -from collections.abc import Callable, Iterable, MutableSequence, Sequence +from _typeshed import SupportsLenAndGetItem +from collections.abc import Callable, Iterable, MutableSequence, Sequence, Set as AbstractSet from fractions import Fraction -from typing import Any, NoReturn, Tuple, TypeVar +from typing import Any, ClassVar, NoReturn, Tuple, TypeVar _T = TypeVar("_T") class Random(_random.Random): + VERSION: ClassVar[int] def __init__(self, x: Any = ...) -> None: ... def seed(self, a: Any = ..., version: int = ...) -> None: ... def getstate(self) -> Tuple[Any, ...]: ... @@ -16,10 +18,10 @@ class Random(_random.Random): def randint(self, a: int, b: int) -> int: ... if sys.version_info >= (3, 9): def randbytes(self, n: int) -> bytes: ... - def choice(self, seq: Sequence[_T]) -> _T: ... + def choice(self, seq: SupportsLenAndGetItem[_T]) -> _T: ... def choices( self, - population: Sequence[_T], + population: SupportsLenAndGetItem[_T], weights: Sequence[float | Fraction] | None = ..., *, cum_weights: Sequence[float | Fraction] | None = ..., @@ -27,9 +29,11 @@ class Random(_random.Random): ) -> list[_T]: ... def shuffle(self, x: MutableSequence[Any], random: Callable[[], float] | None = ...) -> None: ... if sys.version_info >= (3, 9): - def sample(self, population: Sequence[_T] | set[_T], k: int, *, counts: Iterable[_T] | None = ...) -> list[_T]: ... + def sample( + self, population: Sequence[_T] | AbstractSet[_T], k: int, *, counts: Iterable[_T] | None = ... + ) -> list[_T]: ... else: - def sample(self, population: Sequence[_T] | set[_T], k: int) -> list[_T]: ... + def sample(self, population: Sequence[_T] | AbstractSet[_T], k: int) -> list[_T]: ... def random(self) -> float: ... def uniform(self, a: float, b: float) -> float: ... def triangular(self, low: float = ..., high: float = ..., mode: float | None = ...) -> float: ... @@ -45,6 +49,7 @@ class Random(_random.Random): # SystemRandom is not implemented for all OS's; good on Windows & Linux class SystemRandom(Random): + def getrandbits(self, k: int) -> int: ... # k can be passed by keyword def getstate(self, *args: Any, **kwds: Any) -> NoReturn: ... def setstate(self, *args: Any, **kwds: Any) -> NoReturn: ... @@ -59,17 +64,21 @@ def randint(a: int, b: int) -> int: ... if sys.version_info >= (3, 9): def randbytes(n: int) -> bytes: ... -def choice(seq: Sequence[_T]) -> _T: ... +def choice(seq: SupportsLenAndGetItem[_T]) -> _T: ... def choices( - population: Sequence[_T], weights: Sequence[float] | None = ..., *, cum_weights: Sequence[float] | None = ..., k: int = ... + population: SupportsLenAndGetItem[_T], + weights: Sequence[float] | None = ..., + *, + cum_weights: Sequence[float] | None = ..., + k: int = ..., ) -> list[_T]: ... def shuffle(x: MutableSequence[Any], random: Callable[[], float] | None = ...) -> None: ... if sys.version_info >= (3, 9): - def sample(population: Sequence[_T] | set[_T], k: int, *, counts: Iterable[_T] | None = ...) -> list[_T]: ... + def sample(population: Sequence[_T] | AbstractSet[_T], k: int, *, counts: Iterable[_T] | None = ...) -> list[_T]: ... else: - def sample(population: Sequence[_T] | set[_T], k: int) -> list[_T]: ... + def sample(population: Sequence[_T] | AbstractSet[_T], k: int) -> list[_T]: ... def random() -> float: ... def uniform(a: float, b: float) -> float: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/resource.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/resource.pyi index d7124edcc..ff6f1d79e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/resource.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/resource.pyi @@ -1,5 +1,7 @@ import sys -from typing import Any, Tuple, overload +from _typeshed import structseq +from typing import Tuple, overload +from typing_extensions import final RLIMIT_AS: int RLIMIT_CORE: int @@ -23,26 +25,40 @@ if sys.platform == "linux": RLIMIT_SIGPENDING: int RUSAGE_THREAD: int -_Tuple16 = Tuple[float, float, int, int, int, int, int, int, int, int, int, int, int, int, int, int] - -class struct_rusage(_Tuple16): - def __new__(cls, sequence: _Tuple16, dict: dict[str, Any] = ...) -> struct_rusage: ... - ru_utime: float - ru_stime: float - ru_maxrss: int - ru_ixrss: int - ru_idrss: int - ru_isrss: int - ru_minflt: int - ru_majflt: int - ru_nswap: int - ru_inblock: int - ru_oublock: int - ru_msgsnd: int - ru_msgrcv: int - ru_nsignals: int - ru_nvcsw: int - ru_nivcsw: int +@final +class struct_rusage(structseq[float], Tuple[float, float, int, int, int, int, int, int, int, int, int, int, int, int, int, int]): + @property + def ru_utime(self) -> float: ... + @property + def ru_stime(self) -> float: ... + @property + def ru_maxrss(self) -> int: ... + @property + def ru_ixrss(self) -> int: ... + @property + def ru_idrss(self) -> int: ... + @property + def ru_isrss(self) -> int: ... + @property + def ru_minflt(self) -> int: ... + @property + def ru_majflt(self) -> int: ... + @property + def ru_nswap(self) -> int: ... + @property + def ru_inblock(self) -> int: ... + @property + def ru_oublock(self) -> int: ... + @property + def ru_msgsnd(self) -> int: ... + @property + def ru_msgrcv(self) -> int: ... + @property + def ru_nsignals(self) -> int: ... + @property + def ru_nvcsw(self) -> int: ... + @property + def ru_nivcsw(self) -> int: ... def getpagesize() -> int: ... def getrlimit(__resource: int) -> tuple[int, int]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/secrets.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/secrets.pyi index 6752a30f4..f57eef849 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/secrets.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/secrets.pyi @@ -1,12 +1,13 @@ +from _typeshed import SupportsLenAndGetItem from hmac import compare_digest as compare_digest from random import SystemRandom as SystemRandom -from typing import Sequence, TypeVar +from typing import TypeVar _T = TypeVar("_T") def randbelow(exclusive_upper_bound: int) -> int: ... def randbits(k: int) -> int: ... -def choice(seq: Sequence[_T]) -> _T: ... +def choice(seq: SupportsLenAndGetItem[_T]) -> _T: ... def token_bytes(nbytes: int | None = ...) -> bytes: ... def token_hex(nbytes: int | None = ...) -> str: ... def token_urlsafe(nbytes: int | None = ...) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/signal.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/signal.pyi index d617e24f2..6c93662fb 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/signal.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/signal.pyi @@ -1,56 +1,40 @@ import sys +from _typeshed import structseq from enum import IntEnum from types import FrameType from typing import Any, Callable, Iterable, Optional, Tuple, Union - -if sys.platform != "win32": - class ItimerError(IOError): ... - ITIMER_PROF: int - ITIMER_REAL: int - ITIMER_VIRTUAL: int +from typing_extensions import final NSIG: int class Signals(IntEnum): SIGABRT: int - if sys.platform != "win32": - SIGALRM: int - if sys.platform == "win32": - SIGBREAK: int - if sys.platform != "win32": - SIGBUS: int - SIGCHLD: int - if sys.platform != "darwin" and sys.platform != "win32": - SIGCLD: int - if sys.platform != "win32": - SIGCONT: int SIGEMT: int SIGFPE: int - if sys.platform != "win32": - SIGHUP: int SIGILL: int SIGINFO: int SIGINT: int - if sys.platform != "win32": + SIGSEGV: int + SIGTERM: int + + if sys.platform == "win32": + SIGBREAK: int + CTRL_C_EVENT: int + CTRL_BREAK_EVENT: int + else: + SIGALRM: int + SIGBUS: int + SIGCHLD: int + SIGCONT: int + SIGHUP: int SIGIO: int SIGIOT: int SIGKILL: int SIGPIPE: int - if sys.platform != "darwin" and sys.platform != "win32": - SIGPOLL: int - SIGPWR: int - if sys.platform != "win32": SIGPROF: int SIGQUIT: int - if sys.platform != "darwin" and sys.platform != "win32": - SIGRTMAX: int - SIGRTMIN: int - SIGSEGV: int - if sys.platform != "win32": SIGSTOP: int SIGSYS: int - SIGTERM: int - if sys.platform != "win32": SIGTRAP: int SIGTSTP: int SIGTTIN: int @@ -62,65 +46,54 @@ class Signals(IntEnum): SIGWINCH: int SIGXCPU: int SIGXFSZ: int + if sys.platform != "darwin": + SIGCLD: int + SIGPOLL: int + SIGPWR: int + SIGRTMAX: int + SIGRTMIN: int class Handlers(IntEnum): SIG_DFL: int SIG_IGN: int -SIG_DFL = Handlers.SIG_DFL -SIG_IGN = Handlers.SIG_IGN - -if sys.platform != "win32": - class Sigmasks(IntEnum): - SIG_BLOCK: int - SIG_UNBLOCK: int - SIG_SETMASK: int - SIG_BLOCK = Sigmasks.SIG_BLOCK - SIG_UNBLOCK = Sigmasks.SIG_UNBLOCK - SIG_SETMASK = Sigmasks.SIG_SETMASK +SIG_DFL: Handlers +SIG_IGN: Handlers _SIGNUM = Union[int, Signals] _HANDLER = Union[Callable[[int, Optional[FrameType]], Any], int, Handlers, None] +def default_int_handler(signum: int, frame: FrameType | None) -> None: ... +def getsignal(__signalnum: _SIGNUM) -> _HANDLER: ... +def signal(__signalnum: _SIGNUM, __handler: _HANDLER) -> _HANDLER: ... + SIGABRT: Signals -if sys.platform != "win32": - SIGALRM: Signals -if sys.platform == "win32": - SIGBREAK: Signals -if sys.platform != "win32": - SIGBUS: Signals - SIGCHLD: Signals -if sys.platform != "darwin" and sys.platform != "win32": - SIGCLD: Signals -if sys.platform != "win32": - SIGCONT: Signals SIGEMT: Signals SIGFPE: Signals -if sys.platform != "win32": - SIGHUP: Signals SIGILL: Signals SIGINFO: Signals SIGINT: Signals -if sys.platform != "win32": +SIGSEGV: Signals +SIGTERM: Signals + +if sys.platform == "win32": + SIGBREAK: Signals + CTRL_C_EVENT: Signals + CTRL_BREAK_EVENT: Signals +else: + SIGALRM: Signals + SIGBUS: Signals + SIGCHLD: Signals + SIGCONT: Signals + SIGHUP: Signals SIGIO: Signals SIGIOT: Signals SIGKILL: Signals SIGPIPE: Signals -if sys.platform != "darwin" and sys.platform != "win32": - SIGPOLL: Signals - SIGPWR: Signals -if sys.platform != "win32": SIGPROF: Signals SIGQUIT: Signals -if sys.platform != "darwin" and sys.platform != "win32": - SIGRTMAX: Signals - SIGRTMIN: Signals -SIGSEGV: Signals -if sys.platform != "win32": SIGSTOP: Signals SIGSYS: Signals -SIGTERM: Signals -if sys.platform != "win32": SIGTRAP: Signals SIGTSTP: Signals SIGTTIN: Signals @@ -132,64 +105,58 @@ if sys.platform != "win32": SIGWINCH: Signals SIGXCPU: Signals SIGXFSZ: Signals - -if sys.platform == "win32": - CTRL_C_EVENT: int - CTRL_BREAK_EVENT: int - -if sys.platform != "win32" and sys.platform != "darwin": - class struct_siginfo(Tuple[int, int, int, int, int, int, int]): - def __init__(self, sequence: Iterable[int]) -> None: ... - @property - def si_signo(self) -> int: ... - @property - def si_code(self) -> int: ... - @property - def si_errno(self) -> int: ... - @property - def si_pid(self) -> int: ... - @property - def si_uid(self) -> int: ... - @property - def si_status(self) -> int: ... - @property - def si_band(self) -> int: ... - -if sys.platform != "win32": + class ItimerError(IOError): ... + ITIMER_PROF: int + ITIMER_REAL: int + ITIMER_VIRTUAL: int + class Sigmasks(IntEnum): + SIG_BLOCK: int + SIG_UNBLOCK: int + SIG_SETMASK: int + SIG_BLOCK = Sigmasks.SIG_BLOCK + SIG_UNBLOCK = Sigmasks.SIG_UNBLOCK + SIG_SETMASK = Sigmasks.SIG_SETMASK def alarm(__seconds: int) -> int: ... - -def default_int_handler(signum: int, frame: FrameType) -> None: ... - -if sys.platform != "win32": def getitimer(__which: int) -> tuple[float, float]: ... - -def getsignal(__signalnum: _SIGNUM) -> _HANDLER: ... + def pause() -> None: ... + def pthread_kill(__thread_id: int, __signalnum: int) -> None: ... + def pthread_sigmask(__how: int, __mask: Iterable[int]) -> set[_SIGNUM]: ... + def setitimer(__which: int, __seconds: float, __interval: float = ...) -> tuple[float, float]: ... + def siginterrupt(__signalnum: int, __flag: bool) -> None: ... + def sigpending() -> Any: ... + def sigwait(__sigset: Iterable[int]) -> _SIGNUM: ... + if sys.platform != "darwin": + SIGCLD: Signals + SIGPOLL: Signals + SIGPWR: Signals + SIGRTMAX: Signals + SIGRTMIN: Signals + @final + class struct_siginfo(structseq[int], Tuple[int, int, int, int, int, int, int]): + @property + def si_signo(self) -> int: ... + @property + def si_code(self) -> int: ... + @property + def si_errno(self) -> int: ... + @property + def si_pid(self) -> int: ... + @property + def si_uid(self) -> int: ... + @property + def si_status(self) -> int: ... + @property + def si_band(self) -> int: ... + def sigtimedwait(sigset: Iterable[int], timeout: float) -> struct_siginfo | None: ... + def sigwaitinfo(sigset: Iterable[int]) -> struct_siginfo: ... if sys.version_info >= (3, 8): def strsignal(__signalnum: _SIGNUM) -> str | None: ... def valid_signals() -> set[Signals]: ... def raise_signal(__signalnum: _SIGNUM) -> None: ... -if sys.platform != "win32": - def pause() -> None: ... - def pthread_kill(__thread_id: int, __signalnum: int) -> None: ... - def pthread_sigmask(__how: int, __mask: Iterable[int]) -> set[_SIGNUM]: ... - if sys.version_info >= (3, 7): def set_wakeup_fd(fd: int, *, warn_on_full_buffer: bool = ...) -> int: ... else: def set_wakeup_fd(fd: int) -> int: ... - -if sys.platform != "win32": - def setitimer(__which: int, __seconds: float, __interval: float = ...) -> tuple[float, float]: ... - def siginterrupt(__signalnum: int, __flag: bool) -> None: ... - -def signal(__signalnum: _SIGNUM, __handler: _HANDLER) -> _HANDLER: ... - -if sys.platform != "win32": - def sigpending() -> Any: ... - def sigwait(__sigset: Iterable[int]) -> _SIGNUM: ... - if sys.platform != "darwin": - def sigtimedwait(sigset: Iterable[int], timeout: float) -> struct_siginfo | None: ... - def sigwaitinfo(sigset: Iterable[int]) -> struct_siginfo: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/spwd.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/spwd.pyi index 0f8d36fee..fc3d8ce90 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/spwd.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/spwd.pyi @@ -1,15 +1,27 @@ -from typing import NamedTuple +from _typeshed import structseq +from typing import Any, Tuple +from typing_extensions import final -class struct_spwd(NamedTuple): - sp_namp: str - sp_pwdp: str - sp_lstchg: int - sp_min: int - sp_max: int - sp_warn: int - sp_inact: int - sp_expire: int - sp_flag: int +@final +class struct_spwd(structseq[Any], Tuple[str, str, int, int, int, int, int, int, int]): + @property + def sp_namp(self) -> str: ... + @property + def sp_pwdp(self) -> str: ... + @property + def sp_lstchg(self) -> int: ... + @property + def sp_min(self) -> int: ... + @property + def sp_max(self) -> int: ... + @property + def sp_warn(self) -> int: ... + @property + def sp_inact(self) -> int: ... + @property + def sp_expire(self) -> int: ... + @property + def sp_flag(self) -> int: ... def getspall() -> list[struct_spwd]: ... def getspnam(__arg: str) -> struct_spwd: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/sre_parse.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/sre_parse.pyi index 2d00bedc2..8a60c2f99 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/sre_parse.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/sre_parse.pyi @@ -24,7 +24,7 @@ class _State: def __init__(self) -> None: ... @property def groups(self) -> int: ... - def opengroup(self, name: str = ...) -> int: ... + def opengroup(self, name: str | None = ...) -> int: ... def closegroup(self, gid: int, p: SubPattern) -> None: ... def checkgroup(self, gid: int) -> bool: ... def checklookbehindgroup(self, gid: int, source: Tokenizer) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/statistics.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/statistics.pyi index ec3574ab1..908d6adaf 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/statistics.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/statistics.pyi @@ -1,5 +1,5 @@ import sys -from _typeshed import SupportsLessThanT +from _typeshed import SupportsRichComparisonT from decimal import Decimal from fractions import Fraction from typing import Any, Hashable, Iterable, NamedTuple, Sequence, SupportsFloat, Type, TypeVar, Union @@ -27,8 +27,8 @@ else: def harmonic_mean(data: Iterable[_NumberT]) -> _NumberT: ... def median(data: Iterable[_NumberT]) -> _NumberT: ... -def median_low(data: Iterable[SupportsLessThanT]) -> SupportsLessThanT: ... -def median_high(data: Iterable[SupportsLessThanT]) -> SupportsLessThanT: ... +def median_low(data: Iterable[SupportsRichComparisonT]) -> SupportsRichComparisonT: ... +def median_high(data: Iterable[SupportsRichComparisonT]) -> SupportsRichComparisonT: ... def median_grouped(data: Iterable[_NumberT], interval: _NumberT = ...) -> _NumberT: ... def mode(data: Iterable[_HashableT]) -> _HashableT: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/threading.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/threading.pyi index 2c448ff3a..d6ac9f725 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/threading.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/threading.pyi @@ -11,8 +11,9 @@ _T = TypeVar("_T") __all__: list[str] def active_count() -> int: ... +def activeCount() -> int: ... # deprecated alias for active_count() def current_thread() -> Thread: ... -def currentThread() -> Thread: ... +def currentThread() -> Thread: ... # deprecated alias for current_thread() def get_ident() -> int: ... def enumerate() -> list[Thread]: ... def main_thread() -> Thread: ... @@ -55,14 +56,15 @@ class Thread: def start(self) -> None: ... def run(self) -> None: ... def join(self, timeout: float | None = ...) -> None: ... - def getName(self) -> str: ... - def setName(self, name: str) -> None: ... if sys.version_info >= (3, 8): @property def native_id(self) -> int | None: ... # only available on some platforms def is_alive(self) -> bool: ... if sys.version_info < (3, 9): def isAlive(self) -> bool: ... + # the following methods are all deprecated + def getName(self) -> str: ... + def setName(self, name: str) -> None: ... def isDaemon(self) -> bool: ... def setDaemon(self, daemonic: bool) -> None: ... @@ -102,7 +104,7 @@ class Condition: def wait_for(self, predicate: Callable[[], _T], timeout: float | None = ...) -> _T: ... def notify(self, n: int = ...) -> None: ... def notify_all(self) -> None: ... - def notifyAll(self) -> None: ... + def notifyAll(self) -> None: ... # deprecated alias for notify_all() class Semaphore: def __init__(self, value: int = ...) -> None: ... @@ -121,6 +123,7 @@ class BoundedSemaphore(Semaphore): ... class Event: def __init__(self) -> None: ... def is_set(self) -> bool: ... + def isSet(self) -> bool: ... # deprecated alias for is_set() def set(self) -> None: ... def clear(self) -> None: ... def wait(self, timeout: float | None = ...) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/time.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/time.pyi index bf370d68e..fc929b112 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/time.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/time.pyi @@ -1,6 +1,7 @@ import sys +from _typeshed import structseq from types import SimpleNamespace -from typing import Any, NamedTuple, Tuple +from typing import Any, Tuple, Union from typing_extensions import final _TimeTuple = Tuple[int, int, int, int, int, int, int, int, int] @@ -32,39 +33,31 @@ if sys.version_info >= (3, 8) and sys.platform == "darwin": if sys.version_info >= (3, 9) and sys.platform == "linux": CLOCK_TAI: int -class _struct_time(NamedTuple): - tm_year: int - tm_mon: int - tm_mday: int - tm_hour: int - tm_min: int - tm_sec: int - tm_wday: int - tm_yday: int - tm_isdst: int - @property - def n_fields(self) -> int: ... - @property - def n_sequence_fields(self) -> int: ... - @property - def n_unnamed_fields(self) -> int: ... - +# Constructor takes an iterable of any type, of length between 9 and 11 elements. +# However, it always *behaves* like a tuple of 9 elements, +# even if an iterable with length >9 is passed. +# https://github.com/python/typeshed/pull/6560#discussion_r767162532 @final -class struct_time(_struct_time): - def __init__( - self, - o: tuple[int, int, int, int, int, int, int, int, int] - | tuple[int, int, int, int, int, int, int, int, int, str] - | tuple[int, int, int, int, int, int, int, int, int, str, int], - _arg: Any = ..., - ) -> None: ... - def __new__( - cls, - o: tuple[int, int, int, int, int, int, int, int, int] - | tuple[int, int, int, int, int, int, int, int, int, str] - | tuple[int, int, int, int, int, int, int, int, int, str, int], - _arg: Any = ..., - ) -> struct_time: ... +class struct_time(structseq[Union[Any, int]], _TimeTuple): + @property + def tm_year(self) -> int: ... + @property + def tm_mon(self) -> int: ... + @property + def tm_mday(self) -> int: ... + @property + def tm_hour(self) -> int: ... + @property + def tm_min(self) -> int: ... + @property + def tm_sec(self) -> int: ... + @property + def tm_wday(self) -> int: ... + @property + def tm_yday(self) -> int: ... + @property + def tm_isdst(self) -> int: ... + # These final two properties only exist if a 10- or 11-item sequence was passed to the constructor. @property def tm_zone(self) -> str: ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/__init__.pyi index 07fa31b80..fd21aaa1c 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/__init__.pyi @@ -111,6 +111,7 @@ _TakeFocusValue = Union[int, Literal[""], Callable[[str], Optional[bool]]] # -t class EventType(str, Enum): Activate: str ButtonPress: str + Button = ButtonPress ButtonRelease: str Circulate: str CirculateRequest: str @@ -128,6 +129,7 @@ class EventType(str, Enum): GraphicsExpose: str Gravity: str KeyPress: str + Key = KeyPress KeyRelease: str Keymap: str Leave: str @@ -740,14 +742,6 @@ class Pack: pack = pack_configure forget = pack_forget propagate = Misc.pack_propagate - # commented out to avoid mypy getting confused with multiple - # inheritance and how things get overridden with different things - # info = pack_info - # pack_propagate = Misc.pack_propagate - # configure = pack_configure - # config = pack_configure - # slaves = Misc.pack_slaves - # pack_slaves = Misc.pack_slaves class _PlaceInfo(_InMiscNonTotal): # empty dict if widget hasn't been placed anchor: _Anchor @@ -784,13 +778,6 @@ class Place: def place_info(self) -> _PlaceInfo: ... place = place_configure info = place_info - # commented out to avoid mypy getting confused with multiple - # inheritance and how things get overridden with different things - # config = place_configure - # configure = place_configure - # forget = place_forget - # slaves = Misc.place_slaves - # place_slaves = Misc.place_slaves class _GridInfo(_InMiscNonTotal): # empty dict if widget hasn't been gridded column: int @@ -826,24 +813,6 @@ class Grid: grid = grid_configure location = Misc.grid_location size = Misc.grid_size - # commented out to avoid mypy getting confused with multiple - # inheritance and how things get overridden with different things - # bbox = Misc.grid_bbox - # grid_bbox = Misc.grid_bbox - # forget = grid_forget - # info = grid_info - # grid_location = Misc.grid_location - # grid_propagate = Misc.grid_propagate - # grid_size = Misc.grid_size - # rowconfigure = Misc.grid_rowconfigure - # grid_rowconfigure = Misc.grid_rowconfigure - # grid_columnconfigure = Misc.grid_columnconfigure - # columnconfigure = Misc.grid_columnconfigure - # config = grid_configure - # configure = grid_configure - # propagate = Misc.grid_propagate - # slaves = Misc.grid_slaves - # grid_slaves = Misc.grid_slaves class BaseWidget(Misc): master: Misc diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/traceback.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/traceback.pyi index f04b44fab..f09a3cc70 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/traceback.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/traceback.pyi @@ -1,21 +1,36 @@ import sys from _typeshed import SupportsWrite from types import FrameType, TracebackType -from typing import IO, Any, Generator, Iterable, Iterator, List, Mapping, Optional, Tuple, Type +from typing import IO, Any, Generator, Iterable, Iterator, List, Mapping, Optional, Tuple, Type, overload _PT = Tuple[str, int, str, Optional[str]] def print_tb(tb: TracebackType | None, limit: int | None = ..., file: IO[str] | None = ...) -> None: ... if sys.version_info >= (3, 10): + @overload def print_exception( - __exc: Type[BaseException] | BaseException | None, + __exc: Type[BaseException] | None, value: BaseException | None = ..., tb: TracebackType | None = ..., limit: int | None = ..., file: IO[str] | None = ..., chain: bool = ..., ) -> None: ... + @overload + def print_exception( + __exc: BaseException, *, limit: int | None = ..., file: IO[str] | None = ..., chain: bool = ... + ) -> None: ... + @overload + def format_exception( + __exc: Type[BaseException] | None, + value: BaseException | None = ..., + tb: TracebackType | None = ..., + limit: int | None = ..., + chain: bool = ..., + ) -> list[str]: ... + @overload + def format_exception(__exc: BaseException, *, limit: int | None = ..., chain: bool = ...) -> list[str]: ... else: def print_exception( @@ -26,6 +41,13 @@ else: file: IO[str] | None = ..., chain: bool = ..., ) -> None: ... + def format_exception( + etype: Type[BaseException] | None, + value: BaseException | None, + tb: TracebackType | None, + limit: int | None = ..., + chain: bool = ..., + ) -> list[str]: ... def print_exc(limit: int | None = ..., file: IO[str] | None = ..., chain: bool = ...) -> None: ... def print_last(limit: int | None = ..., file: IO[str] | None = ..., chain: bool = ...) -> None: ... @@ -43,24 +65,6 @@ if sys.version_info >= (3, 10): else: def format_exception_only(etype: Type[BaseException] | None, value: BaseException | None) -> list[str]: ... -if sys.version_info >= (3, 10): - def format_exception( - __exc: Type[BaseException] | None, - value: BaseException | None = ..., - tb: TracebackType | None = ..., - limit: int | None = ..., - chain: bool = ..., - ) -> list[str]: ... - -else: - def format_exception( - etype: Type[BaseException] | None, - value: BaseException | None, - tb: TracebackType | None, - limit: int | None = ..., - chain: bool = ..., - ) -> list[str]: ... - def format_exc(limit: int | None = ..., chain: bool = ...) -> str: ... def format_tb(tb: TracebackType | None, limit: int | None = ...) -> list[str]: ... def format_stack(f: FrameType | None = ..., limit: int | None = ...) -> list[str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/turtle.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/turtle.pyi index dd3dd9ecb..8542fc8bf 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/turtle.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/turtle.pyi @@ -1,5 +1,5 @@ -from tkinter import Canvas, PhotoImage -from typing import Any, Callable, Dict, Sequence, Tuple, TypeVar, Union, overload +from tkinter import Canvas, Frame, PhotoImage +from typing import Any, Callable, ClassVar, Dict, Sequence, Tuple, TypeVar, Union, overload # Note: '_Color' is the alias we use for arguments and _AnyColor is the # alias we use for return types. Really, these two aliases should be the @@ -18,6 +18,8 @@ _PolygonCoords = Sequence[Tuple[float, float]] # Vec2D is actually a custom subclass of 'tuple'. Vec2D = Tuple[float, float] +class ScrolledCanvas(Frame): ... + class TurtleScreenBase(object): cv: Canvas canvwidth: int @@ -206,6 +208,8 @@ class TPen(object): _T = TypeVar("_T") class RawTurtle(TPen, TNavigator): + screen: TurtleScreen + screens: ClassVar[list[TurtleScreen]] def __init__( self, canvas: Canvas | TurtleScreen | None = ..., shape: str = ..., undobuffersize: int = ..., visible: bool = ... ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/types.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/types.pyi index a96623c5c..b018d56ac 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/types.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/types.pyi @@ -1,4 +1,5 @@ import sys +from _typeshed import SupportsKeysAndGetItem from importlib.abc import _LoaderProtocol from importlib.machinery import ModuleSpec from typing import ( @@ -173,7 +174,7 @@ class CodeType: @final class MappingProxyType(Mapping[_KT, _VT_co], Generic[_KT, _VT_co]): __hash__: None # type: ignore[assignment] - def __init__(self, mapping: Mapping[_KT, _VT_co]) -> None: ... + def __init__(self, mapping: SupportsKeysAndGetItem[_KT, _VT_co]) -> None: ... def __getitem__(self, k: _KT) -> _VT_co: ... def __iter__(self) -> Iterator[_KT]: ... def __len__(self) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/typing.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/typing.pyi index a56ea8c8c..8c2d3157b 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/typing.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/typing.pyi @@ -10,9 +10,6 @@ if sys.version_info >= (3, 7): if sys.version_info >= (3, 9): from types import GenericAlias -# Definitions of special type checking related constructs. Their definitions -# are not used, so their value does not matter. - Any = object() class TypeVar: @@ -29,11 +26,18 @@ class TypeVar: covariant: bool = ..., contravariant: bool = ..., ) -> None: ... + if sys.version_info >= (3, 10): + def __or__(self, other: Any) -> _SpecialForm: ... + def __ror__(self, other: Any) -> _SpecialForm: ... +# Used for an undocumented mypy feature. Does not exist at runtime. _promote = object() class _SpecialForm: def __getitem__(self, typeargs: Any) -> object: ... + if sys.version_info >= (3, 10): + def __or__(self, other: Any) -> _SpecialForm: ... + def __ror__(self, other: Any) -> _SpecialForm: ... _F = TypeVar("_F", bound=Callable[..., Any]) _P = _ParamSpec("_P") @@ -80,6 +84,8 @@ if sys.version_info >= (3, 10): def args(self) -> ParamSpecArgs: ... @property def kwargs(self) -> ParamSpecKwargs: ... + def __or__(self, other: Any) -> _SpecialForm: ... + def __ror__(self, other: Any) -> _SpecialForm: ... Concatenate: _SpecialForm = ... TypeAlias: _SpecialForm = ... TypeGuard: _SpecialForm = ... @@ -263,7 +269,7 @@ class Coroutine(Awaitable[_V_co], Generic[_T_co, _T_contra, _V_co]): @abstractmethod def close(self) -> None: ... -# NOTE: This type does not exist in typing.py or PEP 484. +# NOTE: This type does not exist in typing.py or PEP 484 but mypy needs it to exist. # The parameters correspond to Generator, but the 4th is the original type. class AwaitableGenerator( Awaitable[_V_co], Generator[_T_co, _T_contra, _V_co], Generic[_T_co, _T_contra, _V_co, _S], metaclass=ABCMeta @@ -674,7 +680,6 @@ def cast(typ: object, val: Any) -> Any: ... # Type constructors -# NamedTuple is special-cased in the type checker class NamedTuple(Tuple[Any, ...]): _field_types: collections.OrderedDict[str, Type[Any]] _field_defaults: dict[str, Any] @@ -719,14 +724,17 @@ if sys.version_info >= (3, 7): __forward_value__: Any | None __forward_is_argument__: bool if sys.version_info >= (3, 9): - # The module argument was added in Python 3.9.7. - def __init__(self, arg: str, is_argument: bool = ..., module: Any | None = ...) -> None: ... + # The module and is_class arguments were added in later Python 3.9 versions. + def __init__(self, arg: str, is_argument: bool = ..., module: Any | None = ..., *, is_class: bool = ...) -> None: ... else: def __init__(self, arg: str, is_argument: bool = ...) -> None: ... def _evaluate(self, globalns: dict[str, Any] | None, localns: dict[str, Any] | None) -> Any | None: ... def __eq__(self, other: Any) -> bool: ... def __hash__(self) -> int: ... def __repr__(self) -> str: ... + if sys.version_info >= (3, 11): + def __or__(self, other: Any) -> _SpecialForm: ... + def __ror__(self, other: Any) -> _SpecialForm: ... if sys.version_info >= (3, 10): - def is_typeddict(tp: Any) -> bool: ... + def is_typeddict(tp: object) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/case.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/case.pyi index f60f8d6dc..3e20a91bc 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/case.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/case.pyi @@ -10,10 +10,12 @@ from typing import ( Any, AnyStr, Callable, + ClassVar, Container, Generic, Iterable, Mapping, + NamedTuple, NoReturn, Pattern, Sequence, @@ -22,7 +24,6 @@ from typing import ( TypeVar, overload, ) -from unittest._log import _AssertLogsContext, _LoggingWatcher from warnings import WarningMessage if sys.version_info >= (3, 9): @@ -31,6 +32,31 @@ if sys.version_info >= (3, 9): _E = TypeVar("_E", bound=BaseException) _FT = TypeVar("_FT", bound=Callable[..., Any]) +class _BaseTestCaseContext: + def __init__(self, test_case: TestCase) -> None: ... + +if sys.version_info >= (3, 9): + from unittest._log import _AssertLogsContext, _LoggingWatcher +else: + # Unused dummy for _AssertLogsContext. Starting with Python 3.10, + # this is generic over the logging watcher, but in lower versions + # the watcher is hard-coded. + _L = TypeVar("_L") + class _LoggingWatcher(NamedTuple): + records: list[logging.LogRecord] + output: list[str] + class _AssertLogsContext(_BaseTestCaseContext, Generic[_L]): + LOGGING_FORMAT: ClassVar[str] + test_case: TestCase + logger_name: str + level: int + msg: None + def __init__(self, test_case: TestCase, logger_name: str, level: int) -> None: ... + def __enter__(self) -> _LoggingWatcher: ... + def __exit__( + self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> bool | None: ... + if sys.version_info >= (3, 8): def addModuleCleanup(__function: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ... def doModuleCleanups() -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/urllib/parse.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/urllib/parse.pyi index a2467e96c..a5afbdc26 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/urllib/parse.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/urllib/parse.pyi @@ -116,10 +116,10 @@ def urldefrag(url: bytes | None) -> DefragResultBytes: ... def urlencode( query: Mapping[Any, Any] | Mapping[Any, Sequence[Any]] | Sequence[tuple[Any, Any]] | Sequence[tuple[Any, Sequence[Any]]], doseq: bool = ..., - safe: AnyStr = ..., + safe: _Str = ..., encoding: str = ..., errors: str = ..., - quote_via: Callable[[str, AnyStr, str, str], str] = ..., + quote_via: Callable[[AnyStr, _Str, str, str], str] = ..., ) -> str: ... def urljoin(base: AnyStr, url: AnyStr | None, allow_fragments: bool = ...) -> AnyStr: ... @overload diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/__init__.pyi index c5766c326..e5b91bf2a 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/__init__.pyi @@ -43,6 +43,7 @@ class IndexSizeErr(DOMException): ... class DomstringSizeErr(DOMException): ... class HierarchyRequestErr(DOMException): ... class WrongDocumentErr(DOMException): ... +class InvalidCharacterErr(DOMException): ... class NoDataAllowedErr(DOMException): ... class NoModificationAllowedErr(DOMException): ... class NotFoundErr(DOMException): ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/expatbuilder.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/expatbuilder.pyi index 964e6fa3f..58914e8fa 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/expatbuilder.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/expatbuilder.pyi @@ -1,3 +1,99 @@ -from typing import Any +from typing import Any, NoReturn +from xml.dom.minidom import Document, DOMImplementation, Node, TypeInfo +from xml.dom.xmlbuilder import DOMBuilderFilter, Options -def __getattr__(name: str) -> Any: ... # incomplete +TEXT_NODE = Node.TEXT_NODE +CDATA_SECTION_NODE = Node.CDATA_SECTION_NODE +DOCUMENT_NODE = Node.DOCUMENT_NODE +FILTER_ACCEPT = DOMBuilderFilter.FILTER_ACCEPT +FILTER_REJECT = DOMBuilderFilter.FILTER_REJECT +FILTER_SKIP = DOMBuilderFilter.FILTER_SKIP +FILTER_INTERRUPT = DOMBuilderFilter.FILTER_INTERRUPT +theDOMImplementation: DOMImplementation | None + +class ElementInfo: + tagName: Any + def __init__(self, tagName, model: Any | None = ...) -> None: ... + def getAttributeType(self, aname) -> TypeInfo: ... + def getAttributeTypeNS(self, namespaceURI, localName) -> TypeInfo: ... + def isElementContent(self) -> bool: ... + def isEmpty(self) -> bool: ... + def isId(self, aname) -> bool: ... + def isIdNS(self, euri, ename, auri, aname) -> bool: ... + +class ExpatBuilder: + document: Document # Created in self.reset() + curNode: Any # Created in self.reset() + def __init__(self, options: Options | None = ...) -> None: ... + def createParser(self): ... + def getParser(self): ... + def reset(self) -> None: ... + def install(self, parser) -> None: ... + def parseFile(self, file) -> Document: ... + def parseString(self, string: str) -> Document: ... + def start_doctype_decl_handler(self, doctypeName, systemId, publicId, has_internal_subset) -> None: ... + def end_doctype_decl_handler(self) -> None: ... + def pi_handler(self, target, data) -> None: ... + def character_data_handler_cdata(self, data) -> None: ... + def character_data_handler(self, data) -> None: ... + def start_cdata_section_handler(self) -> None: ... + def end_cdata_section_handler(self) -> None: ... + def entity_decl_handler(self, entityName, is_parameter_entity, value, base, systemId, publicId, notationName) -> None: ... + def notation_decl_handler(self, notationName, base, systemId, publicId) -> None: ... + def comment_handler(self, data) -> None: ... + def external_entity_ref_handler(self, context, base, systemId, publicId) -> int: ... + def first_element_handler(self, name, attributes) -> None: ... + def start_element_handler(self, name, attributes) -> None: ... + def end_element_handler(self, name) -> None: ... + def element_decl_handler(self, name, model) -> None: ... + def attlist_decl_handler(self, elem, name, type, default, required) -> None: ... + def xml_decl_handler(self, version, encoding, standalone) -> None: ... + +class FilterVisibilityController: + filter: DOMBuilderFilter + def __init__(self, filter: DOMBuilderFilter) -> None: ... + def startContainer(self, node: Node) -> int: ... + def acceptNode(self, node: Node) -> int: ... + +class FilterCrutch: + def __init__(self, builder) -> None: ... + +class Rejecter(FilterCrutch): + def start_element_handler(self, *args: Any) -> None: ... + def end_element_handler(self, *args: Any) -> None: ... + +class Skipper(FilterCrutch): + def start_element_handler(self, *args: Any) -> None: ... + def end_element_handler(self, *args: Any) -> None: ... + +class FragmentBuilder(ExpatBuilder): + fragment: Any | None + originalDocument: Any + context: Any + def __init__(self, context, options: Options | None = ...) -> None: ... + +class Namespaces: + def createParser(self): ... + def install(self, parser) -> None: ... + def start_namespace_decl_handler(self, prefix, uri) -> None: ... + def start_element_handler(self, name, attributes) -> None: ... + def end_element_handler(self, name) -> None: ... + +class ExpatBuilderNS(Namespaces, ExpatBuilder): ... +class FragmentBuilderNS(Namespaces, FragmentBuilder): ... +class ParseEscape(Exception): ... + +class InternalSubsetExtractor(ExpatBuilder): + subset: Any | None + def getSubset(self) -> Any | None: ... + def parseFile(self, file) -> None: ... # type: ignore[override] + def parseString(self, string: str) -> None: ... # type: ignore[override] + def start_doctype_decl_handler(self, name, publicId, systemId, has_internal_subset) -> None: ... # type: ignore[override] + def end_doctype_decl_handler(self) -> NoReturn: ... + def start_element_handler(self, name, attrs) -> NoReturn: ... + +def parse(file, namespaces: bool = ...): ... +def parseString(string: str, namespaces: bool = ...): ... +def parseFragment(file, context, namespaces: bool = ...): ... +def parseFragmentString(string: str, context, namespaces: bool = ...): ... +def makeBuilder(options: Options) -> ExpatBuilderNS | ExpatBuilder: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/minidom.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/minidom.pyi index 4d1d7a9d0..e9a26e30d 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/minidom.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xml/dom/minidom.pyi @@ -70,6 +70,10 @@ class Attr(Node): self, qName: str, namespaceURI: str | None = ..., localName: Any | None = ..., prefix: Any | None = ... ) -> None: ... def unlink(self) -> None: ... + @property + def isId(self) -> bool: ... + @property + def schemaType(self) -> Any: ... class NamedNodeMap: def __init__(self, attrs, attrsNS, ownerElement) -> None: ... @@ -96,6 +100,8 @@ class NamedNodeMap: def setNamedItem(self, node): ... def setNamedItemNS(self, node): ... def __delitem__(self, attname_or_tuple) -> None: ... + @property + def length(self) -> int: ... AttributeList = NamedNodeMap @@ -110,6 +116,7 @@ class Element(Node): schemaType: Any parentNode: Any tagName: str + nodeName: str prefix: Any namespaceURI: str | None childNodes: Any @@ -139,6 +146,8 @@ class Element(Node): def setIdAttribute(self, name) -> None: ... def setIdAttributeNS(self, namespaceURI: str, localName) -> None: ... def setIdAttributeNode(self, idAttr) -> None: ... + @property + def attributes(self) -> NamedNodeMap: ... class Childless: attributes: Any @@ -173,6 +182,8 @@ class CharacterData(Childless, Node): def insertData(self, offset: int, arg: str) -> None: ... def deleteData(self, offset: int, count: int) -> None: ... def replaceData(self, offset: int, count: int, arg: str) -> None: ... + @property + def length(self) -> int: ... class Text(CharacterData): nodeType: Any @@ -182,6 +193,10 @@ class Text(CharacterData): def splitText(self, offset): ... def writexml(self, writer, indent: str = ..., addindent: str = ..., newl: str = ...) -> None: ... def replaceWholeText(self, content): ... + @property + def isWhitespaceInElementContent(self) -> bool: ... + @property + def wholeText(self) -> str: ... class Comment(CharacterData): nodeType: Any @@ -205,15 +220,17 @@ class ReadOnlySequentialNamedNodeMap: def removeNamedItemNS(self, namespaceURI: str, localName) -> None: ... def setNamedItem(self, node) -> None: ... def setNamedItemNS(self, node) -> None: ... + @property + def length(self) -> int: ... -class Identified: ... +class Identified: + publicId: Any + systemId: Any class DocumentType(Identified, Childless, Node): nodeType: Any nodeValue: Any name: Any - publicId: Any - systemId: Any internalSubset: Any entities: Any notations: Any diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementInclude.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementInclude.pyi index 0ccccce4f..a89f6ab7e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementInclude.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementInclude.pyi @@ -17,6 +17,7 @@ if sys.version_info >= (3, 9): def include( elem: Element, loader: Callable[..., str | Element] | None = ..., base_url: str | None = ..., max_depth: int | None = ... ) -> None: ... + class LimitedRecursiveIncludeError(FatalIncludeError): ... else: def include(elem: Element, loader: Callable[..., str | Element] | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementTree.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementTree.pyi index e63253d8a..6ee578b9a 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementTree.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementTree.pyi @@ -10,6 +10,7 @@ from typing import ( Iterable, Iterator, KeysView, + Mapping, MutableSequence, Sequence, TypeVar, @@ -259,11 +260,29 @@ def fromstringlist(sequence: Sequence[str | bytes], parser: XMLParser | None = . _ElementFactory = Callable[[Any, Dict[Any, Any]], Element] class TreeBuilder: - def __init__(self, element_factory: _ElementFactory | None = ...) -> None: ... + if sys.version_info >= (3, 8): + # comment_factory can take None because passing None to Comment is not an error + def __init__( + self, + element_factory: _ElementFactory | None = ..., + *, + comment_factory: Callable[[str | None], Element] | None = ..., + pi_factory: Callable[[str, str | None], Element] | None = ..., + insert_comments: bool = ..., + insert_pis: bool = ..., + ) -> None: ... + insert_comments: bool + insert_pis: bool + else: + def __init__(self, element_factory: _ElementFactory | None = ...) -> None: ... def close(self) -> Element: ... def data(self, __data: str | bytes) -> None: ... def start(self, __tag: str | bytes, __attrs: dict[str | bytes, str | bytes]) -> Element: ... def end(self, __tag: str | bytes) -> Element: ... + if sys.version_info >= (3, 8): + # These two methods have pos-only parameters in the C implementation + def comment(self, __text: str | None) -> Element: ... + def pi(self, __target: str, __text: str | None = ...) -> Element: ... if sys.version_info >= (3, 8): class C14NWriterTarget: @@ -279,6 +298,12 @@ if sys.version_info >= (3, 8): exclude_attrs: Iterable[str] | None = ..., exclude_tags: Iterable[str] | None = ..., ) -> None: ... + def data(self, data: str) -> None: ... + def start_ns(self, prefix: str, uri: str) -> None: ... + def start(self, tag: str, attrs: Mapping[str, str]) -> None: ... + def end(self, tag: str) -> None: ... + def comment(self, text: str) -> None: ... + def pi(self, target: str, data: str) -> None: ... class XMLParser: parser: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageOps.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageOps.pyi index bff43f61b..2c84e4dc6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageOps.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pillow/PIL/ImageOps.pyi @@ -1,6 +1,9 @@ -from typing import Any, Iterable, Protocol +from typing import Any, Iterable, Protocol, Union from .Image import Image, _Resample, _Size +from .ImageColor import _Ink + +_Border = Union[int, tuple[int, int], tuple[int, int, int, int]] class _Deformer(Protocol): def getmesh(self, image: Image): ... @@ -21,11 +24,11 @@ def contain(image: Image, size: _Size, method: _Resample = ...) -> Image: ... def pad( image: Image, size: _Size, method: _Resample = ..., color: Any | None = ..., centering: Iterable[float] = ... ) -> Image: ... -def crop(image: Image, border: int = ...) -> Image: ... +def crop(image: Image, border: _Border = ...) -> Image: ... def scale(image: Image, factor: float, resample: _Resample = ...) -> Image: ... def deform(image: Image, deformer: _Deformer, resample: _Resample = ...) -> Image: ... def equalize(image: Image, mask: Any | None = ...) -> Image: ... -def expand(image: Image, border: int = ..., fill: int = ...) -> Image: ... +def expand(image: Image, border: _Border = ..., fill: _Ink = ...) -> Image: ... def fit(image: Image, size: _Size, method: _Resample = ..., bleed: float = ..., centering: Iterable[float] = ...) -> Image: ... def flip(image: Image) -> Image: ... def grayscale(image: Image) -> Image: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/__init__.pyi index 0dd9f2890..b77043bb3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/__init__.pyi @@ -1,3 +1,6 @@ +from typing import Generator, Type + +from ..formatter import Formatter from .bbcode import BBCodeFormatter as BBCodeFormatter from .html import HtmlFormatter as HtmlFormatter from .img import ( @@ -15,7 +18,7 @@ from .svg import SvgFormatter as SvgFormatter from .terminal import TerminalFormatter as TerminalFormatter from .terminal256 import Terminal256Formatter as Terminal256Formatter, TerminalTrueColorFormatter as TerminalTrueColorFormatter -def get_all_formatters() -> None: ... +def get_all_formatters() -> Generator[Type[Formatter], None, None]: ... def get_formatter_by_name(_alias, **options): ... def load_formatter_from_file(filename, formattername: str = ..., **options): ... def get_formatter_for_filename(fn, **options): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/METADATA.toml new file mode 100644 index 000000000..5a3c17ff0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/METADATA.toml @@ -0,0 +1,5 @@ +version = "1.4.*" +extra_description = """\ + The `sqlalchemy-stubs` package is an alternative to this package and also \ + includes a mypy plugin for more precise types.\ +""" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/__init__.pyi new file mode 100644 index 000000000..dde3cbce2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/__init__.pyi @@ -0,0 +1,133 @@ +from .engine import ( + create_engine as create_engine, + create_mock_engine as create_mock_engine, + engine_from_config as engine_from_config, +) +from .inspection import inspect as inspect +from .schema import ( + BLANK_SCHEMA as BLANK_SCHEMA, + DDL as DDL, + CheckConstraint as CheckConstraint, + Column as Column, + ColumnDefault as ColumnDefault, + Computed as Computed, + Constraint as Constraint, + DefaultClause as DefaultClause, + FetchedValue as FetchedValue, + ForeignKey as ForeignKey, + ForeignKeyConstraint as ForeignKeyConstraint, + Identity as Identity, + Index as Index, + MetaData as MetaData, + PrimaryKeyConstraint as PrimaryKeyConstraint, + Sequence as Sequence, + Table as Table, + ThreadLocalMetaData as ThreadLocalMetaData, + UniqueConstraint as UniqueConstraint, +) +from .sql import ( + LABEL_STYLE_DEFAULT as LABEL_STYLE_DEFAULT, + LABEL_STYLE_DISAMBIGUATE_ONLY as LABEL_STYLE_DISAMBIGUATE_ONLY, + LABEL_STYLE_NONE as LABEL_STYLE_NONE, + LABEL_STYLE_TABLENAME_PLUS_COL as LABEL_STYLE_TABLENAME_PLUS_COL, + alias as alias, + all_ as all_, + and_ as and_, + any_ as any_, + asc as asc, + between as between, + bindparam as bindparam, + case as case, + cast as cast, + collate as collate, + column as column, + delete as delete, + desc as desc, + distinct as distinct, + except_ as except_, + except_all as except_all, + exists as exists, + extract as extract, + false as false, + func as func, + funcfilter as funcfilter, + insert as insert, + intersect as intersect, + intersect_all as intersect_all, + join as join, + lambda_stmt as lambda_stmt, + lateral as lateral, + literal as literal, + literal_column as literal_column, + modifier as modifier, + not_ as not_, + null as null, + nulls_first as nulls_first, + nulls_last as nulls_last, + nullsfirst as nullsfirst, + nullslast as nullslast, + or_ as or_, + outerjoin as outerjoin, + outparam as outparam, + over as over, + select as select, + subquery as subquery, + table as table, + tablesample as tablesample, + text as text, + true as true, + tuple_ as tuple_, + type_coerce as type_coerce, + union as union, + union_all as union_all, + update as update, + values as values, + within_group as within_group, +) +from .types import ( + ARRAY as ARRAY, + BIGINT as BIGINT, + BINARY as BINARY, + BLOB as BLOB, + BOOLEAN as BOOLEAN, + CHAR as CHAR, + CLOB as CLOB, + DATE as DATE, + DATETIME as DATETIME, + DECIMAL as DECIMAL, + FLOAT as FLOAT, + INT as INT, + INTEGER as INTEGER, + JSON as JSON, + NCHAR as NCHAR, + NUMERIC as NUMERIC, + NVARCHAR as NVARCHAR, + REAL as REAL, + SMALLINT as SMALLINT, + TEXT as TEXT, + TIME as TIME, + TIMESTAMP as TIMESTAMP, + VARBINARY as VARBINARY, + VARCHAR as VARCHAR, + BigInteger as BigInteger, + Boolean as Boolean, + Date as Date, + DateTime as DateTime, + Enum as Enum, + Float as Float, + Integer as Integer, + Interval as Interval, + LargeBinary as LargeBinary, + Numeric as Numeric, + PickleType as PickleType, + SmallInteger as SmallInteger, + String as String, + Text as Text, + Time as Time, + TupleType as TupleType, + TypeDecorator as TypeDecorator, + Unicode as Unicode, + UnicodeText as UnicodeText, +) + +__version__: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/cimmutabledict.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/cimmutabledict.pyi new file mode 100644 index 000000000..851872094 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/cimmutabledict.pyi @@ -0,0 +1,12 @@ +class immutabledict: + def __len__(self) -> int: ... + def __getitem__(self, __item): ... + def __iter__(self): ... + def union(self, **kwargs): ... + def merge_with(self, *args): ... + def keys(self): ... + def __contains__(self, __item): ... + def items(self): ... + def values(self): ... + def get(self, __key, __default=...): ... + def __reduce__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/connectors/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/connectors/__init__.pyi new file mode 100644 index 000000000..b66d337f0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/connectors/__init__.pyi @@ -0,0 +1 @@ +class Connector: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/connectors/mxodbc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/connectors/mxodbc.pyi new file mode 100644 index 000000000..d3bfccd46 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/connectors/mxodbc.pyi @@ -0,0 +1,17 @@ +from typing import Any + +from . import Connector + +class MxODBCConnector(Connector): + driver: str + supports_sane_multi_rowcount: bool + supports_unicode_statements: bool + supports_unicode_binds: bool + supports_native_decimal: bool + @classmethod + def dbapi(cls): ... + def on_connect(self): ... + def create_connect_args(self, url): ... + def is_disconnect(self, e, connection, cursor): ... + def do_executemany(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... + def do_execute(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/connectors/pyodbc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/connectors/pyodbc.pyi new file mode 100644 index 000000000..e821b1964 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/connectors/pyodbc.pyi @@ -0,0 +1,21 @@ +from typing import Any + +from . import Connector + +class PyODBCConnector(Connector): + driver: str + supports_sane_rowcount_returning: bool + supports_sane_multi_rowcount: bool + supports_unicode_statements: bool + supports_unicode_binds: bool + supports_native_decimal: bool + default_paramstyle: str + use_setinputsizes: bool + pyodbc_driver_name: Any + def __init__(self, supports_unicode_binds: Any | None = ..., use_setinputsizes: bool = ..., **kw) -> None: ... + @classmethod + def dbapi(cls): ... + def create_connect_args(self, url): ... + def is_disconnect(self, e, connection, cursor): ... + def do_set_input_sizes(self, cursor, list_of_tuples, context) -> None: ... + def set_isolation_level(self, connection, level) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/cresultproxy.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/cresultproxy.pyi new file mode 100644 index 000000000..a1e830277 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/cresultproxy.pyi @@ -0,0 +1,11 @@ +from typing import Any + +class BaseRow: + def __init__(self, parent, processors, keymap, key_style, data) -> None: ... + def __reduce__(self): ... + def __iter__(self): ... + def __len__(self): ... + def __hash__(self): ... + __getitem__: Any + +def safe_rowproxy_reconstructor(__cls, __state): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/databases/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/databases/__init__.pyi new file mode 100644 index 000000000..58f463cb7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/databases/__init__.pyi @@ -0,0 +1,18 @@ +from ..dialects.firebird import base as firebird_base +from ..dialects.mssql import base as mssql_base +from ..dialects.mysql import base as mysql_base +from ..dialects.oracle import base as oracle_base +from ..dialects.postgresql import base as postgresql_base +from ..dialects.sqlite import base as sqlite_base +from ..dialects.sybase import base as sybase_base + +__all__ = ("firebird", "mssql", "mysql", "postgresql", "sqlite", "oracle", "sybase") + +firebird = firebird_base +mssql = mssql_base +mysql = mysql_base +oracle = oracle_base +postgresql = postgresql_base +postgres = postgresql_base +sqlite = sqlite_base +sybase = sybase_base diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/__init__.pyi new file mode 100644 index 000000000..63292f370 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/__init__.pyi @@ -0,0 +1,16 @@ +from typing import Any + +from . import ( + firebird as firebird, + mssql as mssql, + mysql as mysql, + oracle as oracle, + postgresql as postgresql, + sqlite as sqlite, + sybase as sybase, +) + +__all__ = ("firebird", "mssql", "mysql", "oracle", "postgresql", "sqlite", "sybase") + +registry: Any +plugins: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/__init__.pyi new file mode 100644 index 000000000..c421f787e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/__init__.pyi @@ -0,0 +1,34 @@ +from typing import Any + +from sqlalchemy.dialects.firebird.base import ( + BIGINT as BIGINT, + BLOB as BLOB, + CHAR as CHAR, + DATE as DATE, + FLOAT as FLOAT, + NUMERIC as NUMERIC, + SMALLINT as SMALLINT, + TEXT as TEXT, + TIME as TIME, + TIMESTAMP as TIMESTAMP, + VARCHAR as VARCHAR, +) + +__all__ = ( + "SMALLINT", + "BIGINT", + "FLOAT", + "FLOAT", + "DATE", + "TIME", + "TEXT", + "NUMERIC", + "FLOAT", + "TIMESTAMP", + "VARCHAR", + "CHAR", + "BLOB", + "dialect", +) + +dialect: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi new file mode 100644 index 000000000..d6764ab69 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi @@ -0,0 +1,108 @@ +from typing import Any + +from sqlalchemy import sql, types as sqltypes +from sqlalchemy.engine import default +from sqlalchemy.sql import compiler +from sqlalchemy.types import ( + BIGINT as BIGINT, + BLOB as BLOB, + DATE as DATE, + FLOAT as FLOAT, + INTEGER as INTEGER, + NUMERIC as NUMERIC, + SMALLINT as SMALLINT, + TEXT as TEXT, + TIME as TIME, + TIMESTAMP as TIMESTAMP, + Integer as Integer, +) + +RESERVED_WORDS: Any + +class _StringType(sqltypes.String): + charset: Any + def __init__(self, charset: Any | None = ..., **kw) -> None: ... + +class VARCHAR(_StringType, sqltypes.VARCHAR): + __visit_name__: str + def __init__(self, length: Any | None = ..., **kwargs) -> None: ... + +class CHAR(_StringType, sqltypes.CHAR): + __visit_name__: str + def __init__(self, length: Any | None = ..., **kwargs) -> None: ... + +class _FBDateTime(sqltypes.DateTime): + def bind_processor(self, dialect): ... + +colspecs: Any +ischema_names: Any + +class FBTypeCompiler(compiler.GenericTypeCompiler): + def visit_boolean(self, type_, **kw): ... + def visit_datetime(self, type_, **kw): ... + def visit_TEXT(self, type_, **kw): ... + def visit_BLOB(self, type_, **kw): ... + def visit_CHAR(self, type_, **kw): ... + def visit_VARCHAR(self, type_, **kw): ... + +class FBCompiler(sql.compiler.SQLCompiler): + ansi_bind_rules: bool + def visit_now_func(self, fn, **kw): ... + def visit_startswith_op_binary(self, binary, operator, **kw): ... + def visit_not_startswith_op_binary(self, binary, operator, **kw): ... + def visit_mod_binary(self, binary, operator, **kw): ... + def visit_alias(self, alias, asfrom: bool = ..., **kwargs): ... # type: ignore[override] + def visit_substring_func(self, func, **kw): ... + def visit_length_func(self, function, **kw): ... + visit_char_length_func: Any + def function_argspec(self, func, **kw): ... + def default_from(self): ... + def visit_sequence(self, seq, **kw): ... + def get_select_precolumns(self, select, **kw): ... + def limit_clause(self, select, **kw): ... + def returning_clause(self, stmt, returning_cols): ... + +class FBDDLCompiler(sql.compiler.DDLCompiler): + def visit_create_sequence(self, create): ... + def visit_drop_sequence(self, drop): ... + def visit_computed_column(self, generated): ... + +class FBIdentifierPreparer(sql.compiler.IdentifierPreparer): + reserved_words: Any + illegal_initial_characters: Any + def __init__(self, dialect) -> None: ... + +class FBExecutionContext(default.DefaultExecutionContext): + def fire_sequence(self, seq, type_): ... + +class FBDialect(default.DefaultDialect): + name: str + supports_statement_cache: bool + max_identifier_length: int + supports_sequences: bool + sequences_optional: bool + supports_default_values: bool + postfetch_lastrowid: bool + supports_native_boolean: bool + requires_name_normalize: bool + supports_empty_insert: bool + statement_compiler: Any + ddl_compiler: Any + preparer: Any + type_compiler: Any + colspecs: Any + ischema_names: Any + construct_arguments: Any + def __init__(self, *args, **kwargs) -> None: ... + implicit_returning: Any + def initialize(self, connection) -> None: ... + def has_table(self, connection, table_name, schema: Any | None = ...): ... # type: ignore[override] + def has_sequence(self, connection, sequence_name, schema: Any | None = ...): ... # type: ignore[override] + def get_table_names(self, connection, schema: Any | None = ..., **kw): ... + def get_view_names(self, connection, schema: Any | None = ..., **kw): ... + def get_view_definition(self, connection, view_name, schema: Any | None = ..., **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_column_sequence(self, connection, table_name, column_name, schema: Any | None = ..., **kw): ... + def get_columns(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_foreign_keys(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_indexes(self, connection, table_name, schema: Any | None = ..., **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/fdb.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/fdb.pyi new file mode 100644 index 000000000..4bc56c5a6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/fdb.pyi @@ -0,0 +1,10 @@ +from .kinterbasdb import FBDialect_kinterbasdb + +class FBDialect_fdb(FBDialect_kinterbasdb): + supports_statement_cache: bool + def __init__(self, enable_rowcount: bool = ..., retaining: bool = ..., **kwargs) -> None: ... + @classmethod + def dbapi(cls): ... + def create_connect_args(self, url): ... + +dialect = FBDialect_fdb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi new file mode 100644 index 000000000..a46e1c361 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi @@ -0,0 +1,38 @@ +from typing import Any + +from ...types import Float, Numeric +from .base import FBDialect, FBExecutionContext + +class _kinterbasdb_numeric: + def bind_processor(self, dialect): ... + +class _FBNumeric_kinterbasdb(_kinterbasdb_numeric, Numeric): ... +class _FBFloat_kinterbasdb(_kinterbasdb_numeric, Float): ... + +class FBExecutionContext_kinterbasdb(FBExecutionContext): + @property + def rowcount(self): ... + +class FBDialect_kinterbasdb(FBDialect): + driver: str + supports_statement_cache: bool + supports_sane_rowcount: bool + supports_sane_multi_rowcount: bool + supports_native_decimal: bool + colspecs: Any + enable_rowcount: Any + type_conv: Any + concurrency_level: Any + retaining: Any + def __init__( + self, type_conv: int = ..., concurrency_level: int = ..., enable_rowcount: bool = ..., retaining: bool = ..., **kwargs + ) -> None: ... + @classmethod + def dbapi(cls): ... + def do_execute(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... + def do_rollback(self, dbapi_connection) -> None: ... + def do_commit(self, dbapi_connection) -> None: ... + def create_connect_args(self, url): ... + def is_disconnect(self, e, connection, cursor): ... + +dialect = FBDialect_kinterbasdb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/__init__.pyi new file mode 100644 index 000000000..c4b6c72f6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/__init__.pyi @@ -0,0 +1,76 @@ +from typing import Any + +from .base import ( + BIGINT as BIGINT, + BINARY as BINARY, + BIT as BIT, + CHAR as CHAR, + DATE as DATE, + DATETIME as DATETIME, + DATETIME2 as DATETIME2, + DATETIMEOFFSET as DATETIMEOFFSET, + DECIMAL as DECIMAL, + FLOAT as FLOAT, + IMAGE as IMAGE, + INTEGER as INTEGER, + JSON as JSON, + MONEY as MONEY, + NCHAR as NCHAR, + NTEXT as NTEXT, + NUMERIC as NUMERIC, + NVARCHAR as NVARCHAR, + REAL as REAL, + ROWVERSION as ROWVERSION, + SMALLDATETIME as SMALLDATETIME, + SMALLINT as SMALLINT, + SMALLMONEY as SMALLMONEY, + SQL_VARIANT as SQL_VARIANT, + TEXT as TEXT, + TIME as TIME, + TIMESTAMP as TIMESTAMP, + TINYINT as TINYINT, + UNIQUEIDENTIFIER as UNIQUEIDENTIFIER, + VARBINARY as VARBINARY, + VARCHAR as VARCHAR, + XML as XML, + try_cast as try_cast, +) + +__all__ = ( + "JSON", + "INTEGER", + "BIGINT", + "SMALLINT", + "TINYINT", + "VARCHAR", + "NVARCHAR", + "CHAR", + "NCHAR", + "TEXT", + "NTEXT", + "DECIMAL", + "NUMERIC", + "FLOAT", + "DATETIME", + "DATETIME2", + "DATETIMEOFFSET", + "DATE", + "TIME", + "SMALLDATETIME", + "BINARY", + "VARBINARY", + "BIT", + "REAL", + "IMAGE", + "TIMESTAMP", + "ROWVERSION", + "MONEY", + "SMALLMONEY", + "UNIQUEIDENTIFIER", + "SQL_VARIANT", + "XML", + "dialect", + "try_cast", +) + +dialect: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi new file mode 100644 index 000000000..b1c24b256 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi @@ -0,0 +1,316 @@ +from typing import Any + +import sqlalchemy.types as sqltypes + +from ...engine import default +from ...sql import compiler +from ...sql.elements import Cast +from ...types import ( + BIGINT as BIGINT, + BINARY as BINARY, + CHAR as CHAR, + DATE as DATE, + DATETIME as DATETIME, + DECIMAL as DECIMAL, + FLOAT as FLOAT, + INTEGER as INTEGER, + NCHAR as NCHAR, + NUMERIC as NUMERIC, + NVARCHAR as NVARCHAR, + SMALLINT as SMALLINT, + TEXT as TEXT, + VARCHAR as VARCHAR, +) +from .json import JSON as JSON + +MS_2017_VERSION: Any +MS_2016_VERSION: Any +MS_2014_VERSION: Any +MS_2012_VERSION: Any +MS_2008_VERSION: Any +MS_2005_VERSION: Any +MS_2000_VERSION: Any +RESERVED_WORDS: Any + +class REAL(sqltypes.REAL): + __visit_name__: str + def __init__(self, **kw) -> None: ... + +class TINYINT(sqltypes.Integer): + __visit_name__: str + +class _MSDate(sqltypes.Date): + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +class TIME(sqltypes.TIME): + precision: Any + def __init__(self, precision: Any | None = ..., **kwargs) -> None: ... + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +_MSTime = TIME + +class _BASETIMEIMPL(TIME): + __visit_name__: str + +class _DateTimeBase: + def bind_processor(self, dialect): ... + +class _MSDateTime(_DateTimeBase, sqltypes.DateTime): ... + +class SMALLDATETIME(_DateTimeBase, sqltypes.DateTime): + __visit_name__: str + +class DATETIME2(_DateTimeBase, sqltypes.DateTime): + __visit_name__: str + precision: Any + def __init__(self, precision: Any | None = ..., **kw) -> None: ... + +class DATETIMEOFFSET(_DateTimeBase, sqltypes.DateTime): + __visit_name__: str + precision: Any + def __init__(self, precision: Any | None = ..., **kw) -> None: ... + +class _UnicodeLiteral: + def literal_processor(self, dialect): ... + +class _MSUnicode(_UnicodeLiteral, sqltypes.Unicode): ... +class _MSUnicodeText(_UnicodeLiteral, sqltypes.UnicodeText): ... + +class TIMESTAMP(sqltypes._Binary): + __visit_name__: str + length: Any + convert_int: Any + def __init__(self, convert_int: bool = ...) -> None: ... + def result_processor(self, dialect, coltype): ... + +class ROWVERSION(TIMESTAMP): + __visit_name__: str + +class NTEXT(sqltypes.UnicodeText): + __visit_name__: str + +class VARBINARY(sqltypes.VARBINARY, sqltypes.LargeBinary): + __visit_name__: str + +class IMAGE(sqltypes.LargeBinary): + __visit_name__: str + +class XML(sqltypes.Text): + __visit_name__: str + +class BIT(sqltypes.Boolean): + __visit_name__: str + +class MONEY(sqltypes.TypeEngine): + __visit_name__: str + +class SMALLMONEY(sqltypes.TypeEngine): + __visit_name__: str + +class UNIQUEIDENTIFIER(sqltypes.TypeEngine): + __visit_name__: str + +class SQL_VARIANT(sqltypes.TypeEngine): + __visit_name__: str + +class TryCast(Cast): + __visit_name__: str + stringify_dialect: str + inherit_cache: bool + def __init__(self, *arg, **kw) -> None: ... + +try_cast: Any +MSDateTime: Any +MSDate: Any +MSReal = REAL +MSTinyInteger = TINYINT +MSTime = TIME +MSSmallDateTime = SMALLDATETIME +MSDateTime2 = DATETIME2 +MSDateTimeOffset = DATETIMEOFFSET +MSText = TEXT +MSNText = NTEXT +MSString = VARCHAR +MSNVarchar = NVARCHAR +MSChar = CHAR +MSNChar = NCHAR +MSBinary = BINARY +MSVarBinary = VARBINARY +MSImage = IMAGE +MSBit = BIT +MSMoney = MONEY +MSSmallMoney = SMALLMONEY +MSUniqueIdentifier = UNIQUEIDENTIFIER +MSVariant = SQL_VARIANT +ischema_names: Any + +class MSTypeCompiler(compiler.GenericTypeCompiler): + def visit_FLOAT(self, type_, **kw): ... + def visit_TINYINT(self, type_, **kw): ... + def visit_TIME(self, type_, **kw): ... + def visit_TIMESTAMP(self, type_, **kw): ... + def visit_ROWVERSION(self, type_, **kw): ... + def visit_datetime(self, type_, **kw): ... + def visit_DATETIMEOFFSET(self, type_, **kw): ... + def visit_DATETIME2(self, type_, **kw): ... + def visit_SMALLDATETIME(self, type_, **kw): ... + def visit_unicode(self, type_, **kw): ... + def visit_text(self, type_, **kw): ... + def visit_unicode_text(self, type_, **kw): ... + def visit_NTEXT(self, type_, **kw): ... + def visit_TEXT(self, type_, **kw): ... + def visit_VARCHAR(self, type_, **kw): ... + def visit_CHAR(self, type_, **kw): ... + def visit_NCHAR(self, type_, **kw): ... + def visit_NVARCHAR(self, type_, **kw): ... + def visit_date(self, type_, **kw): ... + def visit__BASETIMEIMPL(self, type_, **kw): ... + def visit_time(self, type_, **kw): ... + def visit_large_binary(self, type_, **kw): ... + def visit_IMAGE(self, type_, **kw): ... + def visit_XML(self, type_, **kw): ... + def visit_VARBINARY(self, type_, **kw): ... + def visit_boolean(self, type_, **kw): ... + def visit_BIT(self, type_, **kw): ... + def visit_JSON(self, type_, **kw): ... + def visit_MONEY(self, type_, **kw): ... + def visit_SMALLMONEY(self, type_, **kw): ... + def visit_UNIQUEIDENTIFIER(self, type_, **kw): ... + def visit_SQL_VARIANT(self, type_, **kw): ... + +class MSExecutionContext(default.DefaultExecutionContext): + def pre_exec(self) -> None: ... + cursor_fetch_strategy: Any + def post_exec(self) -> None: ... + def get_lastrowid(self): ... + @property + def rowcount(self): ... + def handle_dbapi_exception(self, e) -> None: ... + def get_result_cursor_strategy(self, result): ... + def fire_sequence(self, seq, type_): ... + def get_insert_default(self, column): ... + +class MSSQLCompiler(compiler.SQLCompiler): + returning_precedes_values: bool + extract_map: Any + tablealiases: Any + def __init__(self, *args, **kwargs) -> None: ... + def visit_now_func(self, fn, **kw): ... + def visit_current_date_func(self, fn, **kw): ... + def visit_length_func(self, fn, **kw): ... + def visit_char_length_func(self, fn, **kw): ... + def visit_concat_op_binary(self, binary, operator, **kw): ... + def visit_true(self, expr, **kw): ... + def visit_false(self, expr, **kw): ... + def visit_match_op_binary(self, binary, operator, **kw): ... + def get_select_precolumns(self, select, **kw): ... + def get_from_hint_text(self, table, text): ... + def get_crud_hint_text(self, table, text): ... + def fetch_clause(self, cs, **kwargs): ... + def limit_clause(self, cs, **kwargs): ... + def visit_try_cast(self, element, **kw): ... + def translate_select_structure(self, select_stmt, **kwargs): ... + def visit_table(self, table, mssql_aliased: bool = ..., iscrud: bool = ..., **kwargs): ... # type: ignore[override] + def visit_alias(self, alias, **kw): ... + def visit_column(self, column, add_to_result_map: Any | None = ..., **kw): ... # type: ignore[override] + def visit_extract(self, extract, **kw): ... + def visit_savepoint(self, savepoint_stmt): ... + def visit_rollback_to_savepoint(self, savepoint_stmt): ... + def visit_binary(self, binary, **kwargs): ... + def returning_clause(self, stmt, returning_cols): ... + def get_cte_preamble(self, recursive): ... + def label_select_column(self, select, column, asfrom): ... + def for_update_clause(self, select, **kw): ... + def order_by_clause(self, select, **kw): ... + def update_from_clause(self, update_stmt, from_table, extra_froms, from_hints, **kw): ... + def delete_table_clause(self, delete_stmt, from_table, extra_froms): ... + def delete_extra_from_clause(self, delete_stmt, from_table, extra_froms, from_hints, **kw): ... + def visit_empty_set_expr(self, type_): ... + def visit_is_distinct_from_binary(self, binary, operator, **kw): ... + def visit_is_not_distinct_from_binary(self, binary, operator, **kw): ... + def visit_json_getitem_op_binary(self, binary, operator, **kw): ... + def visit_json_path_getitem_op_binary(self, binary, operator, **kw): ... + def visit_sequence(self, seq, **kw): ... + +class MSSQLStrictCompiler(MSSQLCompiler): + ansi_bind_rules: bool + def visit_in_op_binary(self, binary, operator, **kw): ... + def visit_not_in_op_binary(self, binary, operator, **kw): ... + def render_literal_value(self, value, type_): ... + +class MSDDLCompiler(compiler.DDLCompiler): + def get_column_specification(self, column, **kwargs): ... + def visit_create_index(self, create, include_schema: bool = ...): ... # type: ignore[override] + def visit_drop_index(self, drop): ... + def visit_primary_key_constraint(self, constraint): ... + def visit_unique_constraint(self, constraint): ... + def visit_computed_column(self, generated): ... + def visit_create_sequence(self, create, **kw): ... + def visit_identity_column(self, identity, **kw): ... + +class MSIdentifierPreparer(compiler.IdentifierPreparer): + reserved_words: Any + def __init__(self, dialect) -> None: ... + def quote_schema(self, schema, force: Any | None = ...): ... + +class MSDialect(default.DefaultDialect): + name: str + supports_statement_cache: bool + supports_default_values: bool + supports_empty_insert: bool + use_scope_identity: bool + max_identifier_length: int + schema_name: str + implicit_returning: bool + full_returning: bool + colspecs: Any + engine_config_types: Any + ischema_names: Any + supports_sequences: bool + sequences_optional: bool + default_sequence_base: int + supports_native_boolean: bool + non_native_boolean_check_constraint: bool + supports_unicode_binds: bool + postfetch_lastrowid: bool + legacy_schema_aliasing: bool + server_version_info: Any + statement_compiler: Any + ddl_compiler: Any + type_compiler: Any + preparer: Any + construct_arguments: Any + query_timeout: Any + deprecate_large_types: Any + isolation_level: Any + def __init__( + self, + query_timeout: Any | None = ..., + use_scope_identity: bool = ..., + schema_name: str = ..., + isolation_level: Any | None = ..., + deprecate_large_types: Any | None = ..., + json_serializer: Any | None = ..., + json_deserializer: Any | None = ..., + legacy_schema_aliasing: Any | None = ..., + **opts, + ) -> None: ... + def do_savepoint(self, connection, name) -> None: ... + def do_release_savepoint(self, connection, name) -> None: ... + def set_isolation_level(self, connection, level) -> None: ... + def get_isolation_level(self, connection): ... + def initialize(self, connection) -> None: ... + def on_connect(self): ... + def has_table(self, connection, tablename, dbname, owner, schema): ... + def has_sequence(self, connection, sequencename, dbname, owner, schema): ... + def get_sequence_names(self, connection, dbname, owner, schema, **kw): ... + def get_schema_names(self, connection, **kw): ... + def get_table_names(self, connection, dbname, owner, schema, **kw): ... + def get_view_names(self, connection, dbname, owner, schema, **kw): ... + def get_indexes(self, connection, tablename, dbname, owner, schema, **kw): ... + def get_view_definition(self, connection, viewname, dbname, owner, schema, **kw): ... + def get_columns(self, connection, tablename, dbname, owner, schema, **kw): ... + def get_pk_constraint(self, connection, tablename, dbname, owner, schema, **kw): ... + def get_foreign_keys(self, connection, tablename, dbname, owner, schema, **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/information_schema.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/information_schema.pyi new file mode 100644 index 000000000..ec1a2504c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/information_schema.pyi @@ -0,0 +1,35 @@ +from typing import Any + +from ...sql import expression +from ...types import TypeDecorator + +ischema: Any + +class CoerceUnicode(TypeDecorator): + impl: Any + cache_ok: bool + def process_bind_param(self, value, dialect): ... + def bind_expression(self, bindvalue): ... + +class _cast_on_2005(expression.ColumnElement): + bindvalue: Any + def __init__(self, bindvalue) -> None: ... + +schemata: Any +tables: Any +columns: Any +mssql_temp_table_columns: Any +constraints: Any +column_constraints: Any +key_constraints: Any +ref_constraints: Any +views: Any +computed_columns: Any +sequences: Any + +class IdentitySqlVariant(TypeDecorator): + impl: Any + cache_ok: bool + def column_expression(self, colexpr): ... + +identity_columns: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/json.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/json.pyi new file mode 100644 index 000000000..2ced3beec --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/json.pyi @@ -0,0 +1,10 @@ +from ...types import JSON as _JSON + +class JSON(_JSON): ... + +class _FormatTypeMixin: + def bind_processor(self, dialect): ... + def literal_processor(self, dialect): ... + +class JSONIndexType(_FormatTypeMixin, _JSON.JSONIndexType): ... +class JSONPathType(_FormatTypeMixin, _JSON.JSONPathType): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/mxodbc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/mxodbc.pyi new file mode 100644 index 000000000..bddc1929a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/mxodbc.pyi @@ -0,0 +1,26 @@ +from typing import Any + +from ...connectors.mxodbc import MxODBCConnector +from .base import VARBINARY, MSDialect, _MSDate, _MSTime +from .pyodbc import MSExecutionContext_pyodbc, _MSNumeric_pyodbc + +class _MSNumeric_mxodbc(_MSNumeric_pyodbc): ... + +class _MSDate_mxodbc(_MSDate): + def bind_processor(self, dialect): ... + +class _MSTime_mxodbc(_MSTime): + def bind_processor(self, dialect): ... + +class _VARBINARY_mxodbc(VARBINARY): + def bind_processor(self, dialect): ... + +class MSExecutionContext_mxodbc(MSExecutionContext_pyodbc): ... + +class MSDialect_mxodbc(MxODBCConnector, MSDialect): + supports_statement_cache: bool + colspecs: Any + description_encoding: Any + def __init__(self, description_encoding: Any | None = ..., **params) -> None: ... + +dialect = MSDialect_mxodbc diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/compat.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/provision.pyi similarity index 100% rename from packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/compat.pyi rename to packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/provision.pyi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pymssql.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pymssql.pyi new file mode 100644 index 000000000..b16a0b4f7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pymssql.pyi @@ -0,0 +1,24 @@ +from typing import Any + +from ...types import Numeric +from .base import MSDialect, MSIdentifierPreparer + +class _MSNumeric_pymssql(Numeric): + def result_processor(self, dialect, type_): ... + +class MSIdentifierPreparer_pymssql(MSIdentifierPreparer): + def __init__(self, dialect) -> None: ... + +class MSDialect_pymssql(MSDialect): + supports_statement_cache: bool + supports_native_decimal: bool + driver: str + preparer: Any + colspecs: Any + @classmethod + def dbapi(cls): ... + def create_connect_args(self, url): ... + def is_disconnect(self, e, connection, cursor): ... + def set_isolation_level(self, connection, level) -> None: ... + +dialect = MSDialect_pymssql diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi new file mode 100644 index 000000000..907824cea --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi @@ -0,0 +1,44 @@ +from typing import Any + +from ...connectors.pyodbc import PyODBCConnector +from ...types import DateTime, Float, Numeric +from .base import BINARY, DATETIMEOFFSET, VARBINARY, MSDialect, MSExecutionContext + +class _ms_numeric_pyodbc: + def bind_processor(self, dialect): ... + +class _MSNumeric_pyodbc(_ms_numeric_pyodbc, Numeric): ... +class _MSFloat_pyodbc(_ms_numeric_pyodbc, Float): ... + +class _ms_binary_pyodbc: + def bind_processor(self, dialect): ... + +class _ODBCDateTimeBindProcessor: + has_tz: bool + def bind_processor(self, dialect): ... + +class _ODBCDateTime(_ODBCDateTimeBindProcessor, DateTime): ... + +class _ODBCDATETIMEOFFSET(_ODBCDateTimeBindProcessor, DATETIMEOFFSET): + has_tz: bool + +class _VARBINARY_pyodbc(_ms_binary_pyodbc, VARBINARY): ... +class _BINARY_pyodbc(_ms_binary_pyodbc, BINARY): ... + +class MSExecutionContext_pyodbc(MSExecutionContext): + def pre_exec(self) -> None: ... + def post_exec(self) -> None: ... + +class MSDialect_pyodbc(PyODBCConnector, MSDialect): + supports_statement_cache: bool + supports_sane_rowcount_returning: bool + colspecs: Any + description_encoding: Any + use_scope_identity: Any + fast_executemany: Any + def __init__(self, description_encoding: Any | None = ..., fast_executemany: bool = ..., **params) -> None: ... + def on_connect(self): ... + def do_executemany(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... + def is_disconnect(self, e, connection, cursor): ... + +dialect = MSDialect_pyodbc diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/__init__.pyi new file mode 100644 index 000000000..faaa7d6e6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/__init__.pyi @@ -0,0 +1,85 @@ +from typing import Any + +from .base import ( + BIGINT as BIGINT, + BINARY as BINARY, + BIT as BIT, + BLOB as BLOB, + BOOLEAN as BOOLEAN, + CHAR as CHAR, + DATE as DATE, + DATETIME as DATETIME, + DECIMAL as DECIMAL, + DOUBLE as DOUBLE, + ENUM as ENUM, + FLOAT as FLOAT, + INTEGER as INTEGER, + JSON as JSON, + LONGBLOB as LONGBLOB, + LONGTEXT as LONGTEXT, + MEDIUMBLOB as MEDIUMBLOB, + MEDIUMINT as MEDIUMINT, + MEDIUMTEXT as MEDIUMTEXT, + NCHAR as NCHAR, + NUMERIC as NUMERIC, + NVARCHAR as NVARCHAR, + REAL as REAL, + SET as SET, + SMALLINT as SMALLINT, + TEXT as TEXT, + TIME as TIME, + TIMESTAMP as TIMESTAMP, + TINYBLOB as TINYBLOB, + TINYINT as TINYINT, + TINYTEXT as TINYTEXT, + VARBINARY as VARBINARY, + VARCHAR as VARCHAR, + YEAR as YEAR, +) +from .dml import Insert as Insert, insert as insert +from .expression import match as match + +__all__ = ( + "BIGINT", + "BINARY", + "BIT", + "BLOB", + "BOOLEAN", + "CHAR", + "DATE", + "DATETIME", + "DECIMAL", + "DOUBLE", + "ENUM", + "DECIMAL", + "FLOAT", + "INTEGER", + "INTEGER", + "JSON", + "LONGBLOB", + "LONGTEXT", + "MEDIUMBLOB", + "MEDIUMINT", + "MEDIUMTEXT", + "NCHAR", + "NVARCHAR", + "NUMERIC", + "SET", + "SMALLINT", + "REAL", + "TEXT", + "TIME", + "TIMESTAMP", + "TINYBLOB", + "TINYINT", + "TINYTEXT", + "VARBINARY", + "VARCHAR", + "YEAR", + "dialect", + "insert", + "Insert", + "match", +) + +dialect: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/aiomysql.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/aiomysql.pyi new file mode 100644 index 000000000..4021fd906 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/aiomysql.pyi @@ -0,0 +1,73 @@ +from typing import Any + +from ...engine import AdaptedConnection +from .pymysql import MySQLDialect_pymysql + +class AsyncAdapt_aiomysql_cursor: + server_side: bool + await_: Any + def __init__(self, adapt_connection) -> None: ... + @property + def description(self): ... + @property + def rowcount(self): ... + @property + def arraysize(self): ... + @arraysize.setter + def arraysize(self, value) -> None: ... + @property + def lastrowid(self): ... + def close(self) -> None: ... + def execute(self, operation, parameters: Any | None = ...): ... + def executemany(self, operation, seq_of_parameters): ... + def setinputsizes(self, *inputsizes) -> None: ... + def __iter__(self): ... + def fetchone(self): ... + def fetchmany(self, size: Any | None = ...): ... + def fetchall(self): ... + +class AsyncAdapt_aiomysql_ss_cursor(AsyncAdapt_aiomysql_cursor): + server_side: bool + await_: Any + def __init__(self, adapt_connection) -> None: ... + def close(self) -> None: ... + def fetchone(self): ... + def fetchmany(self, size: Any | None = ...): ... + def fetchall(self): ... + +class AsyncAdapt_aiomysql_connection(AdaptedConnection): + await_: Any + dbapi: Any + def __init__(self, dbapi, connection) -> None: ... + def ping(self, reconnect): ... + def character_set_name(self): ... + def autocommit(self, value) -> None: ... + def cursor(self, server_side: bool = ...): ... + def rollback(self) -> None: ... + def commit(self) -> None: ... + def close(self) -> None: ... + +class AsyncAdaptFallback_aiomysql_connection(AsyncAdapt_aiomysql_connection): + await_: Any + +class AsyncAdapt_aiomysql_dbapi: + aiomysql: Any + pymysql: Any + paramstyle: str + def __init__(self, aiomysql, pymysql) -> None: ... + def connect(self, *arg, **kw): ... + +class MySQLDialect_aiomysql(MySQLDialect_pymysql): + driver: str + supports_statement_cache: bool + supports_server_side_cursors: bool + is_async: bool + @classmethod + def dbapi(cls): ... + @classmethod + def get_pool_class(cls, url): ... + def create_connect_args(self, url): ... + def is_disconnect(self, e, connection, cursor): ... + def get_driver_connection(self, connection): ... + +dialect = MySQLDialect_aiomysql diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi new file mode 100644 index 000000000..6c37f8d5a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi @@ -0,0 +1,73 @@ +from typing import Any + +from ...engine import AdaptedConnection +from .pymysql import MySQLDialect_pymysql + +class AsyncAdapt_asyncmy_cursor: + server_side: bool + await_: Any + def __init__(self, adapt_connection) -> None: ... + @property + def description(self): ... + @property + def rowcount(self): ... + @property + def arraysize(self): ... + @arraysize.setter + def arraysize(self, value) -> None: ... + @property + def lastrowid(self): ... + def close(self) -> None: ... + def execute(self, operation, parameters: Any | None = ...): ... + def executemany(self, operation, seq_of_parameters): ... + def setinputsizes(self, *inputsizes) -> None: ... + def __iter__(self): ... + def fetchone(self): ... + def fetchmany(self, size: Any | None = ...): ... + def fetchall(self): ... + +class AsyncAdapt_asyncmy_ss_cursor(AsyncAdapt_asyncmy_cursor): + server_side: bool + await_: Any + def __init__(self, adapt_connection) -> None: ... + def close(self) -> None: ... + def fetchone(self): ... + def fetchmany(self, size: Any | None = ...): ... + def fetchall(self): ... + +class AsyncAdapt_asyncmy_connection(AdaptedConnection): + await_: Any + dbapi: Any + def __init__(self, dbapi, connection) -> None: ... + def ping(self, reconnect): ... + def character_set_name(self): ... + def autocommit(self, value) -> None: ... + def cursor(self, server_side: bool = ...): ... + def rollback(self) -> None: ... + def commit(self) -> None: ... + def close(self) -> None: ... + +class AsyncAdaptFallback_asyncmy_connection(AsyncAdapt_asyncmy_connection): + await_: Any + +class AsyncAdapt_asyncmy_dbapi: + asyncmy: Any + pymysql: Any + paramstyle: str + def __init__(self, asyncmy, pymysql) -> None: ... + def connect(self, *arg, **kw): ... + +class MySQLDialect_asyncmy(MySQLDialect_pymysql): + driver: str + supports_statement_cache: bool + supports_server_side_cursors: bool + is_async: bool + @classmethod + def dbapi(cls): ... + @classmethod + def get_pool_class(cls, url): ... + def create_connect_args(self, url): ... + def is_disconnect(self, e, connection, cursor): ... + def get_driver_connection(self, connection): ... + +dialect = MySQLDialect_asyncmy diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi new file mode 100644 index 000000000..a7b58f6ea --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi @@ -0,0 +1,239 @@ +from typing import Any + +from ...engine import default +from ...sql import compiler +from ...types import BINARY as BINARY, BLOB as BLOB, BOOLEAN as BOOLEAN, DATE as DATE, VARBINARY as VARBINARY +from .enumerated import ENUM as ENUM, SET as SET +from .json import JSON as JSON +from .types import ( + BIGINT as BIGINT, + BIT as BIT, + CHAR as CHAR, + DATETIME as DATETIME, + DECIMAL as DECIMAL, + DOUBLE as DOUBLE, + FLOAT as FLOAT, + INTEGER as INTEGER, + LONGBLOB as LONGBLOB, + LONGTEXT as LONGTEXT, + MEDIUMBLOB as MEDIUMBLOB, + MEDIUMINT as MEDIUMINT, + MEDIUMTEXT as MEDIUMTEXT, + NCHAR as NCHAR, + NUMERIC as NUMERIC, + NVARCHAR as NVARCHAR, + REAL as REAL, + SMALLINT as SMALLINT, + TEXT as TEXT, + TIME as TIME, + TIMESTAMP as TIMESTAMP, + TINYBLOB as TINYBLOB, + TINYINT as TINYINT, + TINYTEXT as TINYTEXT, + VARCHAR as VARCHAR, + YEAR as YEAR, +) + +AUTOCOMMIT_RE: Any +SET_RE: Any +MSTime = TIME +MSSet = SET +MSEnum = ENUM +MSLongBlob = LONGBLOB +MSMediumBlob = MEDIUMBLOB +MSTinyBlob = TINYBLOB +MSBlob = BLOB +MSBinary = BINARY +MSVarBinary = VARBINARY +MSNChar = NCHAR +MSNVarChar = NVARCHAR +MSChar = CHAR +MSString = VARCHAR +MSLongText = LONGTEXT +MSMediumText = MEDIUMTEXT +MSTinyText = TINYTEXT +MSText = TEXT +MSYear = YEAR +MSTimeStamp = TIMESTAMP +MSBit = BIT +MSSmallInteger = SMALLINT +MSTinyInteger = TINYINT +MSMediumInteger = MEDIUMINT +MSBigInteger = BIGINT +MSNumeric = NUMERIC +MSDecimal = DECIMAL +MSDouble = DOUBLE +MSReal = REAL +MSFloat = FLOAT +MSInteger = INTEGER +colspecs: Any +ischema_names: Any + +class MySQLExecutionContext(default.DefaultExecutionContext): + def should_autocommit_text(self, statement): ... + def create_server_side_cursor(self): ... + def fire_sequence(self, seq, type_): ... + +class MySQLCompiler(compiler.SQLCompiler): + render_table_with_column_in_update_from: bool + extract_map: Any + def default_from(self): ... + def visit_random_func(self, fn, **kw): ... + def visit_sequence(self, seq, **kw): ... + def visit_sysdate_func(self, fn, **kw): ... + def visit_json_getitem_op_binary(self, binary, operator, **kw): ... + def visit_json_path_getitem_op_binary(self, binary, operator, **kw): ... + def visit_on_duplicate_key_update(self, on_duplicate, **kw): ... + def visit_concat_op_binary(self, binary, operator, **kw): ... + def visit_mysql_match(self, element, **kw): ... + def visit_match_op_binary(self, binary, operator, **kw): ... + def get_from_hint_text(self, table, text): ... + def visit_typeclause(self, typeclause, type_: Any | None = ..., **kw): ... + def visit_cast(self, cast, **kw): ... + def render_literal_value(self, value, type_): ... + def visit_true(self, element, **kw): ... + def visit_false(self, element, **kw): ... + def get_select_precolumns(self, select, **kw): ... + def visit_join(self, join, asfrom: bool = ..., from_linter: Any | None = ..., **kwargs): ... + def for_update_clause(self, select, **kw): ... + def limit_clause(self, select, **kw): ... + def update_limit_clause(self, update_stmt): ... + def update_tables_clause(self, update_stmt, from_table, extra_froms, **kw): ... + def update_from_clause(self, update_stmt, from_table, extra_froms, from_hints, **kw) -> None: ... + def delete_table_clause(self, delete_stmt, from_table, extra_froms): ... + def delete_extra_from_clause(self, delete_stmt, from_table, extra_froms, from_hints, **kw): ... + def visit_empty_set_expr(self, element_types): ... + def visit_is_distinct_from_binary(self, binary, operator, **kw): ... + def visit_is_not_distinct_from_binary(self, binary, operator, **kw): ... + def visit_regexp_match_op_binary(self, binary, operator, **kw): ... + def visit_not_regexp_match_op_binary(self, binary, operator, **kw): ... + def visit_regexp_replace_op_binary(self, binary, operator, **kw): ... + +class MySQLDDLCompiler(compiler.DDLCompiler): + def get_column_specification(self, column, **kw): ... + def post_create_table(self, table): ... + def visit_create_index(self, create, **kw): ... + def visit_primary_key_constraint(self, constraint): ... + def visit_drop_index(self, drop): ... + def visit_drop_constraint(self, drop): ... + def define_constraint_match(self, constraint): ... + def visit_set_table_comment(self, create): ... + def visit_drop_table_comment(self, create): ... + def visit_set_column_comment(self, create): ... + +class MySQLTypeCompiler(compiler.GenericTypeCompiler): + def visit_NUMERIC(self, type_, **kw): ... + def visit_DECIMAL(self, type_, **kw): ... + def visit_DOUBLE(self, type_, **kw): ... + def visit_REAL(self, type_, **kw): ... + def visit_FLOAT(self, type_, **kw): ... + def visit_INTEGER(self, type_, **kw): ... + def visit_BIGINT(self, type_, **kw): ... + def visit_MEDIUMINT(self, type_, **kw): ... + def visit_TINYINT(self, type_, **kw): ... + def visit_SMALLINT(self, type_, **kw): ... + def visit_BIT(self, type_, **kw): ... + def visit_DATETIME(self, type_, **kw): ... + def visit_DATE(self, type_, **kw): ... + def visit_TIME(self, type_, **kw): ... + def visit_TIMESTAMP(self, type_, **kw): ... + def visit_YEAR(self, type_, **kw): ... + def visit_TEXT(self, type_, **kw): ... + def visit_TINYTEXT(self, type_, **kw): ... + def visit_MEDIUMTEXT(self, type_, **kw): ... + def visit_LONGTEXT(self, type_, **kw): ... + def visit_VARCHAR(self, type_, **kw): ... + def visit_CHAR(self, type_, **kw): ... + def visit_NVARCHAR(self, type_, **kw): ... + def visit_NCHAR(self, type_, **kw): ... + def visit_VARBINARY(self, type_, **kw): ... + def visit_JSON(self, type_, **kw): ... + def visit_large_binary(self, type_, **kw): ... + def visit_enum(self, type_, **kw): ... + def visit_BLOB(self, type_, **kw): ... + def visit_TINYBLOB(self, type_, **kw): ... + def visit_MEDIUMBLOB(self, type_, **kw): ... + def visit_LONGBLOB(self, type_, **kw): ... + def visit_ENUM(self, type_, **kw): ... + def visit_SET(self, type_, **kw): ... + def visit_BOOLEAN(self, type_, **kw): ... + +class MySQLIdentifierPreparer(compiler.IdentifierPreparer): + reserved_words: Any + def __init__(self, dialect, server_ansiquotes: bool = ..., **kw) -> None: ... + +class MariaDBIdentifierPreparer(MySQLIdentifierPreparer): + reserved_words: Any + +class MySQLDialect(default.DefaultDialect): + logger: Any + name: str + supports_statement_cache: bool + supports_alter: bool + supports_native_boolean: bool + max_identifier_length: int + max_index_name_length: int + max_constraint_name_length: int + supports_native_enum: bool + supports_sequences: bool + sequences_optional: bool + supports_for_update_of: bool + supports_default_values: bool + supports_default_metavalue: bool + supports_sane_rowcount: bool + supports_sane_multi_rowcount: bool + supports_multivalues_insert: bool + supports_comments: bool + inline_comments: bool + default_paramstyle: str + colspecs: Any + cte_follows_insert: bool + statement_compiler: Any + ddl_compiler: Any + type_compiler: Any + ischema_names: Any + preparer: Any + is_mariadb: bool + construct_arguments: Any + isolation_level: Any + def __init__( + self, + isolation_level: Any | None = ..., + json_serializer: Any | None = ..., + json_deserializer: Any | None = ..., + is_mariadb: Any | None = ..., + **kwargs, + ) -> None: ... + def on_connect(self): ... + def set_isolation_level(self, connection, level) -> None: ... + def get_isolation_level(self, connection): ... + def do_begin_twophase(self, connection, xid) -> None: ... + def do_prepare_twophase(self, connection, xid) -> None: ... + def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_recover_twophase(self, connection): ... + def is_disconnect(self, e, connection, cursor): ... + def has_table(self, connection, table_name, schema: Any | None = ...): ... # type: ignore[override] + def has_sequence(self, connection, sequence_name, schema: Any | None = ...): ... # type: ignore[override] + def get_sequence_names(self, connection, schema: Any | None = ..., **kw): ... + identifier_preparer: Any + def initialize(self, connection) -> None: ... + def get_schema_names(self, connection, **kw): ... + def get_table_names(self, connection, schema: Any | None = ..., **kw): ... + def get_view_names(self, connection, schema: Any | None = ..., **kw): ... + def get_table_options(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_columns(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_foreign_keys(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_check_constraints(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_table_comment(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_indexes(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_unique_constraints(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_view_definition(self, connection, view_name, schema: Any | None = ..., **kw): ... + +class _DecodingRow: + rowproxy: Any + charset: Any + def __init__(self, rowproxy, charset) -> None: ... + def __getitem__(self, index): ... + def __getattr__(self, attr): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/cymysql.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/cymysql.pyi new file mode 100644 index 000000000..408d931df --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/cymysql.pyi @@ -0,0 +1,21 @@ +from typing import Any + +from .base import BIT +from .mysqldb import MySQLDialect_mysqldb + +class _cymysqlBIT(BIT): + def result_processor(self, dialect, coltype): ... + +class MySQLDialect_cymysql(MySQLDialect_mysqldb): + driver: str + supports_statement_cache: bool + description_encoding: Any + supports_sane_rowcount: bool + supports_sane_multi_rowcount: bool + supports_unicode_statements: bool + colspecs: Any + @classmethod + def dbapi(cls): ... + def is_disconnect(self, e, connection, cursor): ... + +dialect = MySQLDialect_cymysql diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/dml.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/dml.pyi new file mode 100644 index 000000000..77b095c16 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/dml.pyi @@ -0,0 +1,23 @@ +from typing import Any + +from ...sql.dml import Insert as StandardInsert +from ...sql.elements import ClauseElement +from ...util import memoized_property + +class Insert(StandardInsert): + stringify_dialect: str + inherit_cache: bool + @property + def inserted(self): ... + @memoized_property + def inserted_alias(self): ... + def on_duplicate_key_update(self, *args, **kw) -> None: ... + +insert: Any + +class OnDuplicateClause(ClauseElement): + __visit_name__: str + stringify_dialect: str + inserted_alias: Any + update: Any + def __init__(self, inserted_alias, update) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/enumerated.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/enumerated.pyi new file mode 100644 index 000000000..ba9343513 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/enumerated.pyi @@ -0,0 +1,21 @@ +from typing import Any + +from ...sql import sqltypes +from .types import _StringType + +class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum, _StringType): # type: ignore[misc] + __visit_name__: str + native_enum: bool + def __init__(self, *enums, **kw) -> None: ... + @classmethod + def adapt_emulated_to_native(cls, impl, **kw): ... + +class SET(_StringType): + __visit_name__: str + retrieve_as_bitwise: Any + values: Any + def __init__(self, *values, **kw) -> None: ... + def column_expression(self, colexpr): ... + def result_processor(self, dialect, coltype): ... + def bind_processor(self, dialect): ... + def adapt(self, impltype, **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/expression.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/expression.pyi new file mode 100644 index 000000000..24d63634f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/expression.pyi @@ -0,0 +1,13 @@ +from typing import Any + +from ...sql import elements +from ...sql.base import Generative + +class match(Generative, elements.BinaryExpression): + __visit_name__: str + inherit_cache: bool + def __init__(self, *cols, **kw) -> None: ... + modifiers: Any + def in_boolean_mode(self) -> None: ... + def in_natural_language_mode(self) -> None: ... + def with_query_expansion(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/json.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/json.pyi new file mode 100644 index 000000000..c35f9c440 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/json.pyi @@ -0,0 +1,10 @@ +import sqlalchemy.types as sqltypes + +class JSON(sqltypes.JSON): ... + +class _FormatTypeMixin: + def bind_processor(self, dialect): ... + def literal_processor(self, dialect): ... + +class JSONIndexType(_FormatTypeMixin, sqltypes.JSON.JSONIndexType): ... +class JSONPathType(_FormatTypeMixin, sqltypes.JSON.JSONPathType): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mariadb.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mariadb.pyi new file mode 100644 index 000000000..db8f5abd5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mariadb.pyi @@ -0,0 +1,11 @@ +from typing import Any + +from .base import MySQLDialect + +class MariaDBDialect(MySQLDialect): + is_mariadb: bool + supports_statement_cache: bool + name: str + preparer: Any + +def loader(driver): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mariadbconnector.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mariadbconnector.pyi new file mode 100644 index 000000000..0735fb75a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mariadbconnector.pyi @@ -0,0 +1,36 @@ +from typing import Any + +from .base import MySQLCompiler, MySQLDialect, MySQLExecutionContext + +mariadb_cpy_minimum_version: Any + +class MySQLExecutionContext_mariadbconnector(MySQLExecutionContext): + def create_server_side_cursor(self): ... + def create_default_cursor(self): ... + +class MySQLCompiler_mariadbconnector(MySQLCompiler): ... + +class MySQLDialect_mariadbconnector(MySQLDialect): + driver: str + supports_statement_cache: bool + supports_unicode_statements: bool + encoding: str + convert_unicode: bool + supports_sane_rowcount: bool + supports_sane_multi_rowcount: bool + supports_native_decimal: bool + default_paramstyle: str + statement_compiler: Any + supports_server_side_cursors: bool + paramstyle: str + def __init__(self, **kwargs) -> None: ... + @classmethod + def dbapi(cls): ... + def is_disconnect(self, e, connection, cursor): ... + def create_connect_args(self, url): ... + def do_begin_twophase(self, connection, xid) -> None: ... + def do_prepare_twophase(self, connection, xid) -> None: ... + def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + +dialect = MySQLDialect_mariadbconnector diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqlconnector.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqlconnector.pyi new file mode 100644 index 000000000..df0a63589 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqlconnector.pyi @@ -0,0 +1,38 @@ +from typing import Any + +from ...util import memoized_property +from .base import BIT, MySQLCompiler, MySQLDialect, MySQLIdentifierPreparer + +class MySQLCompiler_mysqlconnector(MySQLCompiler): + def visit_mod_binary(self, binary, operator, **kw): ... + def post_process_text(self, text): ... + def escape_literal_column(self, text): ... + +class MySQLIdentifierPreparer_mysqlconnector(MySQLIdentifierPreparer): ... + +class _myconnpyBIT(BIT): + def result_processor(self, dialect, coltype) -> None: ... + +class MySQLDialect_mysqlconnector(MySQLDialect): + driver: str + supports_statement_cache: bool + supports_unicode_binds: bool + supports_sane_rowcount: bool + supports_sane_multi_rowcount: bool + supports_native_decimal: bool + default_paramstyle: str + statement_compiler: Any + preparer: Any + colspecs: Any + def __init__(self, *arg, **kw) -> None: ... + @property + def description_encoding(self): ... + @memoized_property + def supports_unicode_statements(self): ... + @classmethod + def dbapi(cls): ... + def do_ping(self, dbapi_connection): ... + def create_connect_args(self, url): ... + def is_disconnect(self, e, connection, cursor): ... + +dialect = MySQLDialect_mysqlconnector diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi new file mode 100644 index 000000000..bb41d161d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi @@ -0,0 +1,32 @@ +from typing import Any + +from ...util import memoized_property +from .base import MySQLCompiler, MySQLDialect, MySQLExecutionContext + +class MySQLExecutionContext_mysqldb(MySQLExecutionContext): + @property + def rowcount(self): ... + +class MySQLCompiler_mysqldb(MySQLCompiler): ... + +class MySQLDialect_mysqldb(MySQLDialect): + driver: str + supports_statement_cache: bool + supports_unicode_statements: bool + supports_sane_rowcount: bool + supports_sane_multi_rowcount: bool + supports_native_decimal: bool + default_paramstyle: str + statement_compiler: Any + preparer: Any + def __init__(self, **kwargs) -> None: ... + @memoized_property + def supports_server_side_cursors(self): ... + @classmethod + def dbapi(cls): ... + def on_connect(self): ... + def do_ping(self, dbapi_connection): ... + def do_executemany(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... + def create_connect_args(self, url, _translate_args: Any | None = ...): ... + +dialect = MySQLDialect_mysqldb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/oursql.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/oursql.pyi new file mode 100644 index 000000000..40d1d6919 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/oursql.pyi @@ -0,0 +1,39 @@ +from typing import Any + +from .base import BIT, MySQLDialect, MySQLExecutionContext + +class _oursqlBIT(BIT): + def result_processor(self, dialect, coltype) -> None: ... + +class MySQLExecutionContext_oursql(MySQLExecutionContext): + @property + def plain_query(self): ... + +class MySQLDialect_oursql(MySQLDialect): + driver: str + supports_statement_cache: bool + supports_unicode_binds: bool + supports_unicode_statements: bool + supports_native_decimal: bool + supports_sane_rowcount: bool + supports_sane_multi_rowcount: bool + colspecs: Any + @classmethod + def dbapi(cls): ... + def do_execute(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... + def do_begin(self, connection) -> None: ... + def do_begin_twophase(self, connection, xid) -> None: ... + def do_prepare_twophase(self, connection, xid) -> None: ... + def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def has_table(self, connection, table_name, schema: Any | None = ...): ... # type: ignore[override] + def get_table_options(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_columns(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_view_names(self, connection, schema: Any | None = ..., **kw): ... + def get_table_names(self, connection, schema: Any | None = ..., **kw): ... + def get_schema_names(self, connection, **kw): ... + def initialize(self, connection): ... + def is_disconnect(self, e, connection, cursor): ... + def create_connect_args(self, url): ... + +dialect = MySQLDialect_oursql diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/provision.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/provision.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi new file mode 100644 index 000000000..a4f6cb64f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi @@ -0,0 +1,19 @@ +from typing import Any + +from ...util import memoized_property +from .mysqldb import MySQLDialect_mysqldb + +class MySQLDialect_pymysql(MySQLDialect_mysqldb): + driver: str + supports_statement_cache: bool + description_encoding: Any + supports_unicode_statements: bool + supports_unicode_binds: bool + @memoized_property + def supports_server_side_cursors(self): ... + @classmethod + def dbapi(cls): ... + def create_connect_args(self, url, _translate_args: Any | None = ...): ... + def is_disconnect(self, e, connection, cursor): ... + +dialect = MySQLDialect_pymysql diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pyodbc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pyodbc.pyi new file mode 100644 index 000000000..f9363c3cc --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pyodbc.pyi @@ -0,0 +1,20 @@ +from typing import Any + +from ...connectors.pyodbc import PyODBCConnector +from .base import MySQLDialect, MySQLExecutionContext +from .types import TIME + +class _pyodbcTIME(TIME): + def result_processor(self, dialect, coltype): ... + +class MySQLExecutionContext_pyodbc(MySQLExecutionContext): + def get_lastrowid(self): ... + +class MySQLDialect_pyodbc(PyODBCConnector, MySQLDialect): + supports_statement_cache: bool + colspecs: Any + supports_unicode_statements: bool + pyodbc_driver_name: str + def on_connect(self): ... + +dialect = MySQLDialect_pyodbc diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/reflection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/reflection.pyi new file mode 100644 index 000000000..0df92ff88 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/reflection.pyi @@ -0,0 +1,17 @@ +from typing import Any + +class ReflectedState: + columns: Any + table_options: Any + table_name: Any + keys: Any + fk_constraints: Any + ck_constraints: Any + def __init__(self) -> None: ... + +class MySQLTableDefinitionParser: + logger: Any + dialect: Any + preparer: Any + def __init__(self, dialect, preparer) -> None: ... + def parse(self, show_create, charset): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/reserved_words.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/reserved_words.pyi new file mode 100644 index 000000000..28a741b2b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/reserved_words.pyi @@ -0,0 +1,4 @@ +from typing import Any + +RESERVED_WORDS_MARIADB: Any +RESERVED_WORDS_MYSQL: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi new file mode 100644 index 000000000..402a19aa5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi @@ -0,0 +1,145 @@ +from typing import Any + +import sqlalchemy.types as sqltypes + +class _NumericType: + unsigned: Any + zerofill: Any + def __init__(self, unsigned: bool = ..., zerofill: bool = ..., **kw) -> None: ... + +class _FloatType(_NumericType, sqltypes.Float): + scale: Any + def __init__(self, precision: Any | None = ..., scale: Any | None = ..., asdecimal: bool = ..., **kw) -> None: ... + +class _IntegerType(_NumericType, sqltypes.Integer): + display_width: Any + def __init__(self, display_width: Any | None = ..., **kw) -> None: ... + +class _StringType(sqltypes.String): + charset: Any + ascii: Any + unicode: Any + binary: Any + national: Any + def __init__( + self, + charset: Any | None = ..., + collation: Any | None = ..., + ascii: bool = ..., + binary: bool = ..., + unicode: bool = ..., + national: bool = ..., + **kw, + ) -> None: ... + +class _MatchType(sqltypes.Float, sqltypes.MatchType): # type: ignore[misc] + def __init__(self, **kw) -> None: ... + +class NUMERIC(_NumericType, sqltypes.NUMERIC): + __visit_name__: str + def __init__(self, precision: Any | None = ..., scale: Any | None = ..., asdecimal: bool = ..., **kw) -> None: ... + +class DECIMAL(_NumericType, sqltypes.DECIMAL): + __visit_name__: str + def __init__(self, precision: Any | None = ..., scale: Any | None = ..., asdecimal: bool = ..., **kw) -> None: ... + +class DOUBLE(_FloatType): + __visit_name__: str + def __init__(self, precision: Any | None = ..., scale: Any | None = ..., asdecimal: bool = ..., **kw) -> None: ... + +class REAL(_FloatType, sqltypes.REAL): + __visit_name__: str + def __init__(self, precision: Any | None = ..., scale: Any | None = ..., asdecimal: bool = ..., **kw) -> None: ... + +class FLOAT(_FloatType, sqltypes.FLOAT): + __visit_name__: str + def __init__(self, precision: Any | None = ..., scale: Any | None = ..., asdecimal: bool = ..., **kw) -> None: ... + def bind_processor(self, dialect) -> None: ... + +class INTEGER(_IntegerType, sqltypes.INTEGER): + __visit_name__: str + def __init__(self, display_width: Any | None = ..., **kw) -> None: ... + +class BIGINT(_IntegerType, sqltypes.BIGINT): + __visit_name__: str + def __init__(self, display_width: Any | None = ..., **kw) -> None: ... + +class MEDIUMINT(_IntegerType): + __visit_name__: str + def __init__(self, display_width: Any | None = ..., **kw) -> None: ... + +class TINYINT(_IntegerType): + __visit_name__: str + def __init__(self, display_width: Any | None = ..., **kw) -> None: ... + +class SMALLINT(_IntegerType, sqltypes.SMALLINT): + __visit_name__: str + def __init__(self, display_width: Any | None = ..., **kw) -> None: ... + +class BIT(sqltypes.TypeEngine): + __visit_name__: str + length: Any + def __init__(self, length: Any | None = ...) -> None: ... + def result_processor(self, dialect, coltype): ... + +class TIME(sqltypes.TIME): + __visit_name__: str + fsp: Any + def __init__(self, timezone: bool = ..., fsp: Any | None = ...) -> None: ... + def result_processor(self, dialect, coltype): ... + +class TIMESTAMP(sqltypes.TIMESTAMP): + __visit_name__: str + fsp: Any + def __init__(self, timezone: bool = ..., fsp: Any | None = ...) -> None: ... + +class DATETIME(sqltypes.DATETIME): + __visit_name__: str + fsp: Any + def __init__(self, timezone: bool = ..., fsp: Any | None = ...) -> None: ... + +class YEAR(sqltypes.TypeEngine): + __visit_name__: str + display_width: Any + def __init__(self, display_width: Any | None = ...) -> None: ... + +class TEXT(_StringType, sqltypes.TEXT): + __visit_name__: str + def __init__(self, length: Any | None = ..., **kw) -> None: ... + +class TINYTEXT(_StringType): + __visit_name__: str + def __init__(self, **kwargs) -> None: ... + +class MEDIUMTEXT(_StringType): + __visit_name__: str + def __init__(self, **kwargs) -> None: ... + +class LONGTEXT(_StringType): + __visit_name__: str + def __init__(self, **kwargs) -> None: ... + +class VARCHAR(_StringType, sqltypes.VARCHAR): + __visit_name__: str + def __init__(self, length: Any | None = ..., **kwargs) -> None: ... + +class CHAR(_StringType, sqltypes.CHAR): + __visit_name__: str + def __init__(self, length: Any | None = ..., **kwargs) -> None: ... + +class NVARCHAR(_StringType, sqltypes.NVARCHAR): + __visit_name__: str + def __init__(self, length: Any | None = ..., **kwargs) -> None: ... + +class NCHAR(_StringType, sqltypes.NCHAR): + __visit_name__: str + def __init__(self, length: Any | None = ..., **kwargs) -> None: ... + +class TINYBLOB(sqltypes._Binary): + __visit_name__: str + +class MEDIUMBLOB(sqltypes._Binary): + __visit_name__: str + +class LONGBLOB(sqltypes._Binary): + __visit_name__: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/__init__.pyi new file mode 100644 index 000000000..3cc1662ff --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/__init__.pyi @@ -0,0 +1,52 @@ +from typing import Any + +from .base import ( + BFILE as BFILE, + BINARY_DOUBLE as BINARY_DOUBLE, + BINARY_FLOAT as BINARY_FLOAT, + BLOB as BLOB, + CHAR as CHAR, + CLOB as CLOB, + DATE as DATE, + DOUBLE_PRECISION as DOUBLE_PRECISION, + FLOAT as FLOAT, + INTERVAL as INTERVAL, + LONG as LONG, + NCHAR as NCHAR, + NCLOB as NCLOB, + NUMBER as NUMBER, + NVARCHAR as NVARCHAR, + NVARCHAR2 as NVARCHAR2, + RAW as RAW, + ROWID as ROWID, + TIMESTAMP as TIMESTAMP, + VARCHAR as VARCHAR, + VARCHAR2 as VARCHAR2, +) + +__all__ = ( + "VARCHAR", + "NVARCHAR", + "CHAR", + "NCHAR", + "DATE", + "NUMBER", + "BLOB", + "BFILE", + "CLOB", + "NCLOB", + "TIMESTAMP", + "RAW", + "FLOAT", + "DOUBLE_PRECISION", + "BINARY_DOUBLE", + "BINARY_FLOAT", + "LONG", + "dialect", + "INTERVAL", + "VARCHAR2", + "NVARCHAR2", + "ROWID", +) + +dialect: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi new file mode 100644 index 000000000..6b9668957 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi @@ -0,0 +1,219 @@ +from typing import Any + +from sqlalchemy.sql import ClauseElement + +from ...engine import default +from ...sql import compiler, sqltypes +from ...types import ( + BLOB as BLOB, + CHAR as CHAR, + CLOB as CLOB, + FLOAT as FLOAT, + INTEGER as INTEGER, + NCHAR as NCHAR, + NVARCHAR as NVARCHAR, + TIMESTAMP as TIMESTAMP, + VARCHAR as VARCHAR, +) + +RESERVED_WORDS: Any +NO_ARG_FNS: Any + +class RAW(sqltypes._Binary): + __visit_name__: str + +OracleRaw = RAW + +class NCLOB(sqltypes.Text): + __visit_name__: str + +class VARCHAR2(VARCHAR): + __visit_name__: str + +NVARCHAR2 = NVARCHAR + +class NUMBER(sqltypes.Numeric, sqltypes.Integer): + __visit_name__: str + def __init__(self, precision: Any | None = ..., scale: Any | None = ..., asdecimal: Any | None = ...) -> None: ... + def adapt(self, impltype): ... + +class DOUBLE_PRECISION(sqltypes.Float): + __visit_name__: str + +class BINARY_DOUBLE(sqltypes.Float): + __visit_name__: str + +class BINARY_FLOAT(sqltypes.Float): + __visit_name__: str + +class BFILE(sqltypes.LargeBinary): + __visit_name__: str + +class LONG(sqltypes.Text): + __visit_name__: str + +class DATE(sqltypes.DateTime): + __visit_name__: str + +class INTERVAL(sqltypes.NativeForEmulated, sqltypes._AbstractInterval): + __visit_name__: str + day_precision: Any + second_precision: Any + def __init__(self, day_precision: Any | None = ..., second_precision: Any | None = ...) -> None: ... + def as_generic(self, allow_nulltype: bool = ...): ... + def coerce_compared_value(self, op, value): ... + +class ROWID(sqltypes.TypeEngine): + __visit_name__: str + +class _OracleBoolean(sqltypes.Boolean): + def get_dbapi_type(self, dbapi): ... + +colspecs: Any +ischema_names: Any + +class OracleTypeCompiler(compiler.GenericTypeCompiler): + def visit_datetime(self, type_, **kw): ... + def visit_float(self, type_, **kw): ... + def visit_unicode(self, type_, **kw): ... + def visit_INTERVAL(self, type_, **kw): ... + def visit_LONG(self, type_, **kw): ... + def visit_TIMESTAMP(self, type_, **kw): ... + def visit_DOUBLE_PRECISION(self, type_, **kw): ... + def visit_BINARY_DOUBLE(self, type_, **kw): ... + def visit_BINARY_FLOAT(self, type_, **kw): ... + def visit_FLOAT(self, type_, **kw): ... + def visit_NUMBER(self, type_, **kw): ... + def visit_string(self, type_, **kw): ... + def visit_VARCHAR2(self, type_, **kw): ... + def visit_NVARCHAR2(self, type_, **kw): ... + visit_NVARCHAR: Any + def visit_VARCHAR(self, type_, **kw): ... + def visit_text(self, type_, **kw): ... + def visit_unicode_text(self, type_, **kw): ... + def visit_large_binary(self, type_, **kw): ... + def visit_big_integer(self, type_, **kw): ... + def visit_boolean(self, type_, **kw): ... + def visit_RAW(self, type_, **kw): ... + def visit_ROWID(self, type_, **kw): ... + +class OracleCompiler(compiler.SQLCompiler): + compound_keywords: Any + def __init__(self, *args, **kwargs) -> None: ... + def visit_mod_binary(self, binary, operator, **kw): ... + def visit_now_func(self, fn, **kw): ... + def visit_char_length_func(self, fn, **kw): ... + def visit_match_op_binary(self, binary, operator, **kw): ... + def visit_true(self, expr, **kw): ... + def visit_false(self, expr, **kw): ... + def get_cte_preamble(self, recursive): ... + def get_select_hint_text(self, byfroms): ... + def function_argspec(self, fn, **kw): ... + def visit_function(self, func, **kw): ... + def visit_table_valued_column(self, element, **kw): ... + def default_from(self): ... + def visit_join(self, join, from_linter: Any | None = ..., **kwargs): ... # type: ignore[override] + def visit_outer_join_column(self, vc, **kw): ... + def visit_sequence(self, seq, **kw): ... + def get_render_as_alias_suffix(self, alias_name_text): ... + has_out_parameters: bool + def returning_clause(self, stmt, returning_cols): ... + def translate_select_structure(self, select_stmt, **kwargs): ... + def limit_clause(self, select, **kw): ... + def visit_empty_set_expr(self, type_): ... + def for_update_clause(self, select, **kw): ... + def visit_is_distinct_from_binary(self, binary, operator, **kw): ... + def visit_is_not_distinct_from_binary(self, binary, operator, **kw): ... + def visit_regexp_match_op_binary(self, binary, operator, **kw): ... + def visit_not_regexp_match_op_binary(self, binary, operator, **kw): ... + def visit_regexp_replace_op_binary(self, binary, operator, **kw): ... + +class OracleDDLCompiler(compiler.DDLCompiler): + def define_constraint_cascades(self, constraint): ... + def visit_drop_table_comment(self, drop): ... + def visit_create_index(self, create): ... + def post_create_table(self, table): ... + def get_identity_options(self, identity_options): ... + def visit_computed_column(self, generated): ... + def visit_identity_column(self, identity, **kw): ... + +class OracleIdentifierPreparer(compiler.IdentifierPreparer): + reserved_words: Any + illegal_initial_characters: Any + def format_savepoint(self, savepoint): ... + +class OracleExecutionContext(default.DefaultExecutionContext): + def fire_sequence(self, seq, type_): ... + +class OracleDialect(default.DefaultDialect): + name: str + supports_statement_cache: bool + supports_alter: bool + supports_unicode_statements: bool + supports_unicode_binds: bool + max_identifier_length: int + supports_simple_order_by_label: bool + cte_follows_insert: bool + supports_sequences: bool + sequences_optional: bool + postfetch_lastrowid: bool + default_paramstyle: str + colspecs: Any + ischema_names: Any + requires_name_normalize: bool + supports_comments: bool + supports_default_values: bool + supports_default_metavalue: bool + supports_empty_insert: bool + supports_identity_columns: bool + statement_compiler: Any + ddl_compiler: Any + type_compiler: Any + preparer: Any + reflection_options: Any + construct_arguments: Any + use_ansi: Any + optimize_limits: Any + exclude_tablespaces: Any + def __init__( + self, + use_ansi: bool = ..., + optimize_limits: bool = ..., + use_binds_for_limits: Any | None = ..., + use_nchar_for_unicode: bool = ..., + exclude_tablespaces=..., + **kwargs, + ) -> None: ... + implicit_returning: Any + def initialize(self, connection) -> None: ... + def do_release_savepoint(self, connection, name) -> None: ... + def get_isolation_level(self, connection) -> None: ... + def get_default_isolation_level(self, dbapi_conn): ... + def set_isolation_level(self, connection, level) -> None: ... + def has_table(self, connection, table_name, schema: Any | None = ...): ... # type: ignore[override] + def has_sequence(self, connection, sequence_name, schema: Any | None = ...): ... # type: ignore[override] + def get_schema_names(self, connection, **kw): ... + def get_table_names(self, connection, schema: Any | None = ..., **kw): ... + def get_temp_table_names(self, connection, **kw): ... + def get_view_names(self, connection, schema: Any | None = ..., **kw): ... + def get_sequence_names(self, connection, schema: Any | None = ..., **kw): ... + def get_table_options(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_columns(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_table_comment( + self, connection, table_name, schema: Any | None = ..., resolve_synonyms: bool = ..., dblink: str = ..., **kw + ): ... + def get_indexes( + self, connection, table_name, schema: Any | None = ..., resolve_synonyms: bool = ..., dblink: str = ..., **kw + ): ... + def get_pk_constraint(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_foreign_keys(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_unique_constraints(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_view_definition( + self, connection, view_name, schema: Any | None = ..., resolve_synonyms: bool = ..., dblink: str = ..., **kw + ): ... + def get_check_constraints(self, connection, table_name, schema: Any | None = ..., include_all: bool = ..., **kw): ... + +class _OuterJoinColumn(ClauseElement): + __visit_name__: str + column: Any + def __init__(self, column) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi new file mode 100644 index 000000000..05f26b87b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi @@ -0,0 +1,127 @@ +from typing import Any + +import sqlalchemy.types as sqltypes + +from . import base as oracle +from .base import OracleCompiler, OracleDialect, OracleExecutionContext + +class _OracleInteger(sqltypes.Integer): + def get_dbapi_type(self, dbapi): ... + +class _OracleNumeric(sqltypes.Numeric): + is_number: bool + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype) -> None: ... + +class _OracleBinaryFloat(_OracleNumeric): + def get_dbapi_type(self, dbapi): ... + +class _OracleBINARY_FLOAT(_OracleBinaryFloat, oracle.BINARY_FLOAT): ... +class _OracleBINARY_DOUBLE(_OracleBinaryFloat, oracle.BINARY_DOUBLE): ... + +class _OracleNUMBER(_OracleNumeric): + is_number: bool + +class _OracleDate(sqltypes.Date): + def bind_processor(self, dialect) -> None: ... + def result_processor(self, dialect, coltype): ... + +class _OracleChar(sqltypes.CHAR): + def get_dbapi_type(self, dbapi): ... + +class _OracleNChar(sqltypes.NCHAR): + def get_dbapi_type(self, dbapi): ... + +class _OracleUnicodeStringNCHAR(oracle.NVARCHAR2): + def get_dbapi_type(self, dbapi): ... + +class _OracleUnicodeStringCHAR(sqltypes.Unicode): + def get_dbapi_type(self, dbapi): ... + +class _OracleUnicodeTextNCLOB(oracle.NCLOB): + def get_dbapi_type(self, dbapi): ... + +class _OracleUnicodeTextCLOB(sqltypes.UnicodeText): + def get_dbapi_type(self, dbapi): ... + +class _OracleText(sqltypes.Text): + def get_dbapi_type(self, dbapi): ... + +class _OracleLong(oracle.LONG): + def get_dbapi_type(self, dbapi): ... + +class _OracleString(sqltypes.String): ... + +class _OracleEnum(sqltypes.Enum): + def bind_processor(self, dialect): ... + +class _OracleBinary(sqltypes.LargeBinary): + def get_dbapi_type(self, dbapi): ... + def bind_processor(self, dialect) -> None: ... + def result_processor(self, dialect, coltype): ... + +class _OracleInterval(oracle.INTERVAL): + def get_dbapi_type(self, dbapi): ... + +class _OracleRaw(oracle.RAW): ... + +class _OracleRowid(oracle.ROWID): + def get_dbapi_type(self, dbapi): ... + +class OracleCompiler_cx_oracle(OracleCompiler): + def bindparam_string(self, name, **kw): ... + +class OracleExecutionContext_cx_oracle(OracleExecutionContext): + out_parameters: Any + include_set_input_sizes: Any + def pre_exec(self) -> None: ... + cursor_fetch_strategy: Any + def post_exec(self) -> None: ... + def create_cursor(self): ... + def get_out_parameter_values(self, out_param_names): ... + +class OracleDialect_cx_oracle(OracleDialect): + supports_statement_cache: bool + statement_compiler: Any + supports_sane_rowcount: bool + supports_sane_multi_rowcount: bool + supports_unicode_statements: bool + supports_unicode_binds: bool + use_setinputsizes: bool + driver: str + colspecs: Any + execute_sequence_format: Any + arraysize: Any + encoding_errors: Any + auto_convert_lobs: Any + coerce_to_unicode: Any + coerce_to_decimal: Any + cx_oracle_ver: Any + def __init__( + self, + auto_convert_lobs: bool = ..., + coerce_to_unicode: bool = ..., + coerce_to_decimal: bool = ..., + arraysize: int = ..., + encoding_errors: Any | None = ..., + threaded: Any | None = ..., + **kwargs, + ): ... + @classmethod + def dbapi(cls): ... + def initialize(self, connection) -> None: ... + def get_isolation_level(self, connection): ... + def set_isolation_level(self, connection, level) -> None: ... + def on_connect(self): ... + def create_connect_args(self, url): ... + def is_disconnect(self, e, connection, cursor): ... + def create_xid(self): ... + def do_executemany(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... + def do_begin_twophase(self, connection, xid) -> None: ... + def do_prepare_twophase(self, connection, xid) -> None: ... + def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_set_input_sizes(self, cursor, list_of_tuples, context) -> None: ... + def do_recover_twophase(self, connection) -> None: ... + +dialect = OracleDialect_cx_oracle diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/provision.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/provision.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/__init__.pyi new file mode 100644 index 000000000..67a7995dd --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/__init__.pyi @@ -0,0 +1,98 @@ +import typing + +from .array import ARRAY as ARRAY, All as All, Any as Any, array as array +from .base import ( + BIGINT as BIGINT, + BIT as BIT, + BOOLEAN as BOOLEAN, + BYTEA as BYTEA, + CHAR as CHAR, + CIDR as CIDR, + DATE as DATE, + DOUBLE_PRECISION as DOUBLE_PRECISION, + ENUM as ENUM, + FLOAT as FLOAT, + INET as INET, + INTEGER as INTEGER, + INTERVAL as INTERVAL, + MACADDR as MACADDR, + MONEY as MONEY, + NUMERIC as NUMERIC, + OID as OID, + REAL as REAL, + REGCLASS as REGCLASS, + SMALLINT as SMALLINT, + TEXT as TEXT, + TIME as TIME, + TIMESTAMP as TIMESTAMP, + TSVECTOR as TSVECTOR, + UUID as UUID, + VARCHAR as VARCHAR, + CreateEnumType as CreateEnumType, + DropEnumType as DropEnumType, +) +from .dml import Insert as Insert, insert as insert +from .ext import ExcludeConstraint as ExcludeConstraint, aggregate_order_by as aggregate_order_by, array_agg as array_agg +from .hstore import HSTORE as HSTORE, hstore as hstore +from .json import JSON as JSON, JSONB as JSONB +from .ranges import ( + DATERANGE as DATERANGE, + INT4RANGE as INT4RANGE, + INT8RANGE as INT8RANGE, + NUMRANGE as NUMRANGE, + TSRANGE as TSRANGE, + TSTZRANGE as TSTZRANGE, +) + +__all__ = ( + "INTEGER", + "BIGINT", + "SMALLINT", + "VARCHAR", + "CHAR", + "TEXT", + "NUMERIC", + "FLOAT", + "REAL", + "INET", + "CIDR", + "UUID", + "BIT", + "MACADDR", + "MONEY", + "OID", + "REGCLASS", + "DOUBLE_PRECISION", + "TIMESTAMP", + "TIME", + "DATE", + "BYTEA", + "BOOLEAN", + "INTERVAL", + "ARRAY", + "ENUM", + "dialect", + "array", + "HSTORE", + "hstore", + "INT4RANGE", + "INT8RANGE", + "NUMRANGE", + "DATERANGE", + "TSVECTOR", + "TSRANGE", + "TSTZRANGE", + "JSON", + "JSONB", + "Any", + "All", + "DropEnumType", + "CreateEnumType", + "ExcludeConstraint", + "aggregate_order_by", + "array_agg", + "insert", + "Insert", +) + +dialect: typing.Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi new file mode 100644 index 000000000..f8c96a4a5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi @@ -0,0 +1,40 @@ +from typing import Any as _Any + +import sqlalchemy.types as sqltypes + +from ...sql import expression + +def Any(other, arrexpr, operator=...): ... +def All(other, arrexpr, operator=...): ... + +class array(expression.ClauseList, expression.ColumnElement): + __visit_name__: str + stringify_dialect: str + inherit_cache: bool + type: _Any + def __init__(self, clauses, **kw) -> None: ... + def self_group(self, against: _Any | None = ...): ... + +CONTAINS: _Any +CONTAINED_BY: _Any +OVERLAP: _Any + +class ARRAY(sqltypes.ARRAY): + class Comparator(sqltypes.ARRAY.Comparator): + def contains(self, other, **kwargs): ... + def contained_by(self, other): ... + def overlap(self, other): ... + comparator_factory: _Any + item_type: _Any + as_tuple: _Any + dimensions: _Any + zero_indexes: _Any + def __init__(self, item_type, as_tuple: bool = ..., dimensions: _Any | None = ..., zero_indexes: bool = ...) -> None: ... + @property + def hashable(self): ... + @property + def python_type(self): ... + def compare_values(self, x, y): ... + def bind_expression(self, bindvalue): ... + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi new file mode 100644 index 000000000..217ab044b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi @@ -0,0 +1,199 @@ +from typing import Any + +from ...engine import AdaptedConnection +from ...sql import sqltypes +from . import json +from .base import ENUM, INTERVAL, OID, REGCLASS, UUID, PGCompiler, PGDialect, PGExecutionContext, PGIdentifierPreparer + +class AsyncpgTime(sqltypes.Time): + def get_dbapi_type(self, dbapi): ... + +class AsyncpgDate(sqltypes.Date): + def get_dbapi_type(self, dbapi): ... + +class AsyncpgDateTime(sqltypes.DateTime): + def get_dbapi_type(self, dbapi): ... + +class AsyncpgBoolean(sqltypes.Boolean): + def get_dbapi_type(self, dbapi): ... + +class AsyncPgInterval(INTERVAL): + def get_dbapi_type(self, dbapi): ... + @classmethod + def adapt_emulated_to_native(cls, interval, **kw): ... + +class AsyncPgEnum(ENUM): + def get_dbapi_type(self, dbapi): ... + +class AsyncpgInteger(sqltypes.Integer): + def get_dbapi_type(self, dbapi): ... + +class AsyncpgBigInteger(sqltypes.BigInteger): + def get_dbapi_type(self, dbapi): ... + +class AsyncpgJSON(json.JSON): + def get_dbapi_type(self, dbapi): ... + def result_processor(self, dialect, coltype) -> None: ... + +class AsyncpgJSONB(json.JSONB): + def get_dbapi_type(self, dbapi): ... + def result_processor(self, dialect, coltype) -> None: ... + +class AsyncpgJSONIndexType(sqltypes.JSON.JSONIndexType): + def get_dbapi_type(self, dbapi) -> None: ... + +class AsyncpgJSONIntIndexType(sqltypes.JSON.JSONIntIndexType): + def get_dbapi_type(self, dbapi): ... + +class AsyncpgJSONStrIndexType(sqltypes.JSON.JSONStrIndexType): + def get_dbapi_type(self, dbapi): ... + +class AsyncpgJSONPathType(json.JSONPathType): + def bind_processor(self, dialect): ... + +class AsyncpgUUID(UUID): + def get_dbapi_type(self, dbapi): ... + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +class AsyncpgNumeric(sqltypes.Numeric): + def get_dbapi_type(self, dbapi): ... + def bind_processor(self, dialect) -> None: ... + def result_processor(self, dialect, coltype): ... + +class AsyncpgFloat(AsyncpgNumeric): + def get_dbapi_type(self, dbapi): ... + +class AsyncpgREGCLASS(REGCLASS): + def get_dbapi_type(self, dbapi): ... + +class AsyncpgOID(OID): + def get_dbapi_type(self, dbapi): ... + +class PGExecutionContext_asyncpg(PGExecutionContext): + def handle_dbapi_exception(self, e) -> None: ... + exclude_set_input_sizes: Any + def pre_exec(self) -> None: ... + def create_server_side_cursor(self): ... + +class PGCompiler_asyncpg(PGCompiler): ... +class PGIdentifierPreparer_asyncpg(PGIdentifierPreparer): ... + +class AsyncAdapt_asyncpg_cursor: + server_side: bool + description: Any + arraysize: int + rowcount: int + def __init__(self, adapt_connection) -> None: ... + def close(self) -> None: ... + def execute(self, operation, parameters: Any | None = ...) -> None: ... + def executemany(self, operation, seq_of_parameters): ... + def setinputsizes(self, *inputsizes) -> None: ... + def __iter__(self): ... + def fetchone(self): ... + def fetchmany(self, size: Any | None = ...): ... + def fetchall(self): ... + +class AsyncAdapt_asyncpg_ss_cursor(AsyncAdapt_asyncpg_cursor): + server_side: bool + def __init__(self, adapt_connection) -> None: ... + def close(self) -> None: ... + def __aiter__(self): ... + async def __anext__(self) -> None: ... + def fetchone(self): ... + def fetchmany(self, size: Any | None = ...): ... + def fetchall(self): ... + def executemany(self, operation, seq_of_parameters) -> None: ... + +class AsyncAdapt_asyncpg_connection(AdaptedConnection): + await_: Any + dbapi: Any + isolation_level: str + readonly: bool + deferrable: bool + def __init__(self, dbapi, connection, prepared_statement_cache_size: int = ...) -> None: ... + @property + def autocommit(self): ... + @autocommit.setter + def autocommit(self, value) -> None: ... + def set_isolation_level(self, level) -> None: ... + def cursor(self, server_side: bool = ...): ... + def rollback(self) -> None: ... + def commit(self) -> None: ... + def close(self) -> None: ... + +class AsyncAdaptFallback_asyncpg_connection(AsyncAdapt_asyncpg_connection): + await_: Any + +class AsyncAdapt_asyncpg_dbapi: + asyncpg: Any + paramstyle: str + def __init__(self, asyncpg) -> None: ... + def connect(self, *arg, **kw): ... + class Error(Exception): ... + class Warning(Exception): ... + class InterfaceError(Error): ... + class DatabaseError(Error): ... + class InternalError(DatabaseError): ... + class OperationalError(DatabaseError): ... + class ProgrammingError(DatabaseError): ... + class IntegrityError(DatabaseError): ... + class DataError(DatabaseError): ... + class NotSupportedError(DatabaseError): ... + class InternalServerError(InternalError): ... + class InvalidCachedStatementError(NotSupportedError): + def __init__(self, message) -> None: ... + def Binary(self, value): ... + STRING: Any + TIMESTAMP: Any + TIMESTAMP_W_TZ: Any + TIME: Any + DATE: Any + INTERVAL: Any + NUMBER: Any + FLOAT: Any + BOOLEAN: Any + INTEGER: Any + BIGINTEGER: Any + BYTES: Any + DECIMAL: Any + JSON: Any + JSONB: Any + ENUM: Any + UUID: Any + BYTEA: Any + DATETIME: Any + BINARY: Any + +class PGDialect_asyncpg(PGDialect): + driver: str + supports_statement_cache: bool + supports_unicode_statements: bool + supports_server_side_cursors: bool + supports_unicode_binds: bool + default_paramstyle: str + supports_sane_multi_rowcount: bool + statement_compiler: Any + preparer: Any + use_setinputsizes: bool + use_native_uuid: bool + colspecs: Any + is_async: bool + @classmethod + def dbapi(cls): ... + def set_isolation_level(self, connection, level) -> None: ... + def set_readonly(self, connection, value) -> None: ... + def get_readonly(self, connection): ... + def set_deferrable(self, connection, value) -> None: ... + def get_deferrable(self, connection): ... + def create_connect_args(self, url): ... + @classmethod + def get_pool_class(cls, url): ... + def is_disconnect(self, e, connection, cursor): ... + def do_set_input_sizes(self, cursor, list_of_tuples, context) -> None: ... + async def setup_asyncpg_json_codec(self, conn): ... + async def setup_asyncpg_jsonb_codec(self, conn): ... + def on_connect(self): ... + def get_driver_connection(self, connection): ... + +dialect = PGDialect_asyncpg diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi new file mode 100644 index 000000000..047d14bdc --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi @@ -0,0 +1,300 @@ +from typing import Any + +from ...engine import characteristics, default, reflection +from ...schema import _CreateDropBase +from ...sql import compiler, elements, sqltypes +from ...sql.ddl import DDLBase +from ...types import ( + BIGINT as BIGINT, + BOOLEAN as BOOLEAN, + CHAR as CHAR, + DATE as DATE, + FLOAT as FLOAT, + INTEGER as INTEGER, + NUMERIC as NUMERIC, + REAL as REAL, + SMALLINT as SMALLINT, + TEXT as TEXT, + VARCHAR as VARCHAR, +) + +IDX_USING: Any +AUTOCOMMIT_REGEXP: Any +RESERVED_WORDS: Any + +class BYTEA(sqltypes.LargeBinary): + __visit_name__: str + +class DOUBLE_PRECISION(sqltypes.Float): + __visit_name__: str + +class INET(sqltypes.TypeEngine): + __visit_name__: str + +PGInet = INET + +class CIDR(sqltypes.TypeEngine): + __visit_name__: str + +PGCidr = CIDR + +class MACADDR(sqltypes.TypeEngine): + __visit_name__: str + +PGMacAddr = MACADDR + +class MONEY(sqltypes.TypeEngine): + __visit_name__: str + +class OID(sqltypes.TypeEngine): + __visit_name__: str + +class REGCLASS(sqltypes.TypeEngine): + __visit_name__: str + +class TIMESTAMP(sqltypes.TIMESTAMP): + precision: Any + def __init__(self, timezone: bool = ..., precision: Any | None = ...) -> None: ... + +class TIME(sqltypes.TIME): + precision: Any + def __init__(self, timezone: bool = ..., precision: Any | None = ...) -> None: ... + +class INTERVAL(sqltypes.NativeForEmulated, sqltypes._AbstractInterval): + __visit_name__: str + native: bool + precision: Any + fields: Any + def __init__(self, precision: Any | None = ..., fields: Any | None = ...) -> None: ... + @classmethod + def adapt_emulated_to_native(cls, interval, **kw): ... + def as_generic(self, allow_nulltype: bool = ...): ... + @property + def python_type(self): ... + def coerce_compared_value(self, op, value): ... + +PGInterval = INTERVAL + +class BIT(sqltypes.TypeEngine): + __visit_name__: str + length: Any + varying: Any + def __init__(self, length: Any | None = ..., varying: bool = ...) -> None: ... + +PGBit = BIT + +class UUID(sqltypes.TypeEngine): + __visit_name__: str + as_uuid: Any + def __init__(self, as_uuid: bool = ...) -> None: ... + def coerce_compared_value(self, op, value): ... + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +PGUuid = UUID + +class TSVECTOR(sqltypes.TypeEngine): + __visit_name__: str + +class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum): # type: ignore[misc] + native_enum: bool + create_type: Any + def __init__(self, *enums, **kw) -> None: ... + @classmethod + def adapt_emulated_to_native(cls, impl, **kw): ... + def create(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... + def drop(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... + class EnumGenerator(DDLBase): + checkfirst: Any + def __init__(self, dialect, connection, checkfirst: bool = ..., **kwargs) -> None: ... + def visit_enum(self, enum) -> None: ... + class EnumDropper(DDLBase): + checkfirst: Any + def __init__(self, dialect, connection, checkfirst: bool = ..., **kwargs) -> None: ... + def visit_enum(self, enum) -> None: ... + +class _ColonCast(elements.Cast): + __visit_name__: str + type: Any + clause: Any + typeclause: Any + def __init__(self, expression, type_) -> None: ... + +colspecs: Any +ischema_names: Any + +class PGCompiler(compiler.SQLCompiler): + def visit_colon_cast(self, element, **kw): ... + def visit_array(self, element, **kw): ... + def visit_slice(self, element, **kw): ... + def visit_json_getitem_op_binary(self, binary, operator, _cast_applied: bool = ..., **kw): ... + def visit_json_path_getitem_op_binary(self, binary, operator, _cast_applied: bool = ..., **kw): ... + def visit_getitem_binary(self, binary, operator, **kw): ... + def visit_aggregate_order_by(self, element, **kw): ... + def visit_match_op_binary(self, binary, operator, **kw): ... + def visit_ilike_op_binary(self, binary, operator, **kw): ... + def visit_not_ilike_op_binary(self, binary, operator, **kw): ... + def visit_regexp_match_op_binary(self, binary, operator, **kw): ... + def visit_not_regexp_match_op_binary(self, binary, operator, **kw): ... + def visit_regexp_replace_op_binary(self, binary, operator, **kw): ... + def visit_empty_set_expr(self, element_types): ... + def render_literal_value(self, value, type_): ... + def visit_sequence(self, seq, **kw): ... + def limit_clause(self, select, **kw): ... + def format_from_hint_text(self, sqltext, table, hint, iscrud): ... + def get_select_precolumns(self, select, **kw): ... + def for_update_clause(self, select, **kw): ... + def returning_clause(self, stmt, returning_cols): ... + def visit_substring_func(self, func, **kw): ... + def visit_on_conflict_do_nothing(self, on_conflict, **kw): ... + def visit_on_conflict_do_update(self, on_conflict, **kw): ... + def update_from_clause(self, update_stmt, from_table, extra_froms, from_hints, **kw): ... + def delete_extra_from_clause(self, delete_stmt, from_table, extra_froms, from_hints, **kw): ... + def fetch_clause(self, select, **kw): ... + +class PGDDLCompiler(compiler.DDLCompiler): + def get_column_specification(self, column, **kwargs): ... + def visit_check_constraint(self, constraint): ... + def visit_drop_table_comment(self, drop): ... + def visit_create_enum_type(self, create): ... + def visit_drop_enum_type(self, drop): ... + def visit_create_index(self, create): ... + def visit_drop_index(self, drop): ... + def visit_exclude_constraint(self, constraint, **kw): ... + def post_create_table(self, table): ... + def visit_computed_column(self, generated): ... + def visit_create_sequence(self, create, **kw): ... + +class PGTypeCompiler(compiler.GenericTypeCompiler): + def visit_TSVECTOR(self, type_, **kw): ... + def visit_INET(self, type_, **kw): ... + def visit_CIDR(self, type_, **kw): ... + def visit_MACADDR(self, type_, **kw): ... + def visit_MONEY(self, type_, **kw): ... + def visit_OID(self, type_, **kw): ... + def visit_REGCLASS(self, type_, **kw): ... + def visit_FLOAT(self, type_, **kw): ... + def visit_DOUBLE_PRECISION(self, type_, **kw): ... + def visit_BIGINT(self, type_, **kw): ... + def visit_HSTORE(self, type_, **kw): ... + def visit_JSON(self, type_, **kw): ... + def visit_JSONB(self, type_, **kw): ... + def visit_INT4RANGE(self, type_, **kw): ... + def visit_INT8RANGE(self, type_, **kw): ... + def visit_NUMRANGE(self, type_, **kw): ... + def visit_DATERANGE(self, type_, **kw): ... + def visit_TSRANGE(self, type_, **kw): ... + def visit_TSTZRANGE(self, type_, **kw): ... + def visit_datetime(self, type_, **kw): ... + def visit_enum(self, type_, **kw): ... + def visit_ENUM(self, type_, identifier_preparer: Any | None = ..., **kw): ... + def visit_TIMESTAMP(self, type_, **kw): ... + def visit_TIME(self, type_, **kw): ... + def visit_INTERVAL(self, type_, **kw): ... + def visit_BIT(self, type_, **kw): ... + def visit_UUID(self, type_, **kw): ... + def visit_large_binary(self, type_, **kw): ... + def visit_BYTEA(self, type_, **kw): ... + def visit_ARRAY(self, type_, **kw): ... + +class PGIdentifierPreparer(compiler.IdentifierPreparer): + reserved_words: Any + def format_type(self, type_, use_schema: bool = ...): ... + +class PGInspector(reflection.Inspector): + def get_table_oid(self, table_name, schema: Any | None = ...): ... + def get_enums(self, schema: Any | None = ...): ... + def get_foreign_table_names(self, schema: Any | None = ...): ... + def get_view_names(self, schema: Any | None = ..., include=...): ... + +class CreateEnumType(_CreateDropBase): + __visit_name__: str + +class DropEnumType(_CreateDropBase): + __visit_name__: str + +class PGExecutionContext(default.DefaultExecutionContext): + def fire_sequence(self, seq, type_): ... + def get_insert_default(self, column): ... + def should_autocommit_text(self, statement): ... + +class PGReadOnlyConnectionCharacteristic(characteristics.ConnectionCharacteristic): + transactional: bool + def reset_characteristic(self, dialect, dbapi_conn) -> None: ... + def set_characteristic(self, dialect, dbapi_conn, value) -> None: ... + def get_characteristic(self, dialect, dbapi_conn): ... + +class PGDeferrableConnectionCharacteristic(characteristics.ConnectionCharacteristic): + transactional: bool + def reset_characteristic(self, dialect, dbapi_conn) -> None: ... + def set_characteristic(self, dialect, dbapi_conn, value) -> None: ... + def get_characteristic(self, dialect, dbapi_conn): ... + +class PGDialect(default.DefaultDialect): + name: str + supports_statement_cache: bool + supports_alter: bool + max_identifier_length: int + supports_sane_rowcount: bool + supports_native_enum: bool + supports_native_boolean: bool + supports_smallserial: bool + supports_sequences: bool + sequences_optional: bool + preexecute_autoincrement_sequences: bool + postfetch_lastrowid: bool + supports_comments: bool + supports_default_values: bool + supports_default_metavalue: bool + supports_empty_insert: bool + supports_multivalues_insert: bool + supports_identity_columns: bool + default_paramstyle: str + ischema_names: Any + colspecs: Any + statement_compiler: Any + ddl_compiler: Any + type_compiler: Any + preparer: Any + inspector: Any + isolation_level: Any + implicit_returning: bool + full_returning: bool + connection_characteristics: Any + construct_arguments: Any + reflection_options: Any + def __init__( + self, isolation_level: Any | None = ..., json_serializer: Any | None = ..., json_deserializer: Any | None = ..., **kwargs + ) -> None: ... + def initialize(self, connection) -> None: ... + def on_connect(self): ... + def set_isolation_level(self, connection, level) -> None: ... + def get_isolation_level(self, connection): ... + def set_readonly(self, connection, value) -> None: ... + def get_readonly(self, connection) -> None: ... + def set_deferrable(self, connection, value) -> None: ... + def get_deferrable(self, connection) -> None: ... + def do_begin_twophase(self, connection, xid) -> None: ... + def do_prepare_twophase(self, connection, xid) -> None: ... + def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_recover_twophase(self, connection): ... + def has_schema(self, connection, schema): ... + def has_table(self, connection, table_name, schema: Any | None = ...): ... # type: ignore[override] + def has_sequence(self, connection, sequence_name, schema: Any | None = ...): ... # type: ignore[override] + def has_type(self, connection, type_name, schema: Any | None = ...): ... + def get_table_oid(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_schema_names(self, connection, **kw): ... + def get_table_names(self, connection, schema: Any | None = ..., **kw): ... + def get_view_names(self, connection, schema: Any | None = ..., include=..., **kw): ... + def get_sequence_names(self, connection, schema: Any | None = ..., **kw): ... + def get_view_definition(self, connection, view_name, schema: Any | None = ..., **kw): ... + def get_columns(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_foreign_keys( + self, connection, table_name, schema: Any | None = ..., postgresql_ignore_search_path: bool = ..., **kw + ): ... + def get_indexes(self, connection, table_name, schema, **kw): ... + def get_unique_constraints(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_table_comment(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_check_constraints(self, connection, table_name, schema: Any | None = ..., **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi new file mode 100644 index 000000000..cfa9b38b3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi @@ -0,0 +1,47 @@ +from typing import Any + +from ...sql.dml import Insert as StandardInsert +from ...sql.elements import ClauseElement +from ...util import memoized_property + +class Insert(StandardInsert): + stringify_dialect: str + inherit_cache: bool + @memoized_property + def excluded(self): ... + def on_conflict_do_update( + self, + constraint: Any | None = ..., + index_elements: Any | None = ..., + index_where: Any | None = ..., + set_: Any | None = ..., + where: Any | None = ..., + ) -> None: ... + def on_conflict_do_nothing( + self, constraint: Any | None = ..., index_elements: Any | None = ..., index_where: Any | None = ... + ) -> None: ... + +insert: Any + +class OnConflictClause(ClauseElement): + stringify_dialect: str + constraint_target: Any + inferred_target_elements: Any + inferred_target_whereclause: Any + def __init__(self, constraint: Any | None = ..., index_elements: Any | None = ..., index_where: Any | None = ...) -> None: ... + +class OnConflictDoNothing(OnConflictClause): + __visit_name__: str + +class OnConflictDoUpdate(OnConflictClause): + __visit_name__: str + update_values_to_set: Any + update_whereclause: Any + def __init__( + self, + constraint: Any | None = ..., + index_elements: Any | None = ..., + index_where: Any | None = ..., + set_: Any | None = ..., + where: Any | None = ..., + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ext.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ext.pyi new file mode 100644 index 000000000..b205c953c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ext.pyi @@ -0,0 +1,27 @@ +from typing import Any + +from ...sql import expression +from ...sql.schema import ColumnCollectionConstraint + +class aggregate_order_by(expression.ColumnElement): + __visit_name__: str + stringify_dialect: str + inherit_cache: bool + target: Any + type: Any + order_by: Any + def __init__(self, target, *order_by) -> None: ... + def self_group(self, against: Any | None = ...): ... + def get_children(self, **kwargs): ... + +class ExcludeConstraint(ColumnCollectionConstraint): + __visit_name__: str + where: Any + inherit_cache: bool + create_drop_stringify_dialect: str + operators: Any + using: Any + ops: Any + def __init__(self, *elements, **kw) -> None: ... + +def array_agg(*arg, **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi new file mode 100644 index 000000000..f0cb163b9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi @@ -0,0 +1,67 @@ +from typing import Any + +import sqlalchemy.types as sqltypes + +from ...sql import functions as sqlfunc + +class HSTORE(sqltypes.Indexable, sqltypes.Concatenable, sqltypes.TypeEngine): + __visit_name__: str + hashable: bool + text_type: Any + def __init__(self, text_type: Any | None = ...) -> None: ... + class Comparator(sqltypes.Indexable.Comparator, sqltypes.Concatenable.Comparator): + def has_key(self, other): ... + def has_all(self, other): ... + def has_any(self, other): ... + def contains(self, other, **kwargs): ... + def contained_by(self, other): ... + def defined(self, key): ... + def delete(self, key): ... + def slice(self, array): ... + def keys(self): ... + def vals(self): ... + def array(self): ... + def matrix(self): ... + comparator_factory: Any + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +class hstore(sqlfunc.GenericFunction): + type: Any + name: str + inherit_cache: bool + +class _HStoreDefinedFunction(sqlfunc.GenericFunction): + type: Any + name: str + inherit_cache: bool + +class _HStoreDeleteFunction(sqlfunc.GenericFunction): + type: Any + name: str + inherit_cache: bool + +class _HStoreSliceFunction(sqlfunc.GenericFunction): + type: Any + name: str + inherit_cache: bool + +class _HStoreKeysFunction(sqlfunc.GenericFunction): + type: Any + name: str + inherit_cache: bool + +class _HStoreValsFunction(sqlfunc.GenericFunction): + type: Any + name: str + inherit_cache: bool + +class _HStoreArrayFunction(sqlfunc.GenericFunction): + type: Any + name: str + inherit_cache: bool + +class _HStoreMatrixFunction(sqlfunc.GenericFunction): + type: Any + name: str + inherit_cache: bool diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi new file mode 100644 index 000000000..d298402c5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi @@ -0,0 +1,25 @@ +from typing import Any + +import sqlalchemy.types as sqltypes + +class JSONPathType(sqltypes.JSON.JSONPathType): + def bind_processor(self, dialect): ... + def literal_processor(self, dialect): ... + +class JSON(sqltypes.JSON): + astext_type: Any + def __init__(self, none_as_null: bool = ..., astext_type: Any | None = ...) -> None: ... + class Comparator(sqltypes.JSON.Comparator): + @property + def astext(self): ... + comparator_factory: Any + +class JSONB(JSON): + __visit_name__: str + class Comparator(JSON.Comparator): + def has_key(self, other): ... + def has_all(self, other): ... + def has_any(self, other): ... + def contains(self, other, **kwargs): ... + def contained_by(self, other): ... + comparator_factory: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi new file mode 100644 index 000000000..fc60c1038 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi @@ -0,0 +1,134 @@ +from typing import Any + +import sqlalchemy.types as sqltypes + +from .array import ARRAY as PGARRAY +from .base import ENUM, INTERVAL, UUID, PGCompiler, PGDialect, PGExecutionContext, PGIdentifierPreparer +from .json import JSON, JSONB, JSONPathType + +class _PGNumeric(sqltypes.Numeric): + def result_processor(self, dialect, coltype): ... + +class _PGNumericNoBind(_PGNumeric): + def bind_processor(self, dialect) -> None: ... + +class _PGJSON(JSON): + def result_processor(self, dialect, coltype) -> None: ... + def get_dbapi_type(self, dbapi): ... + +class _PGJSONB(JSONB): + def result_processor(self, dialect, coltype) -> None: ... + def get_dbapi_type(self, dbapi): ... + +class _PGJSONIndexType(sqltypes.JSON.JSONIndexType): + def get_dbapi_type(self, dbapi) -> None: ... + +class _PGJSONIntIndexType(sqltypes.JSON.JSONIntIndexType): + def get_dbapi_type(self, dbapi): ... + +class _PGJSONStrIndexType(sqltypes.JSON.JSONStrIndexType): + def get_dbapi_type(self, dbapi): ... + +class _PGJSONPathType(JSONPathType): + def get_dbapi_type(self, dbapi): ... + +class _PGUUID(UUID): + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +class _PGEnum(ENUM): + def get_dbapi_type(self, dbapi): ... + +class _PGInterval(INTERVAL): + def get_dbapi_type(self, dbapi): ... + @classmethod + def adapt_emulated_to_native(cls, interval, **kw): ... + +class _PGTimeStamp(sqltypes.DateTime): + def get_dbapi_type(self, dbapi): ... + +class _PGTime(sqltypes.Time): + def get_dbapi_type(self, dbapi): ... + +class _PGInteger(sqltypes.Integer): + def get_dbapi_type(self, dbapi): ... + +class _PGSmallInteger(sqltypes.SmallInteger): + def get_dbapi_type(self, dbapi): ... + +class _PGNullType(sqltypes.NullType): + def get_dbapi_type(self, dbapi): ... + +class _PGBigInteger(sqltypes.BigInteger): + def get_dbapi_type(self, dbapi): ... + +class _PGBoolean(sqltypes.Boolean): + def get_dbapi_type(self, dbapi): ... + +class _PGARRAY(PGARRAY): + def bind_expression(self, bindvalue): ... + +class PGExecutionContext_pg8000(PGExecutionContext): + def create_server_side_cursor(self): ... + def pre_exec(self) -> None: ... + +class ServerSideCursor: + server_side: bool + ident: Any + cursor: Any + def __init__(self, cursor, ident) -> None: ... + @property + def connection(self): ... + @property + def rowcount(self): ... + @property + def description(self): ... + def execute(self, operation, args=..., stream: Any | None = ...): ... + def executemany(self, operation, param_sets): ... + def fetchone(self): ... + def fetchmany(self, num: Any | None = ...): ... + def fetchall(self): ... + def close(self) -> None: ... + def setinputsizes(self, *sizes) -> None: ... + def setoutputsize(self, size, column: Any | None = ...) -> None: ... + +class PGCompiler_pg8000(PGCompiler): + def visit_mod_binary(self, binary, operator, **kw): ... + +class PGIdentifierPreparer_pg8000(PGIdentifierPreparer): + def __init__(self, *args, **kwargs) -> None: ... + +class PGDialect_pg8000(PGDialect): + driver: str + supports_statement_cache: bool + supports_unicode_statements: bool + supports_unicode_binds: bool + default_paramstyle: str + supports_sane_multi_rowcount: bool + statement_compiler: Any + preparer: Any + supports_server_side_cursors: bool + use_setinputsizes: bool + description_encoding: Any + colspecs: Any + client_encoding: Any + def __init__(self, client_encoding: Any | None = ..., **kwargs) -> None: ... + @classmethod + def dbapi(cls): ... + def create_connect_args(self, url): ... + def is_disconnect(self, e, connection, cursor): ... + def set_isolation_level(self, connection, level) -> None: ... + def set_readonly(self, connection, value) -> None: ... + def get_readonly(self, connection): ... + def set_deferrable(self, connection, value) -> None: ... + def get_deferrable(self, connection): ... + def set_client_encoding(self, connection, client_encoding) -> None: ... + def do_set_input_sizes(self, cursor, list_of_tuples, context) -> None: ... + def do_begin_twophase(self, connection, xid) -> None: ... + def do_prepare_twophase(self, connection, xid) -> None: ... + def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_recover_twophase(self, connection): ... + def on_connect(self): ... + +dialect = PGDialect_pg8000 diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/provision.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/provision.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi new file mode 100644 index 000000000..7a5fa9941 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi @@ -0,0 +1,95 @@ +from typing import Any + +import sqlalchemy.types as sqltypes + +from .array import ARRAY as PGARRAY +from .base import ENUM, UUID, PGCompiler, PGDialect, PGExecutionContext, PGIdentifierPreparer +from .hstore import HSTORE +from .json import JSON, JSONB + +logger: Any + +class _PGNumeric(sqltypes.Numeric): + def bind_processor(self, dialect) -> None: ... + def result_processor(self, dialect, coltype): ... + +class _PGEnum(ENUM): + def result_processor(self, dialect, coltype): ... + +class _PGHStore(HSTORE): + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +class _PGARRAY(PGARRAY): + def bind_expression(self, bindvalue): ... + +class _PGJSON(JSON): + def result_processor(self, dialect, coltype) -> None: ... + +class _PGJSONB(JSONB): + def result_processor(self, dialect, coltype) -> None: ... + +class _PGUUID(UUID): + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +class PGExecutionContext_psycopg2(PGExecutionContext): + def create_server_side_cursor(self): ... + cursor_fetch_strategy: Any + def post_exec(self) -> None: ... + +class PGCompiler_psycopg2(PGCompiler): ... +class PGIdentifierPreparer_psycopg2(PGIdentifierPreparer): ... + +EXECUTEMANY_PLAIN: Any +EXECUTEMANY_BATCH: Any +EXECUTEMANY_VALUES: Any +EXECUTEMANY_VALUES_PLUS_BATCH: Any + +class PGDialect_psycopg2(PGDialect): + driver: str + supports_statement_cache: bool + supports_unicode_statements: bool + supports_server_side_cursors: bool + default_paramstyle: str + supports_sane_multi_rowcount: bool + statement_compiler: Any + preparer: Any + psycopg2_version: Any + engine_config_types: Any + colspecs: Any + use_native_unicode: Any + use_native_hstore: Any + use_native_uuid: Any + supports_unicode_binds: Any + client_encoding: Any + executemany_mode: Any + insert_executemany_returning: bool + executemany_batch_page_size: Any + executemany_values_page_size: Any + def __init__( + self, + use_native_unicode: bool = ..., + client_encoding: Any | None = ..., + use_native_hstore: bool = ..., + use_native_uuid: bool = ..., + executemany_mode: str = ..., + executemany_batch_page_size: int = ..., + executemany_values_page_size: int = ..., + **kwargs, + ) -> None: ... + def initialize(self, connection) -> None: ... + @classmethod + def dbapi(cls): ... + def set_isolation_level(self, connection, level) -> None: ... + def set_readonly(self, connection, value) -> None: ... + def get_readonly(self, connection): ... + def set_deferrable(self, connection, value) -> None: ... + def get_deferrable(self, connection): ... + def do_ping(self, dbapi_connection): ... + def on_connect(self): ... + def do_executemany(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... + def create_connect_args(self, url): ... + def is_disconnect(self, e, connection, cursor): ... + +dialect = PGDialect_psycopg2 diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2cffi.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2cffi.pyi new file mode 100644 index 000000000..4456b3294 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2cffi.pyi @@ -0,0 +1,13 @@ +from typing import Any + +from .psycopg2 import PGDialect_psycopg2 + +class PGDialect_psycopg2cffi(PGDialect_psycopg2): + driver: str + supports_unicode_statements: bool + supports_statement_cache: bool + FEATURE_VERSION_MAP: Any + @classmethod + def dbapi(cls): ... + +dialect = PGDialect_psycopg2cffi diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pygresql.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pygresql.pyi new file mode 100644 index 000000000..a6f0d861b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pygresql.pyi @@ -0,0 +1,52 @@ +from typing import Any + +from ...types import Numeric +from .base import UUID, PGCompiler, PGDialect, PGIdentifierPreparer +from .hstore import HSTORE +from .json import JSON, JSONB + +class _PGNumeric(Numeric): + def bind_processor(self, dialect) -> None: ... + def result_processor(self, dialect, coltype): ... + +class _PGHStore(HSTORE): + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +class _PGJSON(JSON): + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +class _PGJSONB(JSONB): + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +class _PGUUID(UUID): + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +class _PGCompiler(PGCompiler): + def visit_mod_binary(self, binary, operator, **kw): ... + def post_process_text(self, text): ... + +class _PGIdentifierPreparer(PGIdentifierPreparer): ... + +class PGDialect_pygresql(PGDialect): + driver: str + supports_statement_cache: bool + statement_compiler: Any + preparer: Any + @classmethod + def dbapi(cls): ... + colspecs: Any + dbapi_version: Any + supports_unicode_statements: bool + supports_unicode_binds: bool + has_native_hstore: Any + has_native_json: Any + has_native_uuid: Any + def __init__(self, **kwargs) -> None: ... + def create_connect_args(self, url): ... + def is_disconnect(self, e, connection, cursor): ... + +dialect = PGDialect_pygresql diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pypostgresql.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pypostgresql.pyi new file mode 100644 index 000000000..1b5bed220 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pypostgresql.pyi @@ -0,0 +1,31 @@ +from typing import Any + +import sqlalchemy.types as sqltypes + +from ...util import memoized_property +from .base import PGDialect, PGExecutionContext + +class PGNumeric(sqltypes.Numeric): + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +class PGExecutionContext_pypostgresql(PGExecutionContext): ... + +class PGDialect_pypostgresql(PGDialect): + driver: str + supports_statement_cache: bool + supports_unicode_statements: bool + supports_unicode_binds: bool + description_encoding: Any + default_paramstyle: str + supports_sane_rowcount: bool + supports_sane_multi_rowcount: bool + colspecs: Any + @classmethod + def dbapi(cls): ... + @memoized_property + def dbapi_exception_translation_map(self): ... + def create_connect_args(self, url): ... + def is_disconnect(self, e, connection, cursor): ... + +dialect = PGDialect_pypostgresql diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ranges.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ranges.pyi new file mode 100644 index 000000000..351463089 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ranges.pyi @@ -0,0 +1,36 @@ +from typing import Any + +import sqlalchemy.types as sqltypes + +class RangeOperators: + class comparator_factory(sqltypes.Concatenable.Comparator): + def __ne__(self, other): ... + def contains(self, other, **kw): ... + def contained_by(self, other): ... + def overlaps(self, other): ... + def strictly_left_of(self, other): ... + __lshift__: Any + def strictly_right_of(self, other): ... + __rshift__: Any + def not_extend_right_of(self, other): ... + def not_extend_left_of(self, other): ... + def adjacent_to(self, other): ... + def __add__(self, other): ... + +class INT4RANGE(RangeOperators, sqltypes.TypeEngine): + __visit_name__: str + +class INT8RANGE(RangeOperators, sqltypes.TypeEngine): + __visit_name__: str + +class NUMRANGE(RangeOperators, sqltypes.TypeEngine): + __visit_name__: str + +class DATERANGE(RangeOperators, sqltypes.TypeEngine): + __visit_name__: str + +class TSRANGE(RangeOperators, sqltypes.TypeEngine): + __visit_name__: str + +class TSTZRANGE(RangeOperators, sqltypes.TypeEngine): + __visit_name__: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/__init__.pyi new file mode 100644 index 000000000..7dcb0cd76 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/__init__.pyi @@ -0,0 +1,45 @@ +from typing import Any + +from .base import ( + BLOB as BLOB, + BOOLEAN as BOOLEAN, + CHAR as CHAR, + DATE as DATE, + DATETIME as DATETIME, + DECIMAL as DECIMAL, + FLOAT as FLOAT, + INTEGER as INTEGER, + JSON as JSON, + NUMERIC as NUMERIC, + REAL as REAL, + SMALLINT as SMALLINT, + TEXT as TEXT, + TIME as TIME, + TIMESTAMP as TIMESTAMP, + VARCHAR as VARCHAR, +) +from .dml import Insert as Insert, insert as insert + +__all__ = ( + "BLOB", + "BOOLEAN", + "CHAR", + "DATE", + "DATETIME", + "DECIMAL", + "FLOAT", + "INTEGER", + "JSON", + "NUMERIC", + "SMALLINT", + "TEXT", + "TIME", + "TIMESTAMP", + "VARCHAR", + "REAL", + "Insert", + "insert", + "dialect", +) + +dialect: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/aiosqlite.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/aiosqlite.pyi new file mode 100644 index 000000000..dfc3247d5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/aiosqlite.pyi @@ -0,0 +1,72 @@ +from typing import Any + +from ...engine import AdaptedConnection +from .base import SQLiteExecutionContext +from .pysqlite import SQLiteDialect_pysqlite + +class AsyncAdapt_aiosqlite_cursor: + server_side: bool + await_: Any + arraysize: int + rowcount: int + description: Any + def __init__(self, adapt_connection) -> None: ... + def close(self) -> None: ... + lastrowid: int + def execute(self, operation, parameters: Any | None = ...) -> None: ... + def executemany(self, operation, seq_of_parameters) -> None: ... + def setinputsizes(self, *inputsizes) -> None: ... + def __iter__(self): ... + def fetchone(self): ... + def fetchmany(self, size: Any | None = ...): ... + def fetchall(self): ... + +class AsyncAdapt_aiosqlite_ss_cursor(AsyncAdapt_aiosqlite_cursor): + server_side: bool + def __init__(self, *arg, **kw) -> None: ... + def close(self) -> None: ... + def fetchone(self): ... + def fetchmany(self, size: Any | None = ...): ... + def fetchall(self): ... + +class AsyncAdapt_aiosqlite_connection(AdaptedConnection): + await_: Any + dbapi: Any + def __init__(self, dbapi, connection) -> None: ... + @property + def isolation_level(self): ... + @isolation_level.setter + def isolation_level(self, value) -> None: ... + def create_function(self, *args, **kw) -> None: ... + def cursor(self, server_side: bool = ...): ... + def execute(self, *args, **kw): ... + def rollback(self) -> None: ... + def commit(self) -> None: ... + def close(self) -> None: ... + +class AsyncAdaptFallback_aiosqlite_connection(AsyncAdapt_aiosqlite_connection): + await_: Any + +class AsyncAdapt_aiosqlite_dbapi: + aiosqlite: Any + sqlite: Any + paramstyle: str + def __init__(self, aiosqlite, sqlite) -> None: ... + def connect(self, *arg, **kw): ... + +class SQLiteExecutionContext_aiosqlite(SQLiteExecutionContext): + def create_server_side_cursor(self): ... + +class SQLiteDialect_aiosqlite(SQLiteDialect_pysqlite): + driver: str + supports_statement_cache: bool + is_async: bool + supports_server_side_cursors: bool + @classmethod + def dbapi(cls): ... + @classmethod + def get_pool_class(cls, url): ... + def is_disconnect(self, e, connection, cursor): ... + def get_driver_connection(self, connection): ... + +dialect = SQLiteDialect_aiosqlite diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi new file mode 100644 index 000000000..31efadb6c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi @@ -0,0 +1,142 @@ +from typing import Any + +import sqlalchemy.types as sqltypes + +from ...engine import default +from ...sql import compiler +from ...types import ( + BLOB as BLOB, + BOOLEAN as BOOLEAN, + CHAR as CHAR, + DECIMAL as DECIMAL, + FLOAT as FLOAT, + INTEGER as INTEGER, + NUMERIC as NUMERIC, + REAL as REAL, + SMALLINT as SMALLINT, + TEXT as TEXT, + TIMESTAMP as TIMESTAMP, + VARCHAR as VARCHAR, +) +from .json import JSON as JSON + +class _SQliteJson(JSON): + def result_processor(self, dialect, coltype): ... + +class _DateTimeMixin: + def __init__(self, storage_format: Any | None = ..., regexp: Any | None = ..., **kw) -> None: ... + @property + def format_is_text_affinity(self): ... + def adapt(self, cls, **kw): ... + def literal_processor(self, dialect): ... + +class DATETIME(_DateTimeMixin, sqltypes.DateTime): + def __init__(self, *args, **kwargs) -> None: ... + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +class DATE(_DateTimeMixin, sqltypes.Date): + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +class TIME(_DateTimeMixin, sqltypes.Time): + def __init__(self, *args, **kwargs) -> None: ... + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +colspecs: Any +ischema_names: Any + +class SQLiteCompiler(compiler.SQLCompiler): + extract_map: Any + def visit_now_func(self, fn, **kw): ... + def visit_localtimestamp_func(self, func, **kw): ... + def visit_true(self, expr, **kw): ... + def visit_false(self, expr, **kw): ... + def visit_char_length_func(self, fn, **kw): ... + def visit_cast(self, cast, **kwargs): ... + def visit_extract(self, extract, **kw): ... + def limit_clause(self, select, **kw): ... + def for_update_clause(self, select, **kw): ... + def visit_is_distinct_from_binary(self, binary, operator, **kw): ... + def visit_is_not_distinct_from_binary(self, binary, operator, **kw): ... + def visit_json_getitem_op_binary(self, binary, operator, **kw): ... + def visit_json_path_getitem_op_binary(self, binary, operator, **kw): ... + def visit_empty_set_op_expr(self, type_, expand_op): ... + def visit_empty_set_expr(self, element_types): ... + def visit_regexp_match_op_binary(self, binary, operator, **kw): ... + def visit_not_regexp_match_op_binary(self, binary, operator, **kw): ... + def visit_on_conflict_do_nothing(self, on_conflict, **kw): ... + def visit_on_conflict_do_update(self, on_conflict, **kw): ... + +class SQLiteDDLCompiler(compiler.DDLCompiler): + def get_column_specification(self, column, **kwargs): ... + def visit_primary_key_constraint(self, constraint): ... + def visit_unique_constraint(self, constraint): ... + def visit_check_constraint(self, constraint): ... + def visit_column_check_constraint(self, constraint): ... + def visit_foreign_key_constraint(self, constraint): ... + def define_constraint_remote_table(self, constraint, table, preparer): ... + def visit_create_index(self, create, include_schema: bool = ..., include_table_schema: bool = ...): ... # type: ignore[override] + def post_create_table(self, table): ... + +class SQLiteTypeCompiler(compiler.GenericTypeCompiler): + def visit_large_binary(self, type_, **kw): ... + def visit_DATETIME(self, type_, **kw): ... + def visit_DATE(self, type_, **kw): ... + def visit_TIME(self, type_, **kw): ... + def visit_JSON(self, type_, **kw): ... + +class SQLiteIdentifierPreparer(compiler.IdentifierPreparer): + reserved_words: Any + +class SQLiteExecutionContext(default.DefaultExecutionContext): ... + +class SQLiteDialect(default.DefaultDialect): + name: str + supports_alter: bool + supports_unicode_statements: bool + supports_unicode_binds: bool + supports_default_values: bool + supports_default_metavalue: bool + supports_empty_insert: bool + supports_cast: bool + supports_multivalues_insert: bool + tuple_in_values: bool + supports_statement_cache: bool + default_paramstyle: str + statement_compiler: Any + ddl_compiler: Any + type_compiler: Any + preparer: Any + ischema_names: Any + colspecs: Any + isolation_level: Any + construct_arguments: Any + native_datetime: Any + def __init__( + self, + isolation_level: Any | None = ..., + native_datetime: bool = ..., + json_serializer: Any | None = ..., + json_deserializer: Any | None = ..., + _json_serializer: Any | None = ..., + _json_deserializer: Any | None = ..., + **kwargs, + ) -> None: ... + def set_isolation_level(self, connection, level) -> None: ... + def get_isolation_level(self, connection): ... + def on_connect(self): ... + def get_schema_names(self, connection, **kw): ... + def get_table_names(self, connection, schema: Any | None = ..., **kw): ... + def get_temp_table_names(self, connection, **kw): ... + def get_temp_view_names(self, connection, **kw): ... + def has_table(self, connection, table_name, schema: Any | None = ...): ... # type: ignore[override] + def get_view_names(self, connection, schema: Any | None = ..., **kw): ... + def get_view_definition(self, connection, view_name, schema: Any | None = ..., **kw): ... + def get_columns(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_foreign_keys(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_unique_constraints(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_check_constraints(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_indexes(self, connection, table_name, schema: Any | None = ..., **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi new file mode 100644 index 000000000..208ceca97 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi @@ -0,0 +1,35 @@ +from typing import Any + +from ...sql.dml import Insert as StandardInsert +from ...sql.elements import ClauseElement +from ...util import memoized_property + +class Insert(StandardInsert): + stringify_dialect: str + inherit_cache: bool + @memoized_property + def excluded(self): ... + def on_conflict_do_update( + self, index_elements: Any | None = ..., index_where: Any | None = ..., set_: Any | None = ..., where: Any | None = ... + ) -> None: ... + def on_conflict_do_nothing(self, index_elements: Any | None = ..., index_where: Any | None = ...) -> None: ... + +insert: Any + +class OnConflictClause(ClauseElement): + stringify_dialect: str + constraint_target: Any + inferred_target_elements: Any + inferred_target_whereclause: Any + def __init__(self, index_elements: Any | None = ..., index_where: Any | None = ...) -> None: ... + +class OnConflictDoNothing(OnConflictClause): + __visit_name__: str + +class OnConflictDoUpdate(OnConflictClause): + __visit_name__: str + update_values_to_set: Any + update_whereclause: Any + def __init__( + self, index_elements: Any | None = ..., index_where: Any | None = ..., set_: Any | None = ..., where: Any | None = ... + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/json.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/json.pyi new file mode 100644 index 000000000..2ced3beec --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/json.pyi @@ -0,0 +1,10 @@ +from ...types import JSON as _JSON + +class JSON(_JSON): ... + +class _FormatTypeMixin: + def bind_processor(self, dialect): ... + def literal_processor(self, dialect): ... + +class JSONIndexType(_FormatTypeMixin, _JSON.JSONIndexType): ... +class JSONPathType(_FormatTypeMixin, _JSON.JSONPathType): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/provision.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/provision.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/pysqlcipher.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/pysqlcipher.pyi new file mode 100644 index 000000000..cf2d8738e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/pysqlcipher.pyi @@ -0,0 +1,16 @@ +from typing import Any + +from .pysqlite import SQLiteDialect_pysqlite + +class SQLiteDialect_pysqlcipher(SQLiteDialect_pysqlite): + driver: str + supports_statement_cache: bool + pragmas: Any + @classmethod + def dbapi(cls): ... + @classmethod + def get_pool_class(cls, url): ... + def on_connect_url(self, url): ... + def create_connect_args(self, url): ... + +dialect = SQLiteDialect_pysqlcipher diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/pysqlite.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/pysqlite.pyi new file mode 100644 index 000000000..5703abbdf --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/pysqlite.pyi @@ -0,0 +1,28 @@ +from typing import Any + +from .base import DATE, DATETIME, SQLiteDialect + +class _SQLite_pysqliteTimeStamp(DATETIME): + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +class _SQLite_pysqliteDate(DATE): + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +class SQLiteDialect_pysqlite(SQLiteDialect): + default_paramstyle: str + supports_statement_cache: bool + colspecs: Any + description_encoding: Any + driver: str + @classmethod + def dbapi(cls): ... + @classmethod + def get_pool_class(cls, url): ... + def set_isolation_level(self, connection, level): ... + def on_connect(self): ... + def create_connect_args(self, url): ... + def is_disconnect(self, e, connection, cursor): ... + +dialect = SQLiteDialect_pysqlite diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/__init__.pyi new file mode 100644 index 000000000..3b97262f2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/__init__.pyi @@ -0,0 +1,58 @@ +from typing import Any + +from .base import ( + BIGINT as BIGINT, + BINARY as BINARY, + BIT as BIT, + CHAR as CHAR, + DATE as DATE, + DATETIME as DATETIME, + FLOAT as FLOAT, + IMAGE as IMAGE, + INT as INT, + INTEGER as INTEGER, + MONEY as MONEY, + NCHAR as NCHAR, + NUMERIC as NUMERIC, + NVARCHAR as NVARCHAR, + SMALLINT as SMALLINT, + SMALLMONEY as SMALLMONEY, + TEXT as TEXT, + TIME as TIME, + TINYINT as TINYINT, + UNICHAR as UNICHAR, + UNITEXT as UNITEXT, + UNIVARCHAR as UNIVARCHAR, + VARBINARY as VARBINARY, + VARCHAR as VARCHAR, +) + +__all__ = ( + "CHAR", + "VARCHAR", + "TIME", + "NCHAR", + "NVARCHAR", + "TEXT", + "DATE", + "DATETIME", + "FLOAT", + "NUMERIC", + "BIGINT", + "INT", + "INTEGER", + "SMALLINT", + "BINARY", + "VARBINARY", + "UNITEXT", + "UNICHAR", + "UNIVARCHAR", + "IMAGE", + "BIT", + "MONEY", + "SMALLMONEY", + "TINYINT", + "dialect", +) + +dialect: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi new file mode 100644 index 000000000..40d48d646 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi @@ -0,0 +1,135 @@ +from typing import Any + +from sqlalchemy import types as sqltypes +from sqlalchemy.engine import default, reflection +from sqlalchemy.sql import compiler +from sqlalchemy.types import ( + BIGINT as BIGINT, + BINARY as BINARY, + CHAR as CHAR, + DATE as DATE, + DATETIME as DATETIME, + DECIMAL as DECIMAL, + FLOAT as FLOAT, + INT as INT, + INTEGER as INTEGER, + NCHAR as NCHAR, + NUMERIC as NUMERIC, + NVARCHAR as NVARCHAR, + REAL as REAL, + SMALLINT as SMALLINT, + TEXT as TEXT, + TIME as TIME, + TIMESTAMP as TIMESTAMP, + VARBINARY as VARBINARY, + VARCHAR as VARCHAR, + Unicode as Unicode, +) + +RESERVED_WORDS: Any + +class _SybaseUnitypeMixin: + def result_processor(self, dialect, coltype): ... + +class UNICHAR(_SybaseUnitypeMixin, sqltypes.Unicode): + __visit_name__: str + +class UNIVARCHAR(_SybaseUnitypeMixin, sqltypes.Unicode): + __visit_name__: str + +class UNITEXT(_SybaseUnitypeMixin, sqltypes.UnicodeText): + __visit_name__: str + +class TINYINT(sqltypes.Integer): + __visit_name__: str + +class BIT(sqltypes.TypeEngine): + __visit_name__: str + +class MONEY(sqltypes.TypeEngine): + __visit_name__: str + +class SMALLMONEY(sqltypes.TypeEngine): + __visit_name__: str + +class UNIQUEIDENTIFIER(sqltypes.TypeEngine): + __visit_name__: str + +class IMAGE(sqltypes.LargeBinary): + __visit_name__: str + +class SybaseTypeCompiler(compiler.GenericTypeCompiler): + def visit_large_binary(self, type_, **kw): ... + def visit_boolean(self, type_, **kw): ... + def visit_unicode(self, type_, **kw): ... + def visit_UNICHAR(self, type_, **kw): ... + def visit_UNIVARCHAR(self, type_, **kw): ... + def visit_UNITEXT(self, type_, **kw): ... + def visit_TINYINT(self, type_, **kw): ... + def visit_IMAGE(self, type_, **kw): ... + def visit_BIT(self, type_, **kw): ... + def visit_MONEY(self, type_, **kw): ... + def visit_SMALLMONEY(self, type_, **kw): ... + def visit_UNIQUEIDENTIFIER(self, type_, **kw): ... + +ischema_names: Any + +class SybaseInspector(reflection.Inspector): + def __init__(self, conn) -> None: ... + def get_table_id(self, table_name, schema: Any | None = ...): ... + +class SybaseExecutionContext(default.DefaultExecutionContext): + def set_ddl_autocommit(self, connection, value) -> None: ... + def pre_exec(self) -> None: ... + def post_exec(self) -> None: ... + def get_lastrowid(self): ... + +class SybaseSQLCompiler(compiler.SQLCompiler): + ansi_bind_rules: bool + extract_map: Any + def get_from_hint_text(self, table, text): ... + def limit_clause(self, select, **kw): ... + def visit_extract(self, extract, **kw): ... + def visit_now_func(self, fn, **kw): ... + def for_update_clause(self, select): ... + def order_by_clause(self, select, **kw): ... + def delete_table_clause(self, delete_stmt, from_table, extra_froms): ... + def delete_extra_from_clause(self, delete_stmt, from_table, extra_froms, from_hints, **kw): ... + +class SybaseDDLCompiler(compiler.DDLCompiler): + def get_column_specification(self, column, **kwargs): ... + def visit_drop_index(self, drop): ... + +class SybaseIdentifierPreparer(compiler.IdentifierPreparer): + reserved_words: Any + +class SybaseDialect(default.DefaultDialect): + name: str + supports_unicode_statements: bool + supports_sane_rowcount: bool + supports_sane_multi_rowcount: bool + supports_statement_cache: bool + supports_native_boolean: bool + supports_unicode_binds: bool + postfetch_lastrowid: bool + colspecs: Any + ischema_names: Any + type_compiler: Any + statement_compiler: Any + ddl_compiler: Any + preparer: Any + inspector: Any + construct_arguments: Any + def __init__(self, *args, **kwargs) -> None: ... + max_identifier_length: int + def initialize(self, connection) -> None: ... + def get_table_id(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_columns(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_foreign_keys(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_indexes(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Any | None = ..., **kw): ... + def get_schema_names(self, connection, **kw): ... + def get_table_names(self, connection, schema: Any | None = ..., **kw): ... + def get_view_definition(self, connection, view_name, schema: Any | None = ..., **kw): ... + def get_view_names(self, connection, schema: Any | None = ..., **kw): ... + def has_table(self, connection, table_name, schema: Any | None = ...): ... # type: ignore[override] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/mxodbc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/mxodbc.pyi new file mode 100644 index 000000000..596496ea1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/mxodbc.pyi @@ -0,0 +1,9 @@ +from sqlalchemy.connectors.mxodbc import MxODBCConnector +from sqlalchemy.dialects.sybase.base import SybaseDialect, SybaseExecutionContext + +class SybaseExecutionContext_mxodbc(SybaseExecutionContext): ... + +class SybaseDialect_mxodbc(MxODBCConnector, SybaseDialect): + supports_statement_cache: bool + +dialect = SybaseDialect_mxodbc diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pyodbc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pyodbc.pyi new file mode 100644 index 000000000..3940f1f66 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pyodbc.pyi @@ -0,0 +1,19 @@ +from typing import Any + +from sqlalchemy import types as sqltypes +from sqlalchemy.connectors.pyodbc import PyODBCConnector +from sqlalchemy.dialects.sybase.base import SybaseDialect, SybaseExecutionContext + +class _SybNumeric_pyodbc(sqltypes.Numeric): + def bind_processor(self, dialect): ... + +class SybaseExecutionContext_pyodbc(SybaseExecutionContext): + def set_ddl_autocommit(self, connection, value) -> None: ... + +class SybaseDialect_pyodbc(PyODBCConnector, SybaseDialect): + supports_statement_cache: bool + colspecs: Any + @classmethod + def dbapi(cls): ... + +dialect = SybaseDialect_pyodbc diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi new file mode 100644 index 000000000..ae8c0591f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi @@ -0,0 +1,27 @@ +from typing import Any + +from sqlalchemy import types as sqltypes +from sqlalchemy.dialects.sybase.base import SybaseDialect, SybaseExecutionContext, SybaseSQLCompiler + +class _SybNumeric(sqltypes.Numeric): + def result_processor(self, dialect, type_): ... + +class SybaseExecutionContext_pysybase(SybaseExecutionContext): + def set_ddl_autocommit(self, dbapi_connection, value) -> None: ... + def pre_exec(self) -> None: ... + +class SybaseSQLCompiler_pysybase(SybaseSQLCompiler): + def bindparam_string(self, name, **kw): ... + +class SybaseDialect_pysybase(SybaseDialect): + driver: str + statement_compiler: Any + supports_statement_cache: bool + colspecs: Any + @classmethod + def dbapi(cls): ... + def create_connect_args(self, url): ... + def do_executemany(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... + def is_disconnect(self, e, connection, cursor): ... + +dialect = SybaseDialect_pysybase diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/__init__.pyi new file mode 100644 index 000000000..48d019b65 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/__init__.pyi @@ -0,0 +1,46 @@ +from ..sql import ddl as ddl +from . import events as events, util as util +from .base import ( + Connection as Connection, + Engine as Engine, + NestedTransaction as NestedTransaction, + RootTransaction as RootTransaction, + Transaction as Transaction, + TwoPhaseTransaction as TwoPhaseTransaction, +) +from .create import create_engine as create_engine, engine_from_config as engine_from_config +from .cursor import ( + BaseCursorResult as BaseCursorResult, + BufferedColumnResultProxy as BufferedColumnResultProxy, + BufferedColumnRow as BufferedColumnRow, + BufferedRowResultProxy as BufferedRowResultProxy, + CursorResult as CursorResult, + FullyBufferedResultProxy as FullyBufferedResultProxy, + LegacyCursorResult as LegacyCursorResult, + ResultProxy as ResultProxy, +) +from .interfaces import ( + AdaptedConnection as AdaptedConnection, + Compiled as Compiled, + Connectable as Connectable, + CreateEnginePlugin as CreateEnginePlugin, + Dialect as Dialect, + ExceptionContext as ExceptionContext, + ExecutionContext as ExecutionContext, + TypeCompiler as TypeCompiler, +) +from .mock import create_mock_engine as create_mock_engine +from .reflection import Inspector as Inspector +from .result import ( + ChunkedIteratorResult as ChunkedIteratorResult, + FrozenResult as FrozenResult, + IteratorResult as IteratorResult, + MappingResult as MappingResult, + MergedResult as MergedResult, + Result as Result, + ScalarResult as ScalarResult, + result_tuple as result_tuple, +) +from .row import BaseRow as BaseRow, LegacyRow as LegacyRow, Row as Row, RowMapping as RowMapping +from .url import URL as URL, make_url as make_url +from .util import connection_memoize as connection_memoize diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi new file mode 100644 index 000000000..32640ff8c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi @@ -0,0 +1,169 @@ +from typing import Any + +from .. import log +from .interfaces import Connectable as Connectable, ExceptionContext +from .util import TransactionalContext + +class Connection(Connectable): + engine: Any + dialect: Any + should_close_with_result: bool + dispatch: Any + def __init__( + self, + engine, + connection: Any | None = ..., + close_with_result: bool = ..., + _branch_from: Any | None = ..., + _execution_options: Any | None = ..., + _dispatch: Any | None = ..., + _has_events: Any | None = ..., + _allow_revalidate: bool = ..., + ) -> None: ... + def schema_for_object(self, obj): ... + def __enter__(self): ... + def __exit__(self, type_, value, traceback) -> None: ... + def execution_options(self, **opt): ... + def get_execution_options(self): ... + @property + def closed(self): ... + @property + def invalidated(self): ... + @property + def connection(self): ... + def get_isolation_level(self): ... + @property + def default_isolation_level(self): ... + @property + def info(self): ... + def connect(self, close_with_result: bool = ...): ... # type: ignore[override] + def invalidate(self, exception: Any | None = ...): ... + def detach(self) -> None: ... + def begin(self): ... + def begin_nested(self): ... + def begin_twophase(self, xid: Any | None = ...): ... + def recover_twophase(self): ... + def rollback_prepared(self, xid, recover: bool = ...) -> None: ... + def commit_prepared(self, xid, recover: bool = ...) -> None: ... + def in_transaction(self): ... + def in_nested_transaction(self): ... + def get_transaction(self): ... + def get_nested_transaction(self): ... + def close(self) -> None: ... + def scalar(self, object_, *multiparams, **params): ... + def scalars(self, object_, *multiparams, **params): ... + def execute(self, statement, *multiparams, **params): ... + def exec_driver_sql(self, statement, parameters: Any | None = ..., execution_options: Any | None = ...): ... + def transaction(self, callable_, *args, **kwargs): ... + def run_callable(self, callable_, *args, **kwargs): ... + +class ExceptionContextImpl(ExceptionContext): + engine: Any + connection: Any + sqlalchemy_exception: Any + original_exception: Any + execution_context: Any + statement: Any + parameters: Any + is_disconnect: Any + invalidate_pool_on_disconnect: Any + def __init__( + self, + exception, + sqlalchemy_exception, + engine, + connection, + cursor, + statement, + parameters, + context, + is_disconnect, + invalidate_pool_on_disconnect, + ) -> None: ... + +class Transaction(TransactionalContext): + def __init__(self, connection) -> None: ... + @property + def is_valid(self): ... + def close(self) -> None: ... + def rollback(self) -> None: ... + def commit(self) -> None: ... + +class MarkerTransaction(Transaction): + connection: Any + def __init__(self, connection) -> None: ... + @property + def is_active(self): ... + +class RootTransaction(Transaction): + connection: Any + is_active: bool + def __init__(self, connection) -> None: ... + +class NestedTransaction(Transaction): + connection: Any + is_active: bool + def __init__(self, connection) -> None: ... + +class TwoPhaseTransaction(RootTransaction): + xid: Any + def __init__(self, connection, xid) -> None: ... + def prepare(self) -> None: ... + +class Engine(Connectable, log.Identified): + pool: Any + url: Any + dialect: Any + logging_name: Any + echo: Any + hide_parameters: Any + def __init__( + self, + pool, + dialect, + url, + logging_name: Any | None = ..., + echo: Any | None = ..., + query_cache_size: int = ..., + execution_options: Any | None = ..., + hide_parameters: bool = ..., + ) -> None: ... + @property + def engine(self): ... + def clear_compiled_cache(self) -> None: ... + def update_execution_options(self, **opt) -> None: ... + def execution_options(self, **opt): ... + def get_execution_options(self): ... + @property + def name(self): ... + @property + def driver(self): ... + def dispose(self) -> None: ... + class _trans_ctx: + conn: Any + transaction: Any + close_with_result: Any + def __init__(self, conn, transaction, close_with_result) -> None: ... + def __enter__(self): ... + def __exit__(self, type_, value, traceback) -> None: ... + def begin(self, close_with_result: bool = ...): ... + def transaction(self, callable_, *args, **kwargs): ... + def run_callable(self, callable_, *args, **kwargs): ... + def execute(self, statement, *multiparams, **params): ... + def scalar(self, statement, *multiparams, **params): ... + def connect(self, close_with_result: bool = ...): ... # type: ignore[override] + def table_names(self, schema: Any | None = ..., connection: Any | None = ...): ... + def has_table(self, table_name, schema: Any | None = ...): ... + def raw_connection(self, _connection: Any | None = ...): ... + +class OptionEngineMixin: + url: Any + dialect: Any + logging_name: Any + echo: Any + hide_parameters: Any + dispatch: Any + def __init__(self, proxied, execution_options) -> None: ... + pool: Any + +class OptionEngine(OptionEngineMixin, Engine): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/characteristics.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/characteristics.pyi new file mode 100644 index 000000000..ab5b5f63c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/characteristics.pyi @@ -0,0 +1,18 @@ +import abc + +from ..util import ABC + +class ConnectionCharacteristic(ABC, metaclass=abc.ABCMeta): + transactional: bool + @abc.abstractmethod + def reset_characteristic(self, dialect, dbapi_conn): ... + @abc.abstractmethod + def set_characteristic(self, dialect, dbapi_conn, value): ... + @abc.abstractmethod + def get_characteristic(self, dialect, dbapi_conn): ... + +class IsolationLevelCharacteristic(ConnectionCharacteristic): + transactional: bool + def reset_characteristic(self, dialect, dbapi_conn) -> None: ... + def set_characteristic(self, dialect, dbapi_conn, value) -> None: ... + def get_characteristic(self, dialect, dbapi_conn): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/create.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/create.pyi new file mode 100644 index 000000000..b3f86c1fb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/create.pyi @@ -0,0 +1,2 @@ +def create_engine(url, **kwargs): ... +def engine_from_config(configuration, prefix: str = ..., **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi new file mode 100644 index 000000000..557743fb0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi @@ -0,0 +1,128 @@ +import abc +from typing import Any + +from ..util import memoized_property +from .result import Result, ResultMetaData +from .row import LegacyRow + +MD_INDEX: int +MD_RESULT_MAP_INDEX: int +MD_OBJECTS: int +MD_LOOKUP_KEY: int +MD_RENDERED_NAME: int +MD_PROCESSOR: int +MD_UNTRANSLATED: int + +class CursorResultMetaData(ResultMetaData): + returns_rows: bool + case_sensitive: Any + def __init__(self, parent, cursor_description) -> None: ... + +class LegacyCursorResultMetaData(CursorResultMetaData): ... + +class ResultFetchStrategy: + alternate_cursor_description: Any + def soft_close(self, result, dbapi_cursor) -> None: ... + def hard_close(self, result, dbapi_cursor) -> None: ... + def yield_per(self, result, dbapi_cursor, num) -> None: ... + def fetchone(self, result, dbapi_cursor, hard_close: bool = ...) -> None: ... + def fetchmany(self, result, dbapi_cursor, size: Any | None = ...) -> None: ... + def fetchall(self, result) -> None: ... + def handle_exception(self, result, dbapi_cursor, err) -> None: ... + +class NoCursorFetchStrategy(ResultFetchStrategy): + def soft_close(self, result, dbapi_cursor) -> None: ... + def hard_close(self, result, dbapi_cursor) -> None: ... + def fetchone(self, result, dbapi_cursor, hard_close: bool = ...): ... + def fetchmany(self, result, dbapi_cursor, size: Any | None = ...): ... + def fetchall(self, result, dbapi_cursor): ... + +class NoCursorDQLFetchStrategy(NoCursorFetchStrategy): ... +class NoCursorDMLFetchStrategy(NoCursorFetchStrategy): ... + +class CursorFetchStrategy(ResultFetchStrategy): + def soft_close(self, result, dbapi_cursor) -> None: ... + def hard_close(self, result, dbapi_cursor) -> None: ... + def handle_exception(self, result, dbapi_cursor, err) -> None: ... + def yield_per(self, result, dbapi_cursor, num) -> None: ... + def fetchone(self, result, dbapi_cursor, hard_close: bool = ...): ... + def fetchmany(self, result, dbapi_cursor, size: Any | None = ...): ... + def fetchall(self, result, dbapi_cursor): ... + +class BufferedRowCursorFetchStrategy(CursorFetchStrategy): + def __init__(self, dbapi_cursor, execution_options, growth_factor: int = ..., initial_buffer: Any | None = ...) -> None: ... + @classmethod + def create(cls, result): ... + def yield_per(self, result, dbapi_cursor, num) -> None: ... + def soft_close(self, result, dbapi_cursor) -> None: ... + def hard_close(self, result, dbapi_cursor) -> None: ... + def fetchone(self, result, dbapi_cursor, hard_close: bool = ...): ... + def fetchmany(self, result, dbapi_cursor, size: Any | None = ...): ... + def fetchall(self, result, dbapi_cursor): ... + +class FullyBufferedCursorFetchStrategy(CursorFetchStrategy): + alternate_cursor_description: Any + def __init__(self, dbapi_cursor, alternate_description: Any | None = ..., initial_buffer: Any | None = ...) -> None: ... + def yield_per(self, result, dbapi_cursor, num) -> None: ... + def soft_close(self, result, dbapi_cursor) -> None: ... + def hard_close(self, result, dbapi_cursor) -> None: ... + def fetchone(self, result, dbapi_cursor, hard_close: bool = ...): ... + def fetchmany(self, result, dbapi_cursor, size: Any | None = ...): ... + def fetchall(self, result, dbapi_cursor): ... + +class _NoResultMetaData(ResultMetaData): + returns_rows: bool + @property + def keys(self) -> None: ... + +class _LegacyNoResultMetaData(_NoResultMetaData): + @property + def keys(self): ... + +class BaseCursorResult: + out_parameters: Any + closed: bool + context: Any + dialect: Any + cursor: Any + cursor_strategy: Any + connection: Any + def __init__(self, context, cursor_strategy, cursor_description): ... + @property + def inserted_primary_key_rows(self): ... + @property + def inserted_primary_key(self): ... + def last_updated_params(self): ... + def last_inserted_params(self): ... + @property + def returned_defaults_rows(self): ... + @property + def returned_defaults(self): ... + def lastrow_has_defaults(self): ... + def postfetch_cols(self): ... + def prefetch_cols(self): ... + def supports_sane_rowcount(self): ... + def supports_sane_multi_rowcount(self): ... + @memoized_property + def rowcount(self): ... + @property + def lastrowid(self): ... + @property + def returns_rows(self): ... + @property + def is_insert(self): ... + +class CursorResult(BaseCursorResult, Result): + def merge(self, *others): ... + def close(self) -> None: ... + def yield_per(self, num) -> None: ... + +class LegacyCursorResult(CursorResult): + def close(self) -> None: ... + +ResultProxy = LegacyCursorResult + +class BufferedRowResultProxy(ResultProxy): ... +class FullyBufferedResultProxy(ResultProxy): ... +class BufferedColumnRow(LegacyRow, metaclass=abc.ABCMeta): ... +class BufferedColumnResultProxy(ResultProxy): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi new file mode 100644 index 000000000..a461b5f5a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi @@ -0,0 +1,220 @@ +from typing import Any, ClassVar, Type + +from .. import types as sqltypes +from ..util import memoized_property +from . import interfaces + +AUTOCOMMIT_REGEXP: Any +SERVER_SIDE_CURSOR_RE: Any +CACHE_HIT: Any +CACHE_MISS: Any +CACHING_DISABLED: Any +NO_CACHE_KEY: Any +NO_DIALECT_SUPPORT: Any + +class DefaultDialect(interfaces.Dialect): + execution_ctx_cls: ClassVar[Type[interfaces.ExecutionContext]] + statement_compiler: Any + ddl_compiler: Any + type_compiler: Any + preparer: Any + supports_alter: bool + supports_comments: bool + inline_comments: bool + use_setinputsizes: bool + supports_statement_cache: bool + default_sequence_base: int + execute_sequence_format: Any + supports_schemas: bool + supports_views: bool + supports_sequences: bool + sequences_optional: bool + preexecute_autoincrement_sequences: bool + supports_identity_columns: bool + postfetch_lastrowid: bool + implicit_returning: bool + full_returning: bool + insert_executemany_returning: bool + cte_follows_insert: bool + supports_native_enum: bool + supports_native_boolean: bool + non_native_boolean_check_constraint: bool + supports_simple_order_by_label: bool + tuple_in_values: bool + connection_characteristics: Any + engine_config_types: Any + supports_native_decimal: bool + supports_unicode_statements: bool + supports_unicode_binds: bool + returns_unicode_strings: Any + description_encoding: Any + name: str + max_identifier_length: int + isolation_level: Any + max_index_name_length: Any + max_constraint_name_length: Any + supports_sane_rowcount: bool + supports_sane_multi_rowcount: bool + colspecs: Any + default_paramstyle: str + supports_default_values: bool + supports_default_metavalue: bool + supports_empty_insert: bool + supports_multivalues_insert: bool + supports_is_distinct_from: bool + supports_server_side_cursors: bool + server_side_cursors: bool + supports_for_update_of: bool + server_version_info: Any + default_schema_name: Any + construct_arguments: Any + requires_name_normalize: bool + reflection_options: Any + dbapi_exception_translation_map: Any + is_async: bool + CACHE_HIT: Any + CACHE_MISS: Any + CACHING_DISABLED: Any + NO_CACHE_KEY: Any + NO_DIALECT_SUPPORT: Any + convert_unicode: Any + encoding: Any + positional: bool + dbapi: Any + paramstyle: Any + identifier_preparer: Any + case_sensitive: Any + label_length: Any + compiler_linting: Any + def __init__( + self, + convert_unicode: bool = ..., + encoding: str = ..., + paramstyle: Any | None = ..., + dbapi: Any | None = ..., + implicit_returning: Any | None = ..., + case_sensitive: bool = ..., + supports_native_boolean: Any | None = ..., + max_identifier_length: Any | None = ..., + label_length: Any | None = ..., + compiler_linting=..., + server_side_cursors: bool = ..., + **kwargs, + ) -> None: ... + @property + def dialect_description(self): ... + @property + def supports_sane_rowcount_returning(self): ... + @classmethod + def get_pool_class(cls, url): ... + def get_dialect_pool_class(self, url): ... + @classmethod + def load_provisioning(cls) -> None: ... + default_isolation_level: Any + def initialize(self, connection) -> None: ... + def on_connect(self) -> None: ... + def get_default_isolation_level(self, dbapi_conn): ... + def type_descriptor(self, typeobj): ... + def has_index(self, connection, table_name, index_name, schema: Any | None = ...): ... + def validate_identifier(self, ident) -> None: ... + def connect(self, *cargs, **cparams): ... + def create_connect_args(self, url): ... + def set_engine_execution_options(self, engine, opts) -> None: ... + def set_connection_execution_options(self, connection, opts) -> None: ... + def do_begin(self, dbapi_connection) -> None: ... + def do_rollback(self, dbapi_connection) -> None: ... + def do_commit(self, dbapi_connection) -> None: ... + def do_close(self, dbapi_connection) -> None: ... + def do_ping(self, dbapi_connection): ... + def create_xid(self): ... + def do_savepoint(self, connection, name) -> None: ... + def do_rollback_to_savepoint(self, connection, name) -> None: ... + def do_release_savepoint(self, connection, name) -> None: ... + def do_executemany(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... + def do_execute(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... + def do_execute_no_params(self, cursor, statement, context: Any | None = ...) -> None: ... # type: ignore[override] + def is_disconnect(self, e, connection, cursor): ... + def reset_isolation_level(self, dbapi_conn) -> None: ... + def normalize_name(self, name): ... + def denormalize_name(self, name): ... + def get_driver_connection(self, connection): ... + +class _RendersLiteral: + def literal_processor(self, dialect): ... + +class _StrDateTime(_RendersLiteral, sqltypes.DateTime): ... +class _StrDate(_RendersLiteral, sqltypes.Date): ... +class _StrTime(_RendersLiteral, sqltypes.Time): ... + +class StrCompileDialect(DefaultDialect): + statement_compiler: Any + ddl_compiler: Any + type_compiler: Any + preparer: Any + supports_statement_cache: bool + supports_identity_columns: bool + supports_sequences: bool + sequences_optional: bool + preexecute_autoincrement_sequences: bool + implicit_returning: bool + supports_native_boolean: bool + supports_multivalues_insert: bool + supports_simple_order_by_label: bool + colspecs: Any + +class DefaultExecutionContext(interfaces.ExecutionContext): + isinsert: bool + isupdate: bool + isdelete: bool + is_crud: bool + is_text: bool + isddl: bool + executemany: bool + compiled: Any + statement: Any + result_column_struct: Any + returned_default_rows: Any + execution_options: Any + include_set_input_sizes: Any + exclude_set_input_sizes: Any + cursor_fetch_strategy: Any + cache_stats: Any + invoked_statement: Any + cache_hit: Any + @memoized_property + def identifier_preparer(self): ... + @memoized_property + def engine(self): ... + @memoized_property + def postfetch_cols(self): ... + @memoized_property + def prefetch_cols(self): ... + @memoized_property + def returning_cols(self) -> None: ... + @memoized_property + def no_parameters(self): ... + @memoized_property + def should_autocommit(self): ... + @property + def connection(self): ... + def should_autocommit_text(self, statement): ... + def create_cursor(self): ... + def create_default_cursor(self): ... + def create_server_side_cursor(self) -> None: ... + def pre_exec(self) -> None: ... + def get_out_parameter_values(self, names) -> None: ... + def post_exec(self) -> None: ... + def get_result_processor(self, type_, colname, coltype): ... + def get_lastrowid(self): ... + def handle_dbapi_exception(self, e) -> None: ... + @property + def rowcount(self): ... + def supports_sane_rowcount(self): ... + def supports_sane_multi_rowcount(self): ... + @memoized_property + def inserted_primary_key_rows(self): ... + def lastrow_has_defaults(self): ... + current_parameters: Any + def get_current_parameters(self, isolate_multiinsert_groups: bool = ...): ... + def get_insert_default(self, column): ... + def get_update_default(self, column): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/events.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/events.pyi new file mode 100644 index 000000000..7cca8b27c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/events.pyi @@ -0,0 +1,29 @@ +from .. import event as event + +class ConnectionEvents(event.Events): + def before_execute(self, conn, clauseelement, multiparams, params, execution_options) -> None: ... + def after_execute(self, conn, clauseelement, multiparams, params, execution_options, result) -> None: ... + def before_cursor_execute(self, conn, cursor, statement, parameters, context, executemany) -> None: ... + def after_cursor_execute(self, conn, cursor, statement, parameters, context, executemany) -> None: ... + def handle_error(self, exception_context) -> None: ... + def engine_connect(self, conn, branch) -> None: ... + def set_connection_execution_options(self, conn, opts) -> None: ... + def set_engine_execution_options(self, engine, opts) -> None: ... + def engine_disposed(self, engine) -> None: ... + def begin(self, conn) -> None: ... + def rollback(self, conn) -> None: ... + def commit(self, conn) -> None: ... + def savepoint(self, conn, name) -> None: ... + def rollback_savepoint(self, conn, name, context) -> None: ... + def release_savepoint(self, conn, name, context) -> None: ... + def begin_twophase(self, conn, xid) -> None: ... + def prepare_twophase(self, conn, xid) -> None: ... + def rollback_twophase(self, conn, xid, is_prepared) -> None: ... + def commit_twophase(self, conn, xid, is_prepared) -> None: ... + +class DialectEvents(event.Events): + def do_connect(self, dialect, conn_rec, cargs, cparams) -> None: ... + def do_executemany(self, cursor, statement, parameters, context) -> None: ... + def do_execute_no_params(self, cursor, statement, context) -> None: ... + def do_execute(self, cursor, statement, parameters, context) -> None: ... + def do_setinputsizes(self, inputsizes, cursor, statement, parameters, context) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi new file mode 100644 index 000000000..24c6ae829 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi @@ -0,0 +1,102 @@ +from typing import Any + +from ..sql.compiler import Compiled as Compiled, TypeCompiler as TypeCompiler + +class Dialect: + supports_statement_cache: bool + def create_connect_args(self, url) -> None: ... + @classmethod + def type_descriptor(cls, typeobj) -> None: ... + def initialize(self, connection) -> None: ... + def get_columns(self, connection, table_name, schema: Any | None = ..., **kw) -> None: ... + def get_pk_constraint(self, connection, table_name, schema: Any | None = ..., **kw) -> None: ... + def get_foreign_keys(self, connection, table_name, schema: Any | None = ..., **kw) -> None: ... + def get_table_names(self, connection, schema: Any | None = ..., **kw) -> None: ... + def get_temp_table_names(self, connection, schema: Any | None = ..., **kw) -> None: ... + def get_view_names(self, connection, schema: Any | None = ..., **kw) -> None: ... + def get_sequence_names(self, connection, schema: Any | None = ..., **kw) -> None: ... + def get_temp_view_names(self, connection, schema: Any | None = ..., **kw) -> None: ... + def get_view_definition(self, connection, view_name, schema: Any | None = ..., **kw) -> None: ... + def get_indexes(self, connection, table_name, schema: Any | None = ..., **kw) -> None: ... + def get_unique_constraints(self, connection, table_name, schema: Any | None = ..., **kw) -> None: ... + def get_check_constraints(self, connection, table_name, schema: Any | None = ..., **kw) -> None: ... + def get_table_comment(self, connection, table_name, schema: Any | None = ..., **kw) -> None: ... + def normalize_name(self, name) -> None: ... + def denormalize_name(self, name) -> None: ... + def has_table(self, connection, table_name, schema: Any | None = ..., **kw) -> None: ... + def has_index(self, connection, table_name, index_name, schema: Any | None = ...) -> None: ... + def has_sequence(self, connection, sequence_name, schema: Any | None = ..., **kw) -> None: ... + def do_begin(self, dbapi_connection) -> None: ... + def do_rollback(self, dbapi_connection) -> None: ... + def do_commit(self, dbapi_connection) -> None: ... + def do_close(self, dbapi_connection) -> None: ... + def do_set_input_sizes(self, cursor, list_of_tuples, context) -> None: ... + def create_xid(self) -> None: ... + def do_savepoint(self, connection, name) -> None: ... + def do_rollback_to_savepoint(self, connection, name) -> None: ... + def do_release_savepoint(self, connection, name) -> None: ... + def do_begin_twophase(self, connection, xid) -> None: ... + def do_prepare_twophase(self, connection, xid) -> None: ... + def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_recover_twophase(self, connection) -> None: ... + def do_executemany(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... + def do_execute(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... + def do_execute_no_params(self, cursor, statement, parameters, context: Any | None = ...) -> None: ... + def is_disconnect(self, e, connection, cursor) -> None: ... + def connect(self, *cargs, **cparams) -> None: ... + def on_connect_url(self, url): ... + def on_connect(self) -> None: ... + def reset_isolation_level(self, dbapi_conn) -> None: ... + def set_isolation_level(self, dbapi_conn, level) -> None: ... + def get_isolation_level(self, dbapi_conn) -> None: ... + def get_default_isolation_level(self, dbapi_conn) -> None: ... + @classmethod + def get_dialect_cls(cls, url): ... + @classmethod + def load_provisioning(cls) -> None: ... + @classmethod + def engine_created(cls, engine) -> None: ... + def get_driver_connection(self, connection) -> None: ... + +class CreateEnginePlugin: + url: Any + def __init__(self, url, kwargs) -> None: ... + def update_url(self, url) -> None: ... + def handle_dialect_kwargs(self, dialect_cls, dialect_args) -> None: ... + def handle_pool_kwargs(self, pool_cls, pool_args) -> None: ... + def engine_created(self, engine) -> None: ... + +class ExecutionContext: + def create_cursor(self) -> None: ... + def pre_exec(self) -> None: ... + def get_out_parameter_values(self, out_param_names) -> None: ... + def post_exec(self) -> None: ... + def get_result_cursor_strategy(self, result) -> None: ... + def handle_dbapi_exception(self, e) -> None: ... + def should_autocommit_text(self, statement) -> None: ... + def lastrow_has_defaults(self) -> None: ... + def get_rowcount(self) -> None: ... + +class Connectable: + def connect(self, **kwargs) -> None: ... + engine: Any + def execute(self, object_, *multiparams, **params) -> None: ... + def scalar(self, object_, *multiparams, **params) -> None: ... + +class ExceptionContext: + connection: Any + engine: Any + cursor: Any + statement: Any + parameters: Any + original_exception: Any + sqlalchemy_exception: Any + chained_exception: Any + execution_context: Any + is_disconnect: Any + invalidate_pool_on_disconnect: bool + +class AdaptedConnection: + @property + def driver_connection(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi new file mode 100644 index 000000000..47bb1b0fc --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi @@ -0,0 +1,18 @@ +from typing import Any + +from . import base + +class MockConnection(base.Connectable): + def __init__(self, dialect, execute) -> None: ... + engine: Any + dialect: Any + name: Any + def schema_for_object(self, obj): ... + def connect(self, **kwargs): ... + def execution_options(self, **kw): ... + def compiler(self, statement, parameters, **kwargs): ... + def create(self, entity, **kwargs) -> None: ... + def drop(self, entity, **kwargs) -> None: ... + def execute(self, object_, *multiparams, **params) -> None: ... + +def create_mock_engine(url, executor, **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/reflection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/reflection.pyi new file mode 100644 index 000000000..fcfd262c2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/reflection.pyi @@ -0,0 +1,32 @@ +from typing import Any + +def cache(fn, self, con, *args, **kw): ... + +class Inspector: + def __init__(self, bind): ... + @classmethod + def from_engine(cls, bind): ... + @property + def default_schema_name(self): ... + def get_schema_names(self): ... + def get_table_names(self, schema: Any | None = ...): ... + def has_table(self, table_name, schema: Any | None = ...): ... + def has_sequence(self, sequence_name, schema: Any | None = ...): ... + def get_sorted_table_and_fkc_names(self, schema: Any | None = ...): ... + def get_temp_table_names(self): ... + def get_temp_view_names(self): ... + def get_table_options(self, table_name, schema: Any | None = ..., **kw): ... + def get_view_names(self, schema: Any | None = ...): ... + def get_sequence_names(self, schema: Any | None = ...): ... + def get_view_definition(self, view_name, schema: Any | None = ...): ... + def get_columns(self, table_name, schema: Any | None = ..., **kw): ... + def get_pk_constraint(self, table_name, schema: Any | None = ..., **kw): ... + def get_foreign_keys(self, table_name, schema: Any | None = ..., **kw): ... + def get_indexes(self, table_name, schema: Any | None = ..., **kw): ... + def get_unique_constraints(self, table_name, schema: Any | None = ..., **kw): ... + def get_table_comment(self, table_name, schema: Any | None = ..., **kw): ... + def get_check_constraints(self, table_name, schema: Any | None = ..., **kw): ... + def reflecttable(self, *args, **kwargs): ... + def reflect_table( + self, table, include_columns, exclude_columns=..., resolve_fks: bool = ..., _extend_on: Any | None = ... + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi new file mode 100644 index 000000000..027a86dd8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi @@ -0,0 +1,117 @@ +from collections.abc import KeysView +from typing import Any + +from ..sql.base import InPlaceGenerative + +class ResultMetaData: + @property + def keys(self): ... + +class RMKeyView(KeysView[Any]): + def __init__(self, parent) -> None: ... + def __len__(self): ... + def __iter__(self): ... + def __contains__(self, item): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class SimpleResultMetaData(ResultMetaData): + def __init__( + self, + keys, + extra: Any | None = ..., + _processors: Any | None = ..., + _tuplefilter: Any | None = ..., + _translated_indexes: Any | None = ..., + _unique_filters: Any | None = ..., + ) -> None: ... + +def result_tuple(fields, extra: Any | None = ...): ... + +class ResultInternal(InPlaceGenerative): ... + +class _WithKeys: + def keys(self): ... + +class Result(_WithKeys, ResultInternal): + def __init__(self, cursor_metadata) -> None: ... + def close(self) -> None: ... + def yield_per(self, num) -> None: ... + def unique(self, strategy: Any | None = ...) -> None: ... + def columns(self, *col_expressions): ... + def scalars(self, index: int = ...): ... + def mappings(self): ... + def __iter__(self): ... + def __next__(self): ... + def partitions(self, size: Any | None = ...) -> None: ... + def fetchall(self): ... + def fetchone(self): ... + def fetchmany(self, size: Any | None = ...): ... + def all(self): ... + def first(self): ... + def one_or_none(self): ... + def scalar_one(self): ... + def scalar_one_or_none(self): ... + def one(self): ... + def scalar(self): ... + def freeze(self): ... + def merge(self, *others): ... + +class FilterResult(ResultInternal): ... + +class ScalarResult(FilterResult): + def __init__(self, real_result, index) -> None: ... + def unique(self, strategy: Any | None = ...): ... + def partitions(self, size: Any | None = ...) -> None: ... + def fetchall(self): ... + def fetchmany(self, size: Any | None = ...): ... + def all(self): ... + def __iter__(self): ... + def __next__(self): ... + def first(self): ... + def one_or_none(self): ... + def one(self): ... + +class MappingResult(_WithKeys, FilterResult): + def __init__(self, result) -> None: ... + def unique(self, strategy: Any | None = ...): ... + def columns(self, *col_expressions): ... + def partitions(self, size: Any | None = ...) -> None: ... + def fetchall(self): ... + def fetchone(self): ... + def fetchmany(self, size: Any | None = ...): ... + def all(self): ... + def __iter__(self): ... + def __next__(self): ... + def first(self): ... + def one_or_none(self): ... + def one(self): ... + +class FrozenResult: + metadata: Any + data: Any + def __init__(self, result) -> None: ... + def rewrite_rows(self): ... + def with_new_rows(self, tuple_data): ... + def __call__(self): ... + +class IteratorResult(Result): + iterator: Any + raw: Any + def __init__(self, cursor_metadata, iterator, raw: Any | None = ..., _source_supports_scalars: bool = ...) -> None: ... + +def null_result(): ... + +class ChunkedIteratorResult(IteratorResult): + chunks: Any + raw: Any + iterator: Any + dynamic_yield_per: Any + def __init__( + self, cursor_metadata, chunks, source_supports_scalars: bool = ..., raw: Any | None = ..., dynamic_yield_per: bool = ... + ) -> None: ... + def yield_per(self, num) -> None: ... + +class MergedResult(IteratorResult): + closed: bool + def __init__(self, cursor_metadata, results) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/row.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/row.pyi new file mode 100644 index 000000000..31167fca7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/row.pyi @@ -0,0 +1,55 @@ +import abc +from collections.abc import ItemsView, KeysView, Mapping, Sequence, ValuesView +from typing import Any + +from ..cresultproxy import BaseRow as BaseRow + +MD_INDEX: int + +def rowproxy_reconstructor(cls, state): ... + +KEY_INTEGER_ONLY: int +KEY_OBJECTS_ONLY: int +KEY_OBJECTS_BUT_WARN: int +KEY_OBJECTS_NO_WARN: int + +class Row(BaseRow, Sequence[Any], metaclass=abc.ABCMeta): + count: Any + index: Any + def __contains__(self, key): ... + __hash__: Any + def __lt__(self, other): ... + def __le__(self, other): ... + def __ge__(self, other): ... + def __gt__(self, other): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def keys(self): ... + +class LegacyRow(Row, metaclass=abc.ABCMeta): + def __contains__(self, key): ... + def has_key(self, key): ... + def items(self): ... + def iterkeys(self): ... + def itervalues(self): ... + def values(self): ... + +BaseRowProxy = BaseRow +RowProxy = Row + +class ROMappingView(KeysView[Any], ValuesView[Any], ItemsView[Any, Any]): + def __init__(self, mapping, items) -> None: ... + def __len__(self): ... + def __iter__(self): ... + def __contains__(self, item): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class RowMapping(BaseRow, Mapping[Any, Any]): + __getitem__: Any + def __iter__(self): ... + def __len__(self): ... + def __contains__(self, key): ... + def items(self): ... + def keys(self): ... + def values(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/strategies.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/strategies.pyi new file mode 100644 index 000000000..25239d17b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/strategies.pyi @@ -0,0 +1,4 @@ +from typing import Any + +class MockEngineStrategy: + MockConnection: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi new file mode 100644 index 000000000..3ea48464f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi @@ -0,0 +1,46 @@ +from typing import Any + +from ..util import memoized_property + +class URL: + def __new__(cls, *arg, **kw): ... + @classmethod + def create( + cls, + drivername, + username: Any | None = ..., + password: Any | None = ..., + host: Any | None = ..., + port: Any | None = ..., + database: Any | None = ..., + query=..., + ): ... + def set( + self, + drivername: Any | None = ..., + username: Any | None = ..., + password: Any | None = ..., + host: Any | None = ..., + port: Any | None = ..., + database: Any | None = ..., + query: Any | None = ..., + ): ... + def update_query_string(self, query_string, append: bool = ...): ... + def update_query_pairs(self, key_value_pairs, append: bool = ...): ... + def update_query_dict(self, query_parameters, append: bool = ...): ... + def difference_update_query(self, names): ... + @memoized_property + def normalized_query(self): ... + def __to_string__(self, hide_password: bool = ...): ... + def render_as_string(self, hide_password: bool = ...): ... + def __copy__(self): ... + def __deepcopy__(self, memo): ... + def __hash__(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def get_backend_name(self): ... + def get_driver_name(self): ... + def get_dialect(self): ... + def translate_connect_args(self, names: Any | None = ..., **kw): ... + +def make_url(name_or_url): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/util.pyi new file mode 100644 index 000000000..32aea3338 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/engine/util.pyi @@ -0,0 +1,5 @@ +def connection_memoize(key): ... + +class TransactionalContext: + def __enter__(self): ... + def __exit__(self, type_, value, traceback) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/__init__.pyi new file mode 100644 index 000000000..a0b0fcea8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/__init__.pyi @@ -0,0 +1,10 @@ +from .api import ( + CANCEL as CANCEL, + NO_RETVAL as NO_RETVAL, + contains as contains, + listen as listen, + listens_for as listens_for, + remove as remove, +) +from .attr import RefCollection as RefCollection +from .base import Events as Events, dispatcher as dispatcher diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/api.pyi new file mode 100644 index 000000000..bea12af06 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/api.pyi @@ -0,0 +1,9 @@ +from typing import Any + +CANCEL: Any +NO_RETVAL: Any + +def listen(target, identifier, fn, *args, **kw) -> None: ... +def listens_for(target, identifier, *args, **kw): ... +def remove(target, identifier, fn) -> None: ... +def contains(target, identifier, fn): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/attr.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/attr.pyi new file mode 100644 index 000000000..f0d04c802 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/attr.pyi @@ -0,0 +1,85 @@ +from typing import Any + +from .. import util + +class RefCollection(util.MemoizedSlots): + ref: Any + +class _empty_collection: + def append(self, element) -> None: ... + def extend(self, other) -> None: ... + def remove(self, element) -> None: ... + def __iter__(self): ... + def clear(self) -> None: ... + +class _ClsLevelDispatch(RefCollection): + name: Any + clsname: Any + arg_names: Any + has_kw: Any + legacy_signatures: Any + def __init__(self, parent_dispatch_cls, fn): ... + def insert(self, event_key, propagate) -> None: ... + def append(self, event_key, propagate) -> None: ... + def update_subclass(self, target) -> None: ... + def remove(self, event_key) -> None: ... + def clear(self) -> None: ... + def for_modify(self, obj): ... + +class _InstanceLevelDispatch(RefCollection): ... + +class _EmptyListener(_InstanceLevelDispatch): + propagate: Any + listeners: Any + parent: Any + parent_listeners: Any + name: Any + def __init__(self, parent, target_cls) -> None: ... + def for_modify(self, obj): ... + exec_once: Any + exec_once_unless_exception: Any + insert: Any + append: Any + remove: Any + clear: Any + def __call__(self, *args, **kw) -> None: ... + def __len__(self): ... + def __iter__(self): ... + def __bool__(self): ... + __nonzero__: Any + +class _CompoundListener(_InstanceLevelDispatch): + def exec_once(self, *args, **kw) -> None: ... + def exec_once_unless_exception(self, *args, **kw) -> None: ... + def __call__(self, *args, **kw) -> None: ... + def __len__(self): ... + def __iter__(self): ... + def __bool__(self): ... + __nonzero__: Any + +class _ListenerCollection(_CompoundListener): + parent_listeners: Any + parent: Any + name: Any + listeners: Any + propagate: Any + def __init__(self, parent, target_cls) -> None: ... + def for_modify(self, obj): ... + def insert(self, event_key, propagate) -> None: ... + def append(self, event_key, propagate) -> None: ... + def remove(self, event_key) -> None: ... + def clear(self) -> None: ... + +class _JoinedListener(_CompoundListener): + parent: Any + name: Any + local: Any + parent_listeners: Any + def __init__(self, parent, name, local) -> None: ... + @property + def listeners(self): ... + def for_modify(self, obj): ... + def insert(self, event_key, propagate) -> None: ... + def append(self, event_key, propagate) -> None: ... + def remove(self, event_key) -> None: ... + def clear(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/base.pyi new file mode 100644 index 000000000..4237aa096 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/base.pyi @@ -0,0 +1,30 @@ +from typing import Any + +class _UnpickleDispatch: + def __call__(self, _instance_cls): ... + +class _Dispatch: + def __init__(self, parent, instance_cls: Any | None = ...) -> None: ... + def __getattr__(self, name): ... + def __reduce__(self): ... + +class _EventMeta(type): + def __init__(cls, classname, bases, dict_) -> None: ... + +class Events: + dispatch: Any + +class _JoinedDispatcher: + local: Any + parent: Any + def __init__(self, local, parent) -> None: ... + def __getattr__(self, name): ... + +class dispatcher: + dispatch: Any + events: Any + def __init__(self, events) -> None: ... + def __get__(self, obj, cls): ... + +class slots_dispatcher(dispatcher): + def __get__(self, obj, cls): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/legacy.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/legacy.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/registry.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/registry.pyi new file mode 100644 index 000000000..54fcc63a9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/event/registry.pyi @@ -0,0 +1,21 @@ +from typing import Any + +class _EventKey: + target: Any + identifier: Any + fn: Any + fn_key: Any + fn_wrap: Any + dispatch_target: Any + def __init__(self, target, identifier, fn, dispatch_target, _fn_wrap: Any | None = ...) -> None: ... + def with_wrapper(self, fn_wrap): ... + def with_dispatch_target(self, dispatch_target): ... + def listen(self, *args, **kw) -> None: ... + def remove(self) -> None: ... + def contains(self): ... + def base_listen( + self, propagate: bool = ..., insert: bool = ..., named: bool = ..., retval: Any | None = ..., asyncio: bool = ... + ) -> None: ... + def append_to_list(self, owner, list_): ... + def remove_from_list(self, owner, list_) -> None: ... + def prepend_to_list(self, owner, list_): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/events.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/events.pyi new file mode 100644 index 000000000..8bbbfa58d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/events.pyi @@ -0,0 +1,4 @@ +from .engine.events import ConnectionEvents as ConnectionEvents, DialectEvents as DialectEvents +from .pool.events import PoolEvents as PoolEvents +from .sql.base import SchemaEventTarget as SchemaEventTarget +from .sql.events import DDLEvents as DDLEvents diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/exc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/exc.pyi new file mode 100644 index 000000000..5f190cbaa --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/exc.pyi @@ -0,0 +1,154 @@ +from typing import Any + +class HasDescriptionCode: + code: Any + def __init__(self, *arg, **kw) -> None: ... + +class SQLAlchemyError(HasDescriptionCode, Exception): + def __unicode__(self): ... + +class ArgumentError(SQLAlchemyError): ... + +class ObjectNotExecutableError(ArgumentError): + target: Any + def __init__(self, target) -> None: ... + def __reduce__(self): ... + +class NoSuchModuleError(ArgumentError): ... +class NoForeignKeysError(ArgumentError): ... +class AmbiguousForeignKeysError(ArgumentError): ... + +class CircularDependencyError(SQLAlchemyError): + cycles: Any + edges: Any + def __init__(self, message, cycles, edges, msg: Any | None = ..., code: Any | None = ...) -> None: ... + def __reduce__(self): ... + +class CompileError(SQLAlchemyError): ... + +class UnsupportedCompilationError(CompileError): + code: str + compiler: Any + element_type: Any + message: Any + def __init__(self, compiler, element_type, message: Any | None = ...) -> None: ... + def __reduce__(self): ... + +class IdentifierError(SQLAlchemyError): ... + +class DisconnectionError(SQLAlchemyError): + invalidate_pool: bool + +class InvalidatePoolError(DisconnectionError): + invalidate_pool: bool + +class TimeoutError(SQLAlchemyError): ... +class InvalidRequestError(SQLAlchemyError): ... +class NoInspectionAvailable(InvalidRequestError): ... +class PendingRollbackError(InvalidRequestError): ... +class ResourceClosedError(InvalidRequestError): ... +class NoSuchColumnError(InvalidRequestError, KeyError): ... +class NoResultFound(InvalidRequestError): ... +class MultipleResultsFound(InvalidRequestError): ... +class NoReferenceError(InvalidRequestError): ... + +class AwaitRequired(InvalidRequestError): + code: str + +class MissingGreenlet(InvalidRequestError): + code: str + +class NoReferencedTableError(NoReferenceError): + table_name: Any + def __init__(self, message, tname) -> None: ... + def __reduce__(self): ... + +class NoReferencedColumnError(NoReferenceError): + table_name: Any + column_name: Any + def __init__(self, message, tname, cname) -> None: ... + def __reduce__(self): ... + +class NoSuchTableError(InvalidRequestError): ... +class UnreflectableTableError(InvalidRequestError): ... +class UnboundExecutionError(InvalidRequestError): ... +class DontWrapMixin: ... + +class StatementError(SQLAlchemyError): + statement: Any + params: Any + orig: Any + ismulti: Any + hide_parameters: Any + detail: Any + def __init__( + self, message, statement, params, orig, hide_parameters: bool = ..., code: Any | None = ..., ismulti: Any | None = ... + ) -> None: ... + def add_detail(self, msg) -> None: ... + def __reduce__(self): ... + +class DBAPIError(StatementError): + code: str + @classmethod + def instance( + cls, + statement, + params, + orig, + dbapi_base_err, + hide_parameters: bool = ..., + connection_invalidated: bool = ..., + dialect: Any | None = ..., + ismulti: Any | None = ..., + ): ... + def __reduce__(self): ... + connection_invalidated: Any + def __init__( + self, + statement, + params, + orig, + hide_parameters: bool = ..., + connection_invalidated: bool = ..., + code: Any | None = ..., + ismulti: Any | None = ..., + ) -> None: ... + +class InterfaceError(DBAPIError): + code: str + +class DatabaseError(DBAPIError): + code: str + +class DataError(DatabaseError): + code: str + +class OperationalError(DatabaseError): + code: str + +class IntegrityError(DatabaseError): + code: str + +class InternalError(DatabaseError): + code: str + +class ProgrammingError(DatabaseError): + code: str + +class NotSupportedError(DatabaseError): + code: str + +class SADeprecationWarning(HasDescriptionCode, DeprecationWarning): + deprecated_since: Any + +class Base20DeprecationWarning(SADeprecationWarning): + deprecated_since: str + +class LegacyAPIWarning(Base20DeprecationWarning): ... +class RemovedIn20Warning(Base20DeprecationWarning): ... +class MovedIn20Warning(RemovedIn20Warning): ... + +class SAPendingDeprecationWarning(PendingDeprecationWarning): + deprecated_since: Any + +class SAWarning(HasDescriptionCode, RuntimeWarning): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi new file mode 100644 index 000000000..dd2e82904 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi @@ -0,0 +1,198 @@ +from typing import Any + +from ..orm import interfaces +from ..sql.operators import ColumnOperators +from ..util import memoized_property + +def association_proxy(target_collection, attr, **kw): ... + +ASSOCIATION_PROXY: Any + +class AssociationProxy(interfaces.InspectionAttrInfo): + is_attribute: bool + extension_type: Any + target_collection: Any + value_attr: Any + creator: Any + getset_factory: Any + proxy_factory: Any + proxy_bulk_set: Any + cascade_scalar_deletes: Any + key: Any + info: Any + def __init__( + self, + target_collection, + attr, + creator: Any | None = ..., + getset_factory: Any | None = ..., + proxy_factory: Any | None = ..., + proxy_bulk_set: Any | None = ..., + info: Any | None = ..., + cascade_scalar_deletes: bool = ..., + ) -> None: ... + def __get__(self, obj, class_): ... + def __set__(self, obj, values): ... + def __delete__(self, obj): ... + def for_class(self, class_, obj: Any | None = ...): ... + +class AssociationProxyInstance: + parent: Any + key: Any + owning_class: Any + target_collection: Any + collection_class: Any + target_class: Any + value_attr: Any + def __init__(self, parent, owning_class, target_class, value_attr) -> None: ... + @classmethod + def for_proxy(cls, parent, owning_class, parent_instance): ... + def __clause_element__(self) -> None: ... + @property + def remote_attr(self): ... + @property + def local_attr(self): ... + @property + def attr(self): ... + @memoized_property + def scalar(self): ... + @property + def info(self): ... + def get(self, obj): ... + def set(self, obj, values) -> None: ... + def delete(self, obj) -> None: ... + def any(self, criterion: Any | None = ..., **kwargs): ... + def has(self, criterion: Any | None = ..., **kwargs): ... + +class AmbiguousAssociationProxyInstance(AssociationProxyInstance): + def get(self, obj): ... + def __eq__(self, obj): ... + def __ne__(self, obj): ... + def any(self, criterion: Any | None = ..., **kwargs) -> None: ... + def has(self, criterion: Any | None = ..., **kwargs) -> None: ... + +class ObjectAssociationProxyInstance(AssociationProxyInstance): + def contains(self, obj): ... + def __eq__(self, obj): ... + def __ne__(self, obj): ... + +class ColumnAssociationProxyInstance(ColumnOperators, AssociationProxyInstance): + def __eq__(self, other): ... + def operate(self, op, *other, **kwargs): ... + +class _lazy_collection: + parent: Any + target: Any + def __init__(self, obj, target) -> None: ... + def __call__(self): ... + +class _AssociationCollection: + lazy_collection: Any + creator: Any + getter: Any + setter: Any + parent: Any + def __init__(self, lazy_collection, creator, getter, setter, parent) -> None: ... + col: Any + def __len__(self): ... + def __bool__(self): ... + __nonzero__: Any + +class _AssociationList(_AssociationCollection): + def __getitem__(self, index): ... + def __setitem__(self, index, value) -> None: ... + def __delitem__(self, index) -> None: ... + def __contains__(self, value): ... + def __getslice__(self, start, end): ... + def __setslice__(self, start, end, values) -> None: ... + def __delslice__(self, start, end) -> None: ... + def __iter__(self): ... + def append(self, value) -> None: ... + def count(self, value): ... + def extend(self, values) -> None: ... + def insert(self, index, value) -> None: ... + def pop(self, index: int = ...): ... + def remove(self, value) -> None: ... + def reverse(self) -> None: ... + def sort(self) -> None: ... + def clear(self) -> None: ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __lt__(self, other): ... + def __le__(self, other): ... + def __gt__(self, other): ... + def __ge__(self, other): ... + def __cmp__(self, other): ... + def __add__(self, iterable): ... + def __radd__(self, iterable): ... + def __mul__(self, n): ... + __rmul__: Any + def __iadd__(self, iterable): ... + def __imul__(self, n): ... + def index(self, item, *args): ... + def copy(self): ... + def __hash__(self): ... + +class _AssociationDict(_AssociationCollection): + def __getitem__(self, key): ... + def __setitem__(self, key, value) -> None: ... + def __delitem__(self, key) -> None: ... + def __contains__(self, key): ... + def has_key(self, key): ... + def __iter__(self): ... + def clear(self) -> None: ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __lt__(self, other): ... + def __le__(self, other): ... + def __gt__(self, other): ... + def __ge__(self, other): ... + def __cmp__(self, other): ... + def get(self, key, default: Any | None = ...): ... + def setdefault(self, key, default: Any | None = ...): ... + def keys(self): ... + def items(self): ... + def values(self): ... + def pop(self, key, default=...): ... + def popitem(self): ... + def update(self, *a, **kw) -> None: ... + def copy(self): ... + def __hash__(self): ... + +class _AssociationSet(_AssociationCollection): + def __len__(self): ... + def __bool__(self): ... + __nonzero__: Any + def __contains__(self, value): ... + def __iter__(self): ... + def add(self, value) -> None: ... + def discard(self, value) -> None: ... + def remove(self, value) -> None: ... + def pop(self): ... + def update(self, other) -> None: ... + def __ior__(self, other): ... # type: ignore[misc] + def union(self, other): ... + __or__: Any + def difference(self, other): ... + __sub__: Any + def difference_update(self, other) -> None: ... + def __isub__(self, other): ... # type: ignore[misc] + def intersection(self, other): ... + __and__: Any + def intersection_update(self, other) -> None: ... + def __iand__(self, other): ... # type: ignore[misc] + def symmetric_difference(self, other): ... + __xor__: Any + def symmetric_difference_update(self, other) -> None: ... + def __ixor__(self, other): ... # type: ignore[misc] + def issubset(self, other): ... + def issuperset(self, other): ... + def clear(self) -> None: ... + def copy(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __lt__(self, other): ... + def __le__(self, other): ... + def __gt__(self, other): ... + def __ge__(self, other): ... + def __hash__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/__init__.pyi new file mode 100644 index 000000000..e065d748f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/__init__.pyi @@ -0,0 +1,15 @@ +from .engine import ( + AsyncConnection as AsyncConnection, + AsyncEngine as AsyncEngine, + AsyncTransaction as AsyncTransaction, + create_async_engine as create_async_engine, +) +from .events import AsyncConnectionEvents as AsyncConnectionEvents, AsyncSessionEvents as AsyncSessionEvents +from .result import AsyncMappingResult as AsyncMappingResult, AsyncResult as AsyncResult, AsyncScalarResult as AsyncScalarResult +from .scoping import async_scoped_session as async_scoped_session +from .session import ( + AsyncSession as AsyncSession, + AsyncSessionTransaction as AsyncSessionTransaction, + async_object_session as async_object_session, + async_session as async_session, +) diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi new file mode 100644 index 000000000..8c8894687 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi @@ -0,0 +1,16 @@ +import abc + +class ReversibleProxy: ... + +class StartableContext(abc.ABC, metaclass=abc.ABCMeta): + @abc.abstractmethod + async def start(self, is_ctxmanager: bool = ...): ... + def __await__(self): ... + async def __aenter__(self): ... + @abc.abstractmethod + async def __aexit__(self, type_, value, traceback): ... + +class ProxyComparable(ReversibleProxy): + def __hash__(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi new file mode 100644 index 000000000..5bb62f98b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi @@ -0,0 +1,93 @@ +from typing import Any + +from .base import ProxyComparable, StartableContext + +def create_async_engine(*arg, **kw): ... + +class AsyncConnectable: ... + +class AsyncConnection(ProxyComparable, StartableContext, AsyncConnectable): + engine: Any + sync_engine: Any + sync_connection: Any + def __init__(self, async_engine, sync_connection: Any | None = ...) -> None: ... + async def start(self, is_ctxmanager: bool = ...): ... + @property + def connection(self) -> None: ... + async def get_raw_connection(self): ... + @property + def info(self): ... + def begin(self): ... + def begin_nested(self): ... + async def invalidate(self, exception: Any | None = ...): ... + async def get_isolation_level(self): ... + async def set_isolation_level(self): ... + def in_transaction(self): ... + def in_nested_transaction(self): ... + def get_transaction(self): ... + def get_nested_transaction(self): ... + async def execution_options(self, **opt): ... + async def commit(self) -> None: ... + async def rollback(self) -> None: ... + async def close(self) -> None: ... + async def exec_driver_sql(self, statement, parameters: Any | None = ..., execution_options=...): ... + async def stream(self, statement, parameters: Any | None = ..., execution_options=...): ... + async def execute(self, statement, parameters: Any | None = ..., execution_options=...): ... + async def scalar(self, statement, parameters: Any | None = ..., execution_options=...): ... + async def scalars(self, statement, parameters: Any | None = ..., execution_options=...): ... + async def stream_scalars(self, statement, parameters: Any | None = ..., execution_options=...): ... + async def run_sync(self, fn, *arg, **kw): ... + def __await__(self): ... + async def __aexit__(self, type_, value, traceback) -> None: ... + # proxied from Connection + dialect: Any + @property + def closed(self): ... + @property + def invalidated(self): ... + @property + def default_isolation_level(self): ... + +class AsyncEngine(ProxyComparable, AsyncConnectable): + class _trans_ctx(StartableContext): + conn: Any + def __init__(self, conn) -> None: ... + transaction: Any + async def start(self, is_ctxmanager: bool = ...): ... + async def __aexit__(self, type_, value, traceback) -> None: ... + sync_engine: Any + def __init__(self, sync_engine) -> None: ... + def begin(self): ... + def connect(self): ... + async def raw_connection(self): ... + def execution_options(self, **opt): ... + async def dispose(self): ... + # proxied from Engine + url: Any + pool: Any + dialect: Any + echo: Any + @property + def engine(self): ... + @property + def name(self): ... + @property + def driver(self): ... + def clear_compiled_cache(self) -> None: ... + def update_execution_options(self, **opt) -> None: ... + def get_execution_options(self): ... + +class AsyncTransaction(ProxyComparable, StartableContext): + connection: Any + sync_transaction: Any + nested: Any + def __init__(self, connection, nested: bool = ...) -> None: ... + @property + def is_valid(self): ... + @property + def is_active(self): ... + async def close(self) -> None: ... + async def rollback(self) -> None: ... + async def commit(self) -> None: ... + async def start(self, is_ctxmanager: bool = ...): ... + async def __aexit__(self, type_, value, traceback) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/events.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/events.pyi new file mode 100644 index 000000000..e9a8bf1a5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/events.pyi @@ -0,0 +1,5 @@ +from ...engine import events as engine_event +from ...orm import events as orm_event + +class AsyncConnectionEvents(engine_event.ConnectionEvents): ... +class AsyncSessionEvents(orm_event.SessionEvents): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/exc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/exc.pyi new file mode 100644 index 000000000..56f3b638a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/exc.pyi @@ -0,0 +1,5 @@ +from ...exc import InvalidRequestError + +class AsyncMethodRequired(InvalidRequestError): ... +class AsyncContextNotStarted(InvalidRequestError): ... +class AsyncContextAlreadyStarted(InvalidRequestError): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi new file mode 100644 index 000000000..c04258ab1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi @@ -0,0 +1,57 @@ +from typing import Any + +from ...engine.result import FilterResult + +class AsyncCommon(FilterResult): + async def close(self) -> None: ... + +class AsyncResult(AsyncCommon): + def __init__(self, real_result) -> None: ... + def keys(self): ... + def unique(self, strategy: Any | None = ...): ... + def columns(self, *col_expressions): ... + async def partitions(self, size: Any | None = ...) -> None: ... + async def fetchone(self): ... + async def fetchmany(self, size: Any | None = ...): ... + async def all(self): ... + def __aiter__(self): ... + async def __anext__(self): ... + async def first(self): ... + async def one_or_none(self): ... + async def scalar_one(self): ... + async def scalar_one_or_none(self): ... + async def one(self): ... + async def scalar(self): ... + async def freeze(self): ... + def merge(self, *others): ... + def scalars(self, index: int = ...): ... + def mappings(self): ... + +class AsyncScalarResult(AsyncCommon): + def __init__(self, real_result, index) -> None: ... + def unique(self, strategy: Any | None = ...): ... + async def partitions(self, size: Any | None = ...) -> None: ... + async def fetchall(self): ... + async def fetchmany(self, size: Any | None = ...): ... + async def all(self): ... + def __aiter__(self): ... + async def __anext__(self): ... + async def first(self): ... + async def one_or_none(self): ... + async def one(self): ... + +class AsyncMappingResult(AsyncCommon): + def __init__(self, result) -> None: ... + def keys(self): ... + def unique(self, strategy: Any | None = ...): ... + def columns(self, *col_expressions): ... + async def partitions(self, size: Any | None = ...) -> None: ... + async def fetchall(self): ... + async def fetchone(self): ... + async def fetchmany(self, size: Any | None = ...): ... + async def all(self): ... + def __aiter__(self): ... + async def __anext__(self): ... + async def first(self): ... + async def one_or_none(self): ... + async def one(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi new file mode 100644 index 000000000..90e44bc0d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi @@ -0,0 +1,76 @@ +from typing import Any + +from ...orm.scoping import ScopedSessionMixin +from ...util import memoized_property + +class async_scoped_session(ScopedSessionMixin): + session_factory: Any + registry: Any + def __init__(self, session_factory, scopefunc) -> None: ... + async def remove(self) -> None: ... + # proxied from Session + @classmethod + async def close_all(cls): ... + @classmethod + def identity_key(cls, *args, **kwargs): ... + @classmethod + def object_session(cls, instance): ... + bind: Any + identity_map: Any + autoflush: Any + def __contains__(self, instance): ... + def __iter__(self): ... + def add(self, instance, _warn: bool = ...) -> None: ... + def add_all(self, instances) -> None: ... + def begin(self, **kw): ... + def begin_nested(self, **kw): ... + async def close(self): ... + async def commit(self): ... + async def connection(self, **kw): ... + async def delete(self, instance): ... + async def execute( + self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw + ): ... + def expire(self, instance, attribute_names: Any | None = ...) -> None: ... + def expire_all(self) -> None: ... + def expunge(self, instance) -> None: ... + def expunge_all(self) -> None: ... + async def flush(self, objects: Any | None = ...) -> None: ... + async def get( + self, + entity, + ident, + options: Any | None = ..., + populate_existing: bool = ..., + with_for_update: Any | None = ..., + identity_token: Any | None = ..., + ): ... + def get_bind(self, mapper: Any | None = ..., clause: Any | None = ..., bind: Any | None = ..., **kw): ... + def is_modified(self, instance, include_collections: bool = ...): ... + async def merge(self, instance, load: bool = ..., options: Any | None = ...): ... + async def refresh(self, instance, attribute_names: Any | None = ..., with_for_update: Any | None = ...): ... + async def rollback(self): ... + async def scalar( + self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw + ): ... + async def scalars( + self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw + ): ... + async def stream( + self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw + ): ... + async def stream_scalars( + self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw + ): ... + @property + def dirty(self): ... + @property + def deleted(self): ... + @property + def new(self): ... + @property + def is_active(self): ... + @property + def no_autoflush(self) -> None: ... + @memoized_property + def info(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi new file mode 100644 index 000000000..94b3d1bde --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi @@ -0,0 +1,106 @@ +from typing import Any + +from ...util import memoized_property +from .base import ReversibleProxy, StartableContext + +class AsyncSession(ReversibleProxy): + dispatch: Any + bind: Any + binds: Any + sync_session_class: Any + sync_session: Any + def __init__(self, bind: Any | None = ..., binds: Any | None = ..., sync_session_class: Any | None = ..., **kw) -> None: ... + async def refresh(self, instance, attribute_names: Any | None = ..., with_for_update: Any | None = ...): ... + async def run_sync(self, fn, *arg, **kw): ... + async def execute( + self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw + ): ... + async def scalar( + self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw + ): ... + async def scalars( + self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw + ): ... + async def get( + self, + entity, + ident, + options: Any | None = ..., + populate_existing: bool = ..., + with_for_update: Any | None = ..., + identity_token: Any | None = ..., + ): ... + async def stream( + self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw + ): ... + async def stream_scalars( + self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw + ): ... + async def delete(self, instance): ... + async def merge(self, instance, load: bool = ..., options: Any | None = ...): ... + async def flush(self, objects: Any | None = ...) -> None: ... + def get_transaction(self): ... + def get_nested_transaction(self): ... + def get_bind(self, mapper: Any | None = ..., clause: Any | None = ..., bind: Any | None = ..., **kw): ... + async def connection(self, **kw): ... + def begin(self, **kw): ... + def begin_nested(self, **kw): ... + async def rollback(self): ... + async def commit(self): ... + async def close(self): ... + @classmethod + async def close_all(cls): ... + async def __aenter__(self): ... + async def __aexit__(self, type_, value, traceback) -> None: ... + # proxied from Session + identity_map: Any + autoflush: Any + @classmethod + def identity_key(cls, *args, **kwargs): ... + @classmethod + def object_session(cls, instance): ... + def __contains__(self, instance): ... + def __iter__(self): ... + def add(self, instance, _warn: bool = ...) -> None: ... + def add_all(self, instances) -> None: ... + def expire(self, instance, attribute_names: Any | None = ...) -> None: ... + def expire_all(self) -> None: ... + def expunge(self, instance) -> None: ... + def expunge_all(self) -> None: ... + def is_modified(self, instance, include_collections: bool = ...): ... + def in_transaction(self): ... + def in_nested_transaction(self): ... + @property + def no_autoflush(self) -> None: ... + @property + def is_active(self): ... + @property + def dirty(self): ... + @property + def deleted(self): ... + @property + def new(self): ... + @memoized_property + def info(self): ... + +class _AsyncSessionContextManager: + async_session: Any + def __init__(self, async_session) -> None: ... + trans: Any + async def __aenter__(self): ... + async def __aexit__(self, type_, value, traceback) -> None: ... + +class AsyncSessionTransaction(ReversibleProxy, StartableContext): + session: Any + nested: Any + sync_transaction: Any + def __init__(self, session, nested: bool = ...) -> None: ... + @property + def is_active(self): ... + async def rollback(self) -> None: ... + async def commit(self) -> None: ... + async def start(self, is_ctxmanager: bool = ...): ... + async def __aexit__(self, type_, value, traceback) -> None: ... + +def async_object_session(instance): ... +def async_session(session): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi new file mode 100644 index 000000000..13b709903 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi @@ -0,0 +1,26 @@ +from typing import Any + +def classname_for_table(base, tablename, table): ... +def name_for_scalar_relationship(base, local_cls, referred_cls, constraint): ... +def name_for_collection_relationship(base, local_cls, referred_cls, constraint): ... +def generate_relationship(base, direction, return_fn, attrname, local_cls, referred_cls, **kw): ... + +class AutomapBase: + __abstract__: bool + classes: Any + @classmethod + def prepare( + cls, + autoload_with: Any | None = ..., + engine: Any | None = ..., + reflect: bool = ..., + schema: Any | None = ..., + classname_for_table: Any | None = ..., + collection_class: Any | None = ..., + name_for_scalar_relationship: Any | None = ..., + name_for_collection_relationship: Any | None = ..., + generate_relationship: Any | None = ..., + reflection_options=..., + ) -> None: ... + +def automap_base(declarative_base: Any | None = ..., **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi new file mode 100644 index 000000000..664c226ac --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi @@ -0,0 +1,45 @@ +from typing import Any + +log: Any + +class Bakery: + cls: Any + cache: Any + def __init__(self, cls_, cache) -> None: ... + def __call__(self, initial_fn, *args): ... + +class BakedQuery: + steps: Any + def __init__(self, bakery, initial_fn, args=...) -> None: ... + @classmethod + def bakery(cls, size: int = ..., _size_alert: Any | None = ...): ... + def __iadd__(self, other): ... + def __add__(self, other): ... + def add_criteria(self, fn, *args): ... + def with_criteria(self, fn, *args): ... + def for_session(self, session): ... + def __call__(self, session): ... + def spoil(self, full: bool = ...): ... + def to_query(self, query_or_session): ... + +class Result: + bq: Any + session: Any + def __init__(self, bq, session) -> None: ... + def params(self, *args, **kw): ... + def with_post_criteria(self, fn): ... + def __iter__(self): ... + def count(self): ... + def scalar(self): ... + def first(self): ... + def one(self): ... + def one_or_none(self): ... + def all(self): ... + def get(self, ident): ... + +def bake_lazy_loaders() -> None: ... +def unbake_lazy_loaders() -> None: ... + +baked_lazyload: Any +baked_lazyload_all: Any +bakery: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/compiler.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/compiler.pyi new file mode 100644 index 000000000..cc2363f1a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/compiler.pyi @@ -0,0 +1,9 @@ +from typing import Any + +def compiles(class_, *specs): ... +def deregister(class_) -> None: ... + +class _dispatcher: + specs: Any + def __init__(self) -> None: ... + def __call__(self, element, compiler, **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/declarative/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/declarative/__init__.pyi new file mode 100644 index 000000000..488bd549d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/declarative/__init__.pyi @@ -0,0 +1,25 @@ +from ...orm.decl_api import DeclarativeMeta as DeclarativeMeta, declared_attr as declared_attr +from .extensions import ( + AbstractConcreteBase as AbstractConcreteBase, + ConcreteBase as ConcreteBase, + DeferredReflection as DeferredReflection, + instrument_declarative as instrument_declarative, +) + +__all__ = [ + "declarative_base", + "synonym_for", + "has_inherited_table", + "instrument_declarative", + "declared_attr", + "as_declarative", + "ConcreteBase", + "AbstractConcreteBase", + "DeclarativeMeta", + "DeferredReflection", +] + +def declarative_base(*arg, **kw): ... +def as_declarative(*arg, **kw): ... +def has_inherited_table(*arg, **kw): ... +def synonym_for(*arg, **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/declarative/extensions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/declarative/extensions.pyi new file mode 100644 index 000000000..c4fbf0ff5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/declarative/extensions.pyi @@ -0,0 +1,14 @@ +def instrument_declarative(cls, cls_registry, metadata) -> None: ... + +class ConcreteBase: + @classmethod + def __declare_first__(cls) -> None: ... + +class AbstractConcreteBase(ConcreteBase): + __no_table__: bool + @classmethod + def __declare_first__(cls) -> None: ... + +class DeferredReflection: + @classmethod + def prepare(cls, engine) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/horizontal_shard.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/horizontal_shard.pyi new file mode 100644 index 000000000..0ccd17ef2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/horizontal_shard.pyi @@ -0,0 +1,23 @@ +from typing import Any + +from ..orm.query import Query +from ..orm.session import Session + +class ShardedQuery(Query): + id_chooser: Any + query_chooser: Any + execute_chooser: Any + def __init__(self, *args, **kwargs) -> None: ... + def set_shard(self, shard_id): ... + +class ShardedSession(Session): + shard_chooser: Any + id_chooser: Any + execute_chooser: Any + query_chooser: Any + def __init__( + self, shard_chooser, id_chooser, execute_chooser: Any | None = ..., shards: Any | None = ..., query_cls=..., **kwargs + ): ... + def connection_callable(self, mapper: Any | None = ..., instance: Any | None = ..., shard_id: Any | None = ..., **kwargs): ... + def get_bind(self, mapper: Any | None = ..., shard_id: Any | None = ..., instance: Any | None = ..., clause: Any | None = ..., **kw): ... # type: ignore[override] + def bind_shard(self, shard_id, bind) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi new file mode 100644 index 000000000..84cc1f5b4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi @@ -0,0 +1,67 @@ +from typing import Any + +from ..orm import interfaces + +HYBRID_METHOD: Any +HYBRID_PROPERTY: Any + +class hybrid_method(interfaces.InspectionAttrInfo): + is_attribute: bool + extension_type: Any + func: Any + def __init__(self, func, expr: Any | None = ...) -> None: ... + def __get__(self, instance, owner): ... + expr: Any + def expression(self, expr): ... + +class hybrid_property(interfaces.InspectionAttrInfo): + is_attribute: bool + extension_type: Any + fget: Any + fset: Any + fdel: Any + expr: Any + custom_comparator: Any + update_expr: Any + def __init__( + self, + fget, + fset: Any | None = ..., + fdel: Any | None = ..., + expr: Any | None = ..., + custom_comparator: Any | None = ..., + update_expr: Any | None = ..., + ) -> None: ... + def __get__(self, instance, owner): ... + def __set__(self, instance, value) -> None: ... + def __delete__(self, instance) -> None: ... + @property + def overrides(self): ... + def getter(self, fget): ... + def setter(self, fset): ... + def deleter(self, fdel): ... + def expression(self, expr): ... + def comparator(self, comparator): ... + def update_expression(self, meth): ... + +class Comparator(interfaces.PropComparator): + property: Any + expression: Any + def __init__(self, expression) -> None: ... + def __clause_element__(self): ... + def adapt_to_entity(self, adapt_to_entity): ... + +_property = property + +class ExprComparator(Comparator): + cls: Any + expression: Any + hybrid: Any + def __init__(self, cls, expression, hybrid) -> None: ... + def __getattr__(self, key): ... + @_property + def info(self): ... + @_property + def property(self): ... + def operate(self, op, *other, **kwargs): ... + def reverse_operate(self, op, other, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi new file mode 100644 index 000000000..0150ec714 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi @@ -0,0 +1,15 @@ +from typing import Any + +from ..ext.hybrid import hybrid_property + +class index_property(hybrid_property): + attr_name: Any + index: Any + default: Any + datatype: Any + onebased: Any + def __init__(self, attr_name, index, default=..., datatype: Any | None = ..., mutable: bool = ..., onebased: bool = ...): ... + def fget(self, instance): ... + def fset(self, instance, value) -> None: ... + def fdel(self, instance) -> None: ... + def expr(self, model): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/instrumentation.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/instrumentation.pyi new file mode 100644 index 000000000..6420c913f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/instrumentation.pyi @@ -0,0 +1,54 @@ +from typing import Any + +from ..orm.instrumentation import ClassManager, InstrumentationFactory + +INSTRUMENTATION_MANAGER: str + +def find_native_user_instrumentation_hook(cls): ... + +instrumentation_finders: Any + +class ExtendedInstrumentationRegistry(InstrumentationFactory): + def unregister(self, class_) -> None: ... + def manager_of_class(self, cls): ... + def state_of(self, instance): ... + def dict_of(self, instance): ... + +class InstrumentationManager: + def __init__(self, class_) -> None: ... + def manage(self, class_, manager) -> None: ... + def unregister(self, class_, manager) -> None: ... + def manager_getter(self, class_): ... + def instrument_attribute(self, class_, key, inst) -> None: ... + def post_configure_attribute(self, class_, key, inst) -> None: ... + def install_descriptor(self, class_, key, inst) -> None: ... + def uninstall_descriptor(self, class_, key) -> None: ... + def install_member(self, class_, key, implementation) -> None: ... + def uninstall_member(self, class_, key) -> None: ... + def instrument_collection_class(self, class_, key, collection_class): ... + def get_instance_dict(self, class_, instance): ... + def initialize_instance_dict(self, class_, instance) -> None: ... + def install_state(self, class_, instance, state) -> None: ... + def remove_state(self, class_, instance) -> None: ... + def state_getter(self, class_): ... + def dict_getter(self, class_): ... + +class _ClassInstrumentationAdapter(ClassManager): + def __init__(self, class_, override) -> None: ... + def manage(self) -> None: ... + def unregister(self) -> None: ... + def manager_getter(self): ... + def instrument_attribute(self, key, inst, propagated: bool = ...) -> None: ... + def post_configure_attribute(self, key) -> None: ... + def install_descriptor(self, key, inst) -> None: ... + def uninstall_descriptor(self, key) -> None: ... + def install_member(self, key, implementation) -> None: ... + def uninstall_member(self, key) -> None: ... + def instrument_collection_class(self, key, collection_class): ... + def initialize_collection(self, key, state, factory): ... + def new_instance(self, state: Any | None = ...): ... + def setup_instance(self, instance, state: Any | None = ...): ... + def teardown_instance(self, instance) -> None: ... + def has_state(self, instance): ... + def state_getter(self): ... + def dict_getter(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mutable.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mutable.pyi new file mode 100644 index 000000000..c1e4be44b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mutable.pyi @@ -0,0 +1,64 @@ +from typing import Any + +class MutableBase: + @classmethod + def coerce(cls, key, value) -> None: ... + +class Mutable(MutableBase): + def changed(self) -> None: ... + @classmethod + def associate_with_attribute(cls, attribute) -> None: ... + @classmethod + def associate_with(cls, sqltype) -> None: ... + @classmethod + def as_mutable(cls, sqltype): ... + +class MutableComposite(MutableBase): + def changed(self) -> None: ... + +class MutableDict(Mutable, dict[Any, Any]): + def __setitem__(self, key, value) -> None: ... + def setdefault(self, key, value): ... + def __delitem__(self, key) -> None: ... + def update(self, *a, **kw) -> None: ... + def pop(self, *arg): ... + def popitem(self): ... + def clear(self) -> None: ... + @classmethod + def coerce(cls, key, value): ... + +class MutableList(Mutable, list[Any]): + def __reduce_ex__(self, proto): ... + def __setitem__(self, index, value) -> None: ... + def __setslice__(self, start, end, value) -> None: ... + def __delitem__(self, index) -> None: ... + def __delslice__(self, start, end) -> None: ... + def pop(self, *arg): ... + def append(self, x) -> None: ... + def extend(self, x) -> None: ... + def __iadd__(self, x): ... # type: ignore[misc] + def insert(self, i, x) -> None: ... + def remove(self, i) -> None: ... + def clear(self) -> None: ... + def sort(self, **kw) -> None: ... + def reverse(self) -> None: ... + @classmethod + def coerce(cls, index, value): ... + +class MutableSet(Mutable, set[Any]): + def update(self, *arg) -> None: ... + def intersection_update(self, *arg) -> None: ... + def difference_update(self, *arg) -> None: ... + def symmetric_difference_update(self, *arg) -> None: ... + def __ior__(self, other): ... # type: ignore[misc] + def __iand__(self, other): ... # type: ignore[misc] + def __ixor__(self, other): ... # type: ignore[misc] + def __isub__(self, other): ... # type: ignore[misc] + def add(self, elem) -> None: ... + def remove(self, elem) -> None: ... + def discard(self, elem) -> None: ... + def pop(self, *arg): ... + def clear(self) -> None: ... + @classmethod + def coerce(cls, index, value): ... + def __reduce_ex__(self, proto): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/apply.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/apply.pyi new file mode 100644 index 000000000..44aacc72f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/apply.pyi @@ -0,0 +1,26 @@ +from typing import Any + +from . import util + +AssignmentStmt = Any # from mypy.nodes +NameExpr = Any # from mypy.nodes +StrExpr = Any # from mypy.nodes +SemanticAnalyzerPluginInterface = Any # from mypy.plugin +ProperType = Any # from mypy.types + +def apply_mypy_mapped_attr( + cls, api: SemanticAnalyzerPluginInterface, item: NameExpr | StrExpr, attributes: list[util.SQLAlchemyAttribute] +) -> None: ... +def re_apply_declarative_assignments( + cls, api: SemanticAnalyzerPluginInterface, attributes: list[util.SQLAlchemyAttribute] +) -> None: ... +def apply_type_to_mapped_statement( + api: SemanticAnalyzerPluginInterface, + stmt: AssignmentStmt, + lvalue: NameExpr, + left_hand_explicit_type: ProperType | None, + python_type_for_type: ProperType | None, +) -> None: ... +def add_additional_orm_attributes( + cls, api: SemanticAnalyzerPluginInterface, attributes: list[util.SQLAlchemyAttribute] +) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/decl_class.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/decl_class.pyi new file mode 100644 index 000000000..0a417cb58 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/decl_class.pyi @@ -0,0 +1,9 @@ +from typing import Any + +from . import util + +SemanticAnalyzerPluginInterface = Any # from mypy.plugin + +def scan_declarative_assignments_and_apply_types( + cls, api: SemanticAnalyzerPluginInterface, is_mixin_scan: bool = ... +) -> list[util.SQLAlchemyAttribute] | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/infer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/infer.pyi new file mode 100644 index 000000000..7faabc366 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/infer.pyi @@ -0,0 +1,25 @@ +from collections.abc import Sequence +from typing import Any + +AssignmentStmt = Any # from mypy.nodes +Expression = Any # from mypy.nodes +RefExpr = Any # from mypy.nodes +TypeInfo = Any # from mypy.nodes +Var = Any # from mypy.nodes +StrExpr = Any # from mypy.nodes +SemanticAnalyzerPluginInterface = Any # from mypy.plugin +ProperType = Any # from mypy.types + +def infer_type_from_right_hand_nameexpr( + api: SemanticAnalyzerPluginInterface, + stmt: AssignmentStmt, + node: Var, + left_hand_explicit_type: ProperType | None, + infer_from_right_side: RefExpr, +) -> ProperType | None: ... +def infer_type_from_left_hand_type_only( + api: SemanticAnalyzerPluginInterface, node: Var, left_hand_explicit_type: ProperType | None +) -> ProperType | None: ... +def extract_python_type_from_typeengine( + api: SemanticAnalyzerPluginInterface, node: TypeInfo, type_args: Sequence[Expression] +) -> ProperType: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/names.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/names.pyi new file mode 100644 index 000000000..f3c4b45c4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/names.pyi @@ -0,0 +1,38 @@ +from typing import Any + +from ...util import symbol + +ClassDef = Any # from mypy.nodes +Expression = Any # from mypy.nodes +MemberExpr = Any # from mypy.nodes +NameExpr = Any # from mypy.nodes +SymbolNode = Any # from mypy.nodes +TypeInfo = Any # from mypy.nodes +StrExpr = Any # from mypy.nodes +SemanticAnalyzerPluginInterface = Any # from mypy.plugin +UnboundType = Any # from mypy.types + +COLUMN: symbol +RELATIONSHIP: symbol +REGISTRY: symbol +COLUMN_PROPERTY: symbol +TYPEENGINE: symbol +MAPPED: symbol +DECLARATIVE_BASE: symbol +DECLARATIVE_META: symbol +MAPPED_DECORATOR: symbol +SYNONYM_PROPERTY: symbol +COMPOSITE_PROPERTY: symbol +DECLARED_ATTR: symbol +MAPPER_PROPERTY: symbol +AS_DECLARATIVE: symbol +AS_DECLARATIVE_BASE: symbol +DECLARATIVE_MIXIN: symbol +QUERY_EXPRESSION: symbol + +def has_base_type_id(info: TypeInfo, type_id: int) -> bool: ... +def mro_has_id(mro: list[TypeInfo], type_id: int) -> bool: ... +def type_id_for_unbound_type(type_: UnboundType, cls: ClassDef, api: SemanticAnalyzerPluginInterface) -> int | None: ... +def type_id_for_callee(callee: Expression) -> int | None: ... +def type_id_for_named_node(node: NameExpr | MemberExpr | SymbolNode) -> int | None: ... +def type_id_for_fullname(fullname: str) -> int | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/plugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/plugin.pyi new file mode 100644 index 000000000..f89006949 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/plugin.pyi @@ -0,0 +1,20 @@ +from collections.abc import Callable +from typing import Any, Type as TypingType + +MypyFile = Any # from mypy.nodes +AttributeContext = Any # from mypy.plugin +ClassDefContext = Any # from mypy.plugin +DynamicClassDefContext = Any # from mypy.plugin +Plugin = Any # from mypy.plugin +Type = Any # from mypy.types + +class SQLAlchemyPlugin(Plugin): + def get_dynamic_class_hook(self, fullname: str) -> Callable[[DynamicClassDefContext], None] | None: ... + def get_customize_class_mro_hook(self, fullname: str) -> Callable[[ClassDefContext], None] | None: ... + def get_class_decorator_hook(self, fullname: str) -> Callable[[ClassDefContext], None] | None: ... + def get_metaclass_hook(self, fullname: str) -> Callable[[ClassDefContext], None] | None: ... + def get_base_class_hook(self, fullname: str) -> Callable[[ClassDefContext], None] | None: ... + def get_attribute_hook(self, fullname: str) -> Callable[[AttributeContext], Type] | None: ... + def get_additional_deps(self, file: MypyFile) -> list[tuple[int, str, int]]: ... + +def plugin(version: str) -> TypingType[SQLAlchemyPlugin]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/util.pyi new file mode 100644 index 000000000..13a6f7e9c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/mypy/util.pyi @@ -0,0 +1,49 @@ +from collections.abc import Iterable, Iterator +from typing import Any, Type as TypingType, TypeVar, overload + +CallExpr = Any # from mypy.nodes +Context = Any # from mypy.nodes +Expression = Any # from mypy.nodes +JsonDict = Any # from mypy.nodes +NameExpr = Any # from mypy.nodes +Statement = Any # from mypy.nodes +TypeInfo = Any # from mypy.nodes +AttributeContext = Any # from mypy.plugin +ClassDefContext = Any # from mypy.plugin +DynamicClassDefContext = Any # from mypy.plugin +SemanticAnalyzerPluginInterface = Any # from mypy.plugin +Type = Any # from mypy.types + +_TArgType = TypeVar("_TArgType", bound=CallExpr | NameExpr) + +class SQLAlchemyAttribute: + name: Any + line: Any + column: Any + type: Any + info: Any + def __init__(self, name: str, line: int, column: int, typ: Type | None, info: TypeInfo) -> None: ... + def serialize(self) -> JsonDict: ... + def expand_typevar_from_subtype(self, sub_type: TypeInfo) -> None: ... + @classmethod + def deserialize(cls, info: TypeInfo, data: JsonDict, api: SemanticAnalyzerPluginInterface) -> SQLAlchemyAttribute: ... + +def name_is_dunder(name): ... +def establish_as_sqlalchemy(info: TypeInfo) -> None: ... +def set_is_base(info: TypeInfo) -> None: ... +def get_is_base(info: TypeInfo) -> bool: ... +def has_declarative_base(info: TypeInfo) -> bool: ... +def set_has_table(info: TypeInfo) -> None: ... +def get_has_table(info: TypeInfo) -> bool: ... +def get_mapped_attributes(info: TypeInfo, api: SemanticAnalyzerPluginInterface) -> list[SQLAlchemyAttribute] | None: ... +def set_mapped_attributes(info: TypeInfo, attributes: list[SQLAlchemyAttribute]) -> None: ... +def fail(api: SemanticAnalyzerPluginInterface, msg: str, ctx: Context) -> None: ... +def add_global(ctx: ClassDefContext | DynamicClassDefContext, module: str, symbol_name: str, asname: str) -> None: ... +@overload +def get_callexpr_kwarg(callexpr: CallExpr, name: str, *, expr_types: None = ...) -> CallExpr | NameExpr | None: ... +@overload +def get_callexpr_kwarg(callexpr: CallExpr, name: str, *, expr_types: tuple[TypingType[_TArgType], ...]) -> _TArgType | None: ... +def flatten_typechecking(stmts: Iterable[Statement]) -> Iterator[Statement]: ... +def unbound_to_instance(api: SemanticAnalyzerPluginInterface, typ: Type) -> Type: ... +def info_for_cls(cls, api: SemanticAnalyzerPluginInterface) -> TypeInfo | None: ... +def expr_to_mapped_constructor(expr: Expression) -> CallExpr: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/orderinglist.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/orderinglist.pyi new file mode 100644 index 000000000..a4fe8305f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/orderinglist.pyi @@ -0,0 +1,21 @@ +from typing import Any + +def ordering_list(attr, count_from: Any | None = ..., **kw): ... + +class OrderingList(list[Any]): + ordering_attr: Any + ordering_func: Any + reorder_on_append: Any + def __init__( + self, ordering_attr: Any | None = ..., ordering_func: Any | None = ..., reorder_on_append: bool = ... + ) -> None: ... + def reorder(self) -> None: ... + def append(self, entity) -> None: ... + def insert(self, index, entity) -> None: ... + def remove(self, entity) -> None: ... + def pop(self, index: int = ...): ... # type: ignore[override] + def __setitem__(self, index, entity) -> None: ... + def __delitem__(self, index) -> None: ... + def __setslice__(self, start, end, values) -> None: ... + def __delslice__(self, start, end) -> None: ... + def __reduce__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/serializer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/serializer.pyi new file mode 100644 index 000000000..d4a4a2cad --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/ext/serializer.pyi @@ -0,0 +1,6 @@ +from typing import Any + +def Serializer(*args, **kw): ... +def Deserializer(file, metadata: Any | None = ..., scoped_session: Any | None = ..., engine: Any | None = ...): ... +def dumps(obj, protocol=...): ... +def loads(data, metadata: Any | None = ..., scoped_session: Any | None = ..., engine: Any | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/future/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/future/__init__.pyi new file mode 100644 index 000000000..00f3a300b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/future/__init__.pyi @@ -0,0 +1,5 @@ +from typing import Any + +from .engine import Connection as Connection, Engine as Engine, create_engine as create_engine + +select: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/future/engine.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/future/engine.pyi new file mode 100644 index 000000000..1af2b62ea --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/future/engine.pyi @@ -0,0 +1,29 @@ +from typing import Any + +from ..engine import Connection as _LegacyConnection, Engine as _LegacyEngine +from ..engine.base import OptionEngineMixin + +NO_OPTIONS: Any + +def create_engine(*arg, **kw): ... + +class Connection(_LegacyConnection): + def begin(self): ... + def begin_nested(self): ... + def commit(self) -> None: ... + def rollback(self) -> None: ... + def close(self) -> None: ... + def execute(self, statement, parameters: Any | None = ..., execution_options: Any | None = ...): ... # type: ignore[override] + def scalar(self, statement, parameters: Any | None = ..., execution_options: Any | None = ...): ... # type: ignore[override] + +class Engine(_LegacyEngine): + transaction: Any + run_callable: Any + execute: Any + scalar: Any + table_names: Any + has_table: Any + def begin(self) -> None: ... # type: ignore[override] + def connect(self): ... + +class OptionEngine(OptionEngineMixin, Engine): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/future/orm/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/future/orm/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/inspection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/inspection.pyi new file mode 100644 index 000000000..d758818c5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/inspection.pyi @@ -0,0 +1 @@ +def inspect(subject, raiseerr: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/log.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/log.pyi new file mode 100644 index 000000000..515fd8601 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/log.pyi @@ -0,0 +1,30 @@ +from typing import Any + +rootlogger: Any + +def class_logger(cls): ... + +class Identified: + logging_name: Any + +class InstanceLogger: + echo: Any + logger: Any + def __init__(self, echo, name) -> None: ... + def debug(self, msg, *args, **kwargs) -> None: ... + def info(self, msg, *args, **kwargs) -> None: ... + def warning(self, msg, *args, **kwargs) -> None: ... + warn: Any + def error(self, msg, *args, **kwargs) -> None: ... + def exception(self, msg, *args, **kwargs) -> None: ... + def critical(self, msg, *args, **kwargs) -> None: ... + def log(self, level, msg, *args, **kwargs) -> None: ... + def isEnabledFor(self, level): ... + def getEffectiveLevel(self): ... + +def instance_logger(instance, echoflag: Any | None = ...) -> None: ... + +class echo_property: + __doc__: str + def __get__(self, instance, owner): ... + def __set__(self, instance, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi new file mode 100644 index 000000000..e4b08eeb9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi @@ -0,0 +1,125 @@ +from typing import Any + +from ..util.langhelpers import public_factory as public_factory +from . import exc as exc, strategy_options as strategy_options +from .attributes import ( + AttributeEvent as AttributeEvent, + InstrumentedAttribute as InstrumentedAttribute, + Mapped as Mapped, + QueryableAttribute as QueryableAttribute, +) +from .context import QueryContext as QueryContext +from .decl_api import ( + DeclarativeMeta as DeclarativeMeta, + as_declarative as as_declarative, + declarative_base as declarative_base, + declarative_mixin as declarative_mixin, + declared_attr as declared_attr, + has_inherited_table as has_inherited_table, + registry as registry, + synonym_for as synonym_for, +) +from .descriptor_props import CompositeProperty as CompositeProperty, SynonymProperty as SynonymProperty +from .dynamic import AppenderQuery as AppenderQuery +from .events import ( + AttributeEvents as AttributeEvents, + InstanceEvents as InstanceEvents, + InstrumentationEvents as InstrumentationEvents, + MapperEvents as MapperEvents, + QueryEvents as QueryEvents, + SessionEvents as SessionEvents, +) +from .identity import IdentityMap as IdentityMap +from .instrumentation import ClassManager as ClassManager +from .interfaces import ( + EXT_CONTINUE as EXT_CONTINUE, + EXT_SKIP as EXT_SKIP, + EXT_STOP as EXT_STOP, + MANYTOMANY as MANYTOMANY, + MANYTOONE as MANYTOONE, + NOT_EXTENSION as NOT_EXTENSION, + ONETOMANY as ONETOMANY, + InspectionAttr as InspectionAttr, + InspectionAttrInfo as InspectionAttrInfo, + MapperProperty as MapperProperty, + PropComparator as PropComparator, + UserDefinedOption as UserDefinedOption, +) +from .loading import merge_frozen_result as merge_frozen_result, merge_result as merge_result +from .mapper import ( + Mapper as Mapper, + class_mapper as class_mapper, + configure_mappers as configure_mappers, + reconstructor as reconstructor, + validates as validates, +) +from .properties import ColumnProperty as ColumnProperty +from .query import AliasOption as AliasOption, FromStatement as FromStatement, Query as Query +from .relationships import RelationshipProperty as RelationshipProperty, foreign as foreign, remote as remote +from .scoping import scoped_session as scoped_session +from .session import ( + ORMExecuteState as ORMExecuteState, + Session as Session, + SessionTransaction as SessionTransaction, + close_all_sessions as close_all_sessions, + make_transient as make_transient, + make_transient_to_detached as make_transient_to_detached, + object_session as object_session, + sessionmaker as sessionmaker, +) +from .state import AttributeState as AttributeState, InstanceState as InstanceState +from .strategy_options import Load as Load +from .unitofwork import UOWTransaction as UOWTransaction +from .util import ( + Bundle as Bundle, + CascadeOptions as CascadeOptions, + LoaderCriteriaOption as LoaderCriteriaOption, + aliased as aliased, + join as join, + object_mapper as object_mapper, + outerjoin as outerjoin, + polymorphic_union as polymorphic_union, + was_deleted as was_deleted, + with_parent as with_parent, + with_polymorphic as with_polymorphic, +) + +def create_session(bind: Any | None = ..., **kwargs): ... + +with_loader_criteria: Any +relationship: Any + +def relation(*arg, **kw): ... +def dynamic_loader(argument, **kw): ... + +column_property: Any +composite: Any + +def backref(name, **kwargs): ... +def deferred(*columns, **kw): ... +def query_expression(default_expr=...): ... + +mapper: Any +synonym: Any + +def clear_mappers() -> None: ... + +joinedload: Any +contains_eager: Any +defer: Any +undefer: Any +undefer_group: Any +with_expression: Any +load_only: Any +lazyload: Any +subqueryload: Any +selectinload: Any +immediateload: Any +noload: Any +raiseload: Any +defaultload: Any +selectin_polymorphic: Any + +def eagerload(*args, **kwargs): ... + +contains_alias: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi new file mode 100644 index 000000000..bd79f138d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi @@ -0,0 +1,250 @@ +from typing import Any, Generic, NamedTuple, TypeVar + +from ..sql import base as sql_base, roles, traversals +from ..util import memoized_property +from . import interfaces + +_T = TypeVar("_T") + +class NoKey(str): ... + +NO_KEY: Any + +class QueryableAttribute( + interfaces._MappedAttribute, + interfaces.InspectionAttr, + interfaces.PropComparator, + traversals.HasCopyInternals, + roles.JoinTargetRole, + roles.OnClauseRole, + sql_base.Immutable, + sql_base.MemoizedHasCacheKey, +): + is_attribute: bool + __visit_name__: str + class_: Any + key: Any + impl: Any + comparator: Any + def __init__( + self, + class_, + key, + parententity, + impl: Any | None = ..., + comparator: Any | None = ..., + of_type: Any | None = ..., + extra_criteria=..., + ) -> None: ... + def __reduce__(self): ... + def get_history(self, instance, passive=...): ... + @memoized_property + def info(self): ... + @memoized_property + def parent(self): ... + @memoized_property + def expression(self): ... + def __clause_element__(self): ... + def adapt_to_entity(self, adapt_to_entity): ... + def of_type(self, entity): ... + def and_(self, *other): ... + def label(self, name): ... + def operate(self, op, *other, **kwargs): ... + def reverse_operate(self, op, other, **kwargs): ... + def hasparent(self, state, optimistic: bool = ...): ... + def __getattr__(self, key): ... + @memoized_property + def property(self): ... + +class Mapped(QueryableAttribute, Generic[_T]): + def __get__(self, instance, owner) -> None: ... + def __set__(self, instance, value) -> None: ... + def __delete__(self, instance) -> None: ... + +class InstrumentedAttribute(Mapped[Any]): + inherit_cache: bool + def __set__(self, instance, value) -> None: ... + def __delete__(self, instance) -> None: ... + def __get__(self, instance, owner): ... + +class _HasEntityNamespace(NamedTuple): + entity_namespace: Any + +class HasEntityNamespace(_HasEntityNamespace): + is_mapper: bool + is_aliased_class: bool + +def create_proxied_attribute(descriptor): ... + +OP_REMOVE: Any +OP_APPEND: Any +OP_REPLACE: Any +OP_BULK_REPLACE: Any +OP_MODIFIED: Any + +class AttributeEvent: + impl: Any + op: Any + parent_token: Any + def __init__(self, attribute_impl, op) -> None: ... + def __eq__(self, other): ... + @property + def key(self): ... + def hasparent(self, state): ... + +Event = AttributeEvent + +class AttributeImpl: + class_: Any + key: Any + callable_: Any + dispatch: Any + trackparent: Any + parent_token: Any + send_modified_events: Any + is_equal: Any + accepts_scalar_loader: Any + load_on_unexpire: Any + def __init__( + self, + class_, + key, + callable_, + dispatch, + trackparent: bool = ..., + compare_function: Any | None = ..., + active_history: bool = ..., + parent_token: Any | None = ..., + load_on_unexpire: bool = ..., + send_modified_events: bool = ..., + accepts_scalar_loader: Any | None = ..., + **kwargs, + ) -> None: ... + active_history: Any + def hasparent(self, state, optimistic: bool = ...): ... + def sethasparent(self, state, parent_state, value) -> None: ... + def get_history(self, state, dict_, passive=...) -> None: ... + def get_all_pending(self, state, dict_, passive=...) -> None: ... + def get(self, state, dict_, passive=...): ... + def append(self, state, dict_, value, initiator, passive=...) -> None: ... + def remove(self, state, dict_, value, initiator, passive=...) -> None: ... + def pop(self, state, dict_, value, initiator, passive=...) -> None: ... + def set(self, state, dict_, value, initiator, passive=..., check_old: Any | None = ..., pop: bool = ...) -> None: ... + def get_committed_value(self, state, dict_, passive=...): ... + def set_committed_value(self, state, dict_, value): ... + +class ScalarAttributeImpl(AttributeImpl): + default_accepts_scalar_loader: bool + uses_objects: bool + supports_population: bool + collection: bool + dynamic: bool + def __init__(self, *arg, **kw) -> None: ... + def delete(self, state, dict_) -> None: ... + def get_history(self, state, dict_, passive=...): ... + def set(self, state, dict_, value, initiator, passive=..., check_old: Any | None = ..., pop: bool = ...) -> None: ... + def fire_replace_event(self, state, dict_, value, previous, initiator): ... + def fire_remove_event(self, state, dict_, value, initiator) -> None: ... + @property + def type(self) -> None: ... + +class ScalarObjectAttributeImpl(ScalarAttributeImpl): + default_accepts_scalar_loader: bool + uses_objects: bool + supports_population: bool + collection: bool + def delete(self, state, dict_) -> None: ... + def get_history(self, state, dict_, passive=...): ... + def get_all_pending(self, state, dict_, passive=...): ... + def set(self, state, dict_, value, initiator, passive=..., check_old: Any | None = ..., pop: bool = ...) -> None: ... + def fire_remove_event(self, state, dict_, value, initiator) -> None: ... + def fire_replace_event(self, state, dict_, value, previous, initiator): ... + +class CollectionAttributeImpl(AttributeImpl): + default_accepts_scalar_loader: bool + uses_objects: bool + supports_population: bool + collection: bool + dynamic: bool + copy: Any + collection_factory: Any + def __init__( + self, + class_, + key, + callable_, + dispatch, + typecallable: Any | None = ..., + trackparent: bool = ..., + copy_function: Any | None = ..., + compare_function: Any | None = ..., + **kwargs, + ) -> None: ... + def get_history(self, state, dict_, passive=...): ... + def get_all_pending(self, state, dict_, passive=...): ... + def fire_append_event(self, state, dict_, value, initiator): ... + def fire_append_wo_mutation_event(self, state, dict_, value, initiator): ... + def fire_pre_remove_event(self, state, dict_, initiator) -> None: ... + def fire_remove_event(self, state, dict_, value, initiator) -> None: ... + def delete(self, state, dict_) -> None: ... + def append(self, state, dict_, value, initiator, passive=...) -> None: ... + def remove(self, state, dict_, value, initiator, passive=...) -> None: ... + def pop(self, state, dict_, value, initiator, passive=...) -> None: ... + def set( + self, + state, + dict_, + value, + initiator: Any | None = ..., + passive=..., + check_old: Any | None = ..., + pop: bool = ..., + _adapt: bool = ..., + ) -> None: ... + def set_committed_value(self, state, dict_, value): ... + def get_collection(self, state, dict_, user_data: Any | None = ..., passive=...): ... + +def backref_listeners(attribute, key, uselist): ... + +class History: + def __bool__(self): ... + __nonzero__: Any + def empty(self): ... + def sum(self): ... + def non_deleted(self): ... + def non_added(self): ... + def has_changes(self): ... + def as_state(self): ... + @classmethod + def from_scalar_attribute(cls, attribute, state, current): ... + @classmethod + def from_object_attribute(cls, attribute, state, current, original=...): ... + @classmethod + def from_collection(cls, attribute, state, current): ... + +HISTORY_BLANK: Any + +def get_history(obj, key, passive=...): ... +def get_state_history(state, key, passive=...): ... +def has_parent(cls, obj, key, optimistic: bool = ...): ... +def register_attribute(class_, key, **kw): ... +def register_attribute_impl( + class_, + key, + uselist: bool = ..., + callable_: Any | None = ..., + useobject: bool = ..., + impl_class: Any | None = ..., + backref: Any | None = ..., + **kw, +): ... +def register_descriptor(class_, key, comparator: Any | None = ..., parententity: Any | None = ..., doc: Any | None = ...): ... +def unregister_attribute(class_, key) -> None: ... +def init_collection(obj, key): ... +def init_state_collection(state, dict_, key): ... +def set_committed_value(instance, key, value) -> None: ... +def set_attribute(instance, key, value, initiator: Any | None = ...) -> None: ... +def get_attribute(instance, key): ... +def del_attribute(instance, key) -> None: ... +def flag_modified(instance, key) -> None: ... +def flag_dirty(instance) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/base.pyi new file mode 100644 index 000000000..4d247f53c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/base.pyi @@ -0,0 +1,75 @@ +from typing import Any + +from ..util import memoized_property + +PASSIVE_NO_RESULT: Any +PASSIVE_CLASS_MISMATCH: Any +ATTR_WAS_SET: Any +ATTR_EMPTY: Any +NO_VALUE: Any +NEVER_SET: Any +NO_CHANGE: Any +CALLABLES_OK: Any +SQL_OK: Any +RELATED_OBJECT_OK: Any +INIT_OK: Any +NON_PERSISTENT_OK: Any +LOAD_AGAINST_COMMITTED: Any +NO_AUTOFLUSH: Any +NO_RAISE: Any +DEFERRED_HISTORY_LOAD: Any +PASSIVE_OFF: Any +PASSIVE_RETURN_NO_VALUE: Any +PASSIVE_NO_INITIALIZE: Any +PASSIVE_NO_FETCH: Any +PASSIVE_NO_FETCH_RELATED: Any +PASSIVE_ONLY_PERSISTENT: Any +DEFAULT_MANAGER_ATTR: str +DEFAULT_STATE_ATTR: str +EXT_CONTINUE: Any +EXT_STOP: Any +EXT_SKIP: Any +ONETOMANY: Any +MANYTOONE: Any +MANYTOMANY: Any +NOT_EXTENSION: Any + +_never_set: frozenset[Any] +_none_set: frozenset[Any] + +def manager_of_class(cls): ... + +instance_state: Any +instance_dict: Any + +def instance_str(instance): ... +def state_str(state): ... +def state_class_str(state): ... +def attribute_str(instance, attribute): ... +def state_attribute_str(state, attribute): ... +def object_mapper(instance): ... +def object_state(instance): ... +def _class_to_mapper(class_or_mapper): ... +def _mapper_or_none(entity): ... +def _is_mapped_class(entity): ... + +_state_mapper: Any + +def class_mapper(class_, configure: bool = ...): ... + +class InspectionAttr: + is_selectable: bool + is_aliased_class: bool + is_instance: bool + is_mapper: bool + is_bundle: bool + is_property: bool + is_attribute: bool + is_clause_element: bool + extension_type: Any + +class InspectionAttrInfo(InspectionAttr): + @memoized_property + def info(self): ... + +class _MappedAttribute: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/clsregistry.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/clsregistry.pyi new file mode 100644 index 000000000..585189669 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/clsregistry.pyi @@ -0,0 +1,51 @@ +from typing import Any + +def add_class(classname, cls, decl_class_registry) -> None: ... +def remove_class(classname, cls, decl_class_registry) -> None: ... + +class _MultipleClassMarker: + on_remove: Any + contents: Any + def __init__(self, classes, on_remove: Any | None = ...) -> None: ... + def remove_item(self, cls) -> None: ... + def __iter__(self): ... + def attempt_get(self, path, key): ... + def add_item(self, item) -> None: ... + +class _ModuleMarker: + parent: Any + name: Any + contents: Any + mod_ns: Any + path: Any + def __init__(self, name, parent) -> None: ... + def __contains__(self, name): ... + def __getitem__(self, name): ... + def resolve_attr(self, key): ... + def get_module(self, name): ... + def add_class(self, name, cls): ... + def remove_class(self, name, cls) -> None: ... + +class _ModNS: + def __init__(self, parent) -> None: ... + def __getattr__(self, key): ... + +class _GetColumns: + cls: Any + def __init__(self, cls) -> None: ... + def __getattr__(self, key): ... + +class _GetTable: + key: Any + metadata: Any + def __init__(self, key, metadata) -> None: ... + def __getattr__(self, key): ... + +class _class_resolver: + cls: Any + prop: Any + arg: Any + fallback: Any + favor_tables: Any + def __init__(self, cls, prop, fallback, arg, favor_tables: bool = ...) -> None: ... + def __call__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi new file mode 100644 index 000000000..fd59745d0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi @@ -0,0 +1,91 @@ +from typing import Any + +class _PlainColumnGetter: + cols: Any + composite: Any + def __init__(self, cols) -> None: ... + def __reduce__(self): ... + def __call__(self, value): ... + +class _SerializableColumnGetter: + colkeys: Any + composite: Any + def __init__(self, colkeys) -> None: ... + def __reduce__(self): ... + def __call__(self, value): ... + +class _SerializableColumnGetterV2(_PlainColumnGetter): + colkeys: Any + composite: Any + def __init__(self, colkeys) -> None: ... + def __reduce__(self): ... + +def column_mapped_collection(mapping_spec): ... + +class _SerializableAttrGetter: + name: Any + getter: Any + def __init__(self, name) -> None: ... + def __call__(self, target): ... + def __reduce__(self): ... + +def attribute_mapped_collection(attr_name): ... +def mapped_collection(keyfunc): ... + +class collection: + @staticmethod + def appender(fn): ... + @staticmethod + def remover(fn): ... + @staticmethod + def iterator(fn): ... + @staticmethod + def internally_instrumented(fn): ... + @staticmethod + def converter(fn): ... + @staticmethod + def adds(arg): ... + @staticmethod + def replaces(arg): ... + @staticmethod + def removes(arg): ... + @staticmethod + def removes_return(): ... + +collection_adapter: Any + +class CollectionAdapter: + attr: Any + owner_state: Any + invalidated: bool + empty: bool + def __init__(self, attr, owner_state, data) -> None: ... + @property + def data(self): ... + def bulk_appender(self): ... + def append_with_event(self, item, initiator: Any | None = ...) -> None: ... + def append_without_event(self, item) -> None: ... + def append_multiple_without_event(self, items) -> None: ... + def bulk_remover(self): ... + def remove_with_event(self, item, initiator: Any | None = ...) -> None: ... + def remove_without_event(self, item) -> None: ... + def clear_with_event(self, initiator: Any | None = ...) -> None: ... + def clear_without_event(self) -> None: ... + def __iter__(self): ... + def __len__(self): ... + def __bool__(self): ... + __nonzero__: Any + def fire_append_wo_mutation_event(self, item, initiator: Any | None = ...): ... + def fire_append_event(self, item, initiator: Any | None = ...): ... + def fire_remove_event(self, item, initiator: Any | None = ...) -> None: ... + def fire_pre_remove_event(self, initiator: Any | None = ...) -> None: ... + +class InstrumentedList(list[Any]): ... +class InstrumentedSet(set[Any]): ... +class InstrumentedDict(dict[Any, Any]): ... + +class MappedCollection(dict[Any, Any]): + keyfunc: Any + def __init__(self, keyfunc) -> None: ... + def set(self, value, _sa_initiator: Any | None = ...) -> None: ... + def remove(self, value, _sa_initiator: Any | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi new file mode 100644 index 000000000..bc123f007 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi @@ -0,0 +1,189 @@ +from typing import Any + +from ..sql.base import CacheableOptions, CompileState, Options +from ..sql.selectable import SelectState + +LABEL_STYLE_LEGACY_ORM: Any + +class QueryContext: + class default_load_options(Options): ... + load_options: Any + execution_options: Any + bind_arguments: Any + compile_state: Any + query: Any + session: Any + loaders_require_buffering: bool + loaders_require_uniquing: bool + params: Any + create_eager_joins: Any + propagated_loader_options: Any + attributes: Any + runid: Any + partials: Any + post_load_paths: Any + autoflush: Any + populate_existing: Any + invoke_all_eagers: Any + version_check: Any + refresh_state: Any + yield_per: Any + identity_token: Any + def __init__( + self, + compile_state, + statement, + params, + session, + load_options, + execution_options: Any | None = ..., + bind_arguments: Any | None = ..., + ) -> None: ... + +class ORMCompileState(CompileState): + class default_compile_options(CacheableOptions): ... + current_path: Any + def __init__(self, *arg, **kw) -> None: ... + @classmethod + def create_for_statement(cls, statement_container, compiler, **kw) -> None: ... # type: ignore[override] + @classmethod + def get_column_descriptions(cls, statement): ... + @classmethod + def orm_pre_session_exec(cls, session, statement, params, execution_options, bind_arguments, is_reentrant_invoke): ... + @classmethod + def orm_setup_cursor_result(cls, session, statement, params, execution_options, bind_arguments, result): ... + +class ORMFromStatementCompileState(ORMCompileState): + multi_row_eager_loaders: bool + compound_eager_adapter: Any + extra_criteria_entities: Any + eager_joins: Any + use_legacy_query_style: Any + statement_container: Any + requested_statement: Any + dml_table: Any + compile_options: Any + statement: Any + current_path: Any + attributes: Any + global_attributes: Any + primary_columns: Any + secondary_columns: Any + dedupe_columns: Any + create_eager_joins: Any + order_by: Any + @classmethod + def create_for_statement(cls, statement_container, compiler, **kw): ... + +class ORMSelectCompileState(ORMCompileState, SelectState): + multi_row_eager_loaders: bool + compound_eager_adapter: Any + correlate: Any + correlate_except: Any + global_attributes: Any + select_statement: Any + for_statement: Any + use_legacy_query_style: Any + compile_options: Any + label_style: Any + current_path: Any + eager_order_by: Any + attributes: Any + primary_columns: Any + secondary_columns: Any + dedupe_columns: Any + eager_joins: Any + extra_criteria_entities: Any + create_eager_joins: Any + from_clauses: Any + @classmethod + def create_for_statement(cls, statement, compiler, **kw): ... + @classmethod + def determine_last_joined_entity(cls, statement): ... + @classmethod + def all_selected_columns(cls, statement) -> None: ... + @classmethod + def get_columns_clause_froms(cls, statement): ... + @classmethod + def from_statement(cls, statement, from_statement): ... + +class _QueryEntity: + use_id_for_hash: bool + @classmethod + def to_compile_state(cls, compile_state, entities, entities_collection, is_current_entities): ... + +class _MapperEntity(_QueryEntity): + expr: Any + mapper: Any + entity_zero: Any + is_aliased_class: Any + path: Any + selectable: Any + def __init__(self, compile_state, entity, entities_collection, is_current_entities) -> None: ... + supports_single_entity: bool + use_id_for_hash: bool + @property + def type(self): ... + @property + def entity_zero_or_selectable(self): ... + def corresponds_to(self, entity): ... + def row_processor(self, context, result): ... + def setup_compile_state(self, compile_state) -> None: ... + +class _BundleEntity(_QueryEntity): + bundle: Any + expr: Any + type: Any + supports_single_entity: Any + def __init__( + self, compile_state, expr, entities_collection, setup_entities: bool = ..., parent_bundle: Any | None = ... + ) -> None: ... + @property + def mapper(self): ... + @property + def entity_zero(self): ... + def corresponds_to(self, entity): ... + @property + def entity_zero_or_selectable(self): ... + def setup_compile_state(self, compile_state) -> None: ... + def row_processor(self, context, result): ... + +class _ColumnEntity(_QueryEntity): + raw_column_index: Any + translate_raw_column: Any + @property + def type(self): ... + def row_processor(self, context, result): ... + +class _RawColumnEntity(_ColumnEntity): + entity_zero: Any + mapper: Any + supports_single_entity: bool + expr: Any + raw_column_index: Any + translate_raw_column: Any + column: Any + entity_zero_or_selectable: Any + def __init__(self, compile_state, column, entities_collection, raw_column_index, parent_bundle: Any | None = ...) -> None: ... + def corresponds_to(self, entity): ... + def setup_compile_state(self, compile_state) -> None: ... + +class _ORMColumnEntity(_ColumnEntity): + supports_single_entity: bool + expr: Any + translate_raw_column: bool + raw_column_index: Any + entity_zero_or_selectable: Any + entity_zero: Any + mapper: Any + column: Any + def __init__( + self, compile_state, column, entities_collection, parententity, raw_column_index, parent_bundle: Any | None = ... + ) -> None: ... + def corresponds_to(self, entity): ... + def setup_compile_state(self, compile_state) -> None: ... + +class _IdentityTokenEntity(_ORMColumnEntity): + translate_raw_column: bool + def setup_compile_state(self, compile_state) -> None: ... + def row_processor(self, context, result): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi new file mode 100644 index 000000000..4988743b2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi @@ -0,0 +1,55 @@ +from typing import Any + +from ..util import hybridproperty +from . import interfaces + +def has_inherited_table(cls): ... + +class DeclarativeMeta(type): + def __init__(cls, classname, bases, dict_, **kw) -> None: ... + def __setattr__(cls, key, value) -> None: ... + def __delattr__(cls, key) -> None: ... + +def synonym_for(name, map_column: bool = ...): ... + +class declared_attr(interfaces._MappedAttribute, property): + __doc__: Any + def __init__(self, fget, cascading: bool = ...) -> None: ... + def __get__(self, self_, cls): ... + @hybridproperty + def cascading(self): ... + +class _stateful_declared_attr(declared_attr): + kw: Any + def __init__(self, **kw) -> None: ... + def __call__(self, fn): ... + +def declarative_mixin(cls): ... +def declarative_base( + bind: Any | None = ..., + metadata: Any | None = ..., + mapper: Any | None = ..., + cls=..., + name: str = ..., + constructor=..., + class_registry: Any | None = ..., + metaclass=..., +): ... + +class registry: + metadata: Any + constructor: Any + def __init__( + self, metadata: Any | None = ..., class_registry: Any | None = ..., constructor=..., _bind: Any | None = ... + ) -> None: ... + @property + def mappers(self): ... + def configure(self, cascade: bool = ...) -> None: ... + def dispose(self, cascade: bool = ...) -> None: ... + def generate_base(self, mapper: Any | None = ..., cls=..., name: str = ..., metaclass=...): ... + def mapped(self, cls): ... + def as_declarative_base(self, **kw): ... + def map_declaratively(self, cls): ... + def map_imperatively(self, class_, local_table: Any | None = ..., **kw): ... + +def as_declarative(**kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/decl_base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/decl_base.pyi new file mode 100644 index 000000000..9d5dbf1c0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/decl_base.pyi @@ -0,0 +1,47 @@ +from typing import Any + +class _MapperConfig: + @classmethod + def setup_mapping(cls, registry, cls_, dict_, table, mapper_kw): ... + cls: Any + classname: Any + properties: Any + declared_attr_reg: Any + def __init__(self, registry, cls_, mapper_kw) -> None: ... + def set_cls_attribute(self, attrname, value): ... + +class _ImperativeMapperConfig(_MapperConfig): + dict_: Any + local_table: Any + inherits: Any + def __init__(self, registry, cls_, table, mapper_kw) -> None: ... + def map(self, mapper_kw=...): ... + +class _ClassScanMapperConfig(_MapperConfig): + dict_: Any + local_table: Any + persist_selectable: Any + declared_columns: Any + column_copies: Any + table_args: Any + tablename: Any + mapper_args: Any + mapper_args_fn: Any + inherits: Any + def __init__(self, registry, cls_, dict_, table, mapper_kw) -> None: ... + def map(self, mapper_kw=...): ... + +class _DeferredMapperConfig(_ClassScanMapperConfig): + @property + def cls(self): ... + @cls.setter + def cls(self, class_) -> None: ... + @classmethod + def has_cls(cls, class_): ... + @classmethod + def raise_unmapped_for_cls(cls, class_) -> None: ... + @classmethod + def config_for_cls(cls, class_): ... + @classmethod + def classes_for_base(cls, base_cls, sort: bool = ...): ... + def map(self, mapper_kw=...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/dependency.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/dependency.pyi new file mode 100644 index 000000000..8fe92087d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/dependency.pyi @@ -0,0 +1,74 @@ +from typing import Any + +class DependencyProcessor: + prop: Any + cascade: Any + mapper: Any + parent: Any + secondary: Any + direction: Any + post_update: Any + passive_deletes: Any + passive_updates: Any + enable_typechecks: Any + sort_key: Any + key: Any + def __init__(self, prop) -> None: ... + @classmethod + def from_relationship(cls, prop): ... + def hasparent(self, state): ... + def per_property_preprocessors(self, uow) -> None: ... + def per_property_flush_actions(self, uow) -> None: ... + def per_state_flush_actions(self, uow, states, isdelete) -> None: ... + def presort_deletes(self, uowcommit, states): ... + def presort_saves(self, uowcommit, states): ... + def process_deletes(self, uowcommit, states) -> None: ... + def process_saves(self, uowcommit, states) -> None: ... + def prop_has_changes(self, uowcommit, states, isdelete): ... + +class OneToManyDP(DependencyProcessor): + def per_property_dependencies( + self, uow, parent_saves, child_saves, parent_deletes, child_deletes, after_save, before_delete + ) -> None: ... + def per_state_dependencies( + self, uow, save_parent, delete_parent, child_action, after_save, before_delete, isdelete, childisdelete + ) -> None: ... + def presort_deletes(self, uowcommit, states) -> None: ... + def presort_saves(self, uowcommit, states) -> None: ... + def process_deletes(self, uowcommit, states) -> None: ... + def process_saves(self, uowcommit, states) -> None: ... + +class ManyToOneDP(DependencyProcessor): + def __init__(self, prop) -> None: ... + def per_property_dependencies( + self, uow, parent_saves, child_saves, parent_deletes, child_deletes, after_save, before_delete + ) -> None: ... + def per_state_dependencies( + self, uow, save_parent, delete_parent, child_action, after_save, before_delete, isdelete, childisdelete + ) -> None: ... + def presort_deletes(self, uowcommit, states) -> None: ... + def presort_saves(self, uowcommit, states) -> None: ... + def process_deletes(self, uowcommit, states) -> None: ... + def process_saves(self, uowcommit, states) -> None: ... + +class DetectKeySwitch(DependencyProcessor): + def per_property_preprocessors(self, uow) -> None: ... + def per_property_flush_actions(self, uow) -> None: ... + def per_state_flush_actions(self, uow, states, isdelete) -> None: ... + def presort_deletes(self, uowcommit, states) -> None: ... + def presort_saves(self, uow, states) -> None: ... + def prop_has_changes(self, uow, states, isdelete): ... + def process_deletes(self, uowcommit, states) -> None: ... + def process_saves(self, uowcommit, states) -> None: ... + +class ManyToManyDP(DependencyProcessor): + def per_property_dependencies( + self, uow, parent_saves, child_saves, parent_deletes, child_deletes, after_save, before_delete + ) -> None: ... + def per_state_dependencies( + self, uow, save_parent, delete_parent, child_action, after_save, before_delete, isdelete, childisdelete + ) -> None: ... + def presort_deletes(self, uowcommit, states) -> None: ... + def presort_saves(self, uowcommit, states) -> None: ... + def process_deletes(self, uowcommit, states) -> None: ... + def process_saves(self, uowcommit, states) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi new file mode 100644 index 000000000..8b5db6170 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi @@ -0,0 +1,68 @@ +from typing import Any + +from ..util import memoized_property +from . import util as orm_util +from .interfaces import MapperProperty, PropComparator + +class DescriptorProperty(MapperProperty): + doc: Any + uses_objects: bool + key: Any + descriptor: Any + def instrument_class(self, mapper): ... + +class CompositeProperty(DescriptorProperty): + attrs: Any + composite_class: Any + active_history: Any + deferred: Any + group: Any + comparator_factory: Any + info: Any + def __init__(self, class_, *attrs, **kwargs) -> None: ... + def instrument_class(self, mapper) -> None: ... + def do_init(self) -> None: ... + @memoized_property + def props(self): ... + @property + def columns(self): ... + def get_history(self, state, dict_, passive=...): ... + class CompositeBundle(orm_util.Bundle): + property: Any + def __init__(self, property_, expr) -> None: ... + def create_row_processor(self, query, procs, labels): ... + class Comparator(PropComparator): + __hash__: Any + @memoized_property + def clauses(self): ... + def __clause_element__(self): ... + @memoized_property + def expression(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class ConcreteInheritedProperty(DescriptorProperty): + descriptor: Any + def __init__(self): ... + +class SynonymProperty(DescriptorProperty): + name: Any + map_column: Any + descriptor: Any + comparator_factory: Any + doc: Any + info: Any + def __init__( + self, + name, + map_column: Any | None = ..., + descriptor: Any | None = ..., + comparator_factory: Any | None = ..., + doc: Any | None = ..., + info: Any | None = ..., + ) -> None: ... + @property + def uses_objects(self): ... + def get_history(self, *arg, **kw): ... + parent: Any + def set_parent(self, parent, init) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi new file mode 100644 index 000000000..e730ae41b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi @@ -0,0 +1,82 @@ +from typing import Any + +from . import attributes, strategies +from .query import Query + +class DynaLoader(strategies.AbstractRelationshipLoader): + logger: Any + is_class_level: bool + def init_class_attribute(self, mapper) -> None: ... + +class DynamicAttributeImpl(attributes.AttributeImpl): + uses_objects: bool + default_accepts_scalar_loader: bool + supports_population: bool + collection: bool + dynamic: bool + order_by: Any + target_mapper: Any + query_class: Any + def __init__( + self, class_, key, typecallable, dispatch, target_mapper, order_by, query_class: Any | None = ..., **kw + ) -> None: ... + def get(self, state, dict_, passive=...): ... + def get_collection(self, state, dict_, user_data: Any | None = ..., passive=...): ... + def fire_append_event(self, state, dict_, value, initiator, collection_history: Any | None = ...) -> None: ... + def fire_remove_event(self, state, dict_, value, initiator, collection_history: Any | None = ...) -> None: ... + def set( + self, + state, + dict_, + value, + initiator: Any | None = ..., + passive=..., + check_old: Any | None = ..., + pop: bool = ..., + _adapt: bool = ..., + ) -> None: ... + def delete(self, *args, **kwargs) -> None: ... + def set_committed_value(self, state, dict_, value) -> None: ... + def get_history(self, state, dict_, passive=...): ... + def get_all_pending(self, state, dict_, passive=...): ... + def append(self, state, dict_, value, initiator, passive=...) -> None: ... + def remove(self, state, dict_, value, initiator, passive=...) -> None: ... + def pop(self, state, dict_, value, initiator, passive=...) -> None: ... + +class DynamicCollectionAdapter: + data: Any + def __init__(self, data) -> None: ... + def __iter__(self): ... + def __len__(self): ... + def __bool__(self): ... + __nonzero__: Any + +class AppenderMixin: + query_class: Any + instance: Any + attr: Any + def __init__(self, attr, state) -> None: ... + session: Any + def __getitem__(self, index): ... + def count(self): ... + def extend(self, iterator) -> None: ... + def append(self, item) -> None: ... + def remove(self, item) -> None: ... + +class AppenderQuery(AppenderMixin, Query): ... + +def mixin_user_query(cls): ... + +class CollectionHistory: + unchanged_items: Any + added_items: Any + deleted_items: Any + def __init__(self, attr, state, apply_to: Any | None = ...) -> None: ... + @property + def added_plus_unchanged(self): ... + @property + def all_items(self): ... + def as_history(self): ... + def indexed(self, index): ... + def add_added(self, value) -> None: ... + def add_removed(self, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi new file mode 100644 index 000000000..2e3d6479c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi @@ -0,0 +1,24 @@ +from typing import Any + +from ..sql import operators + +class UnevaluatableError(Exception): ... + +class _NoObject(operators.ColumnOperators): + def operate(self, *arg, **kw) -> None: ... + def reverse_operate(self, *arg, **kw) -> None: ... + +class EvaluatorCompiler: + target_cls: Any + def __init__(self, target_cls: Any | None = ...) -> None: ... + def process(self, *clauses): ... + def visit_grouping(self, clause): ... + def visit_null(self, clause): ... + def visit_false(self, clause): ... + def visit_true(self, clause): ... + def visit_column(self, clause): ... + def visit_tuple(self, clause): ... + def visit_clauselist(self, clause): ... + def visit_binary(self, clause): ... + def visit_unary(self, clause): ... + def visit_bindparam(self, clause): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/events.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/events.pyi new file mode 100644 index 000000000..1a7c3cad7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/events.pyi @@ -0,0 +1,100 @@ +from typing import Any + +from .. import event + +class InstrumentationEvents(event.Events): + def class_instrument(self, cls) -> None: ... + def class_uninstrument(self, cls) -> None: ... + def attribute_instrument(self, cls, key, inst) -> None: ... + +class _InstrumentationEventsHold: + class_: Any + def __init__(self, class_) -> None: ... + dispatch: Any + +class InstanceEvents(event.Events): + def first_init(self, manager, cls) -> None: ... + def init(self, target, args, kwargs) -> None: ... + def init_failure(self, target, args, kwargs) -> None: ... + def load(self, target, context) -> None: ... + def refresh(self, target, context, attrs) -> None: ... + def refresh_flush(self, target, flush_context, attrs) -> None: ... + def expire(self, target, attrs) -> None: ... + def pickle(self, target, state_dict) -> None: ... + def unpickle(self, target, state_dict) -> None: ... + +class _EventsHold(event.RefCollection): + class_: Any + def __init__(self, class_) -> None: ... + class HoldEvents: ... + def remove(self, event_key) -> None: ... + @classmethod + def populate(cls, class_, subject) -> None: ... + +class _InstanceEventsHold(_EventsHold): + all_holds: Any + def resolve(self, class_): ... + class HoldInstanceEvents(_EventsHold.HoldEvents, InstanceEvents): ... + dispatch: Any + +class MapperEvents(event.Events): + def instrument_class(self, mapper, class_) -> None: ... + def before_mapper_configured(self, mapper, class_) -> None: ... + def mapper_configured(self, mapper, class_) -> None: ... + def before_configured(self) -> None: ... + def after_configured(self) -> None: ... + def before_insert(self, mapper, connection, target) -> None: ... + def after_insert(self, mapper, connection, target) -> None: ... + def before_update(self, mapper, connection, target) -> None: ... + def after_update(self, mapper, connection, target) -> None: ... + def before_delete(self, mapper, connection, target) -> None: ... + def after_delete(self, mapper, connection, target) -> None: ... + +class _MapperEventsHold(_EventsHold): + all_holds: Any + def resolve(self, class_): ... + class HoldMapperEvents(_EventsHold.HoldEvents, MapperEvents): ... + dispatch: Any + +class SessionEvents(event.Events): + def do_orm_execute(self, orm_execute_state) -> None: ... + def after_transaction_create(self, session, transaction) -> None: ... + def after_transaction_end(self, session, transaction) -> None: ... + def before_commit(self, session) -> None: ... + def after_commit(self, session) -> None: ... + def after_rollback(self, session) -> None: ... + def after_soft_rollback(self, session, previous_transaction) -> None: ... + def before_flush(self, session, flush_context, instances) -> None: ... + def after_flush(self, session, flush_context) -> None: ... + def after_flush_postexec(self, session, flush_context) -> None: ... + def after_begin(self, session, transaction, connection) -> None: ... + def before_attach(self, session, instance) -> None: ... + def after_attach(self, session, instance) -> None: ... + def after_bulk_update(self, update_context) -> None: ... + def after_bulk_delete(self, delete_context) -> None: ... + def transient_to_pending(self, session, instance) -> None: ... + def pending_to_transient(self, session, instance) -> None: ... + def persistent_to_transient(self, session, instance) -> None: ... + def pending_to_persistent(self, session, instance) -> None: ... + def detached_to_persistent(self, session, instance) -> None: ... + def loaded_as_persistent(self, session, instance) -> None: ... + def persistent_to_deleted(self, session, instance) -> None: ... + def deleted_to_persistent(self, session, instance) -> None: ... + def deleted_to_detached(self, session, instance) -> None: ... + def persistent_to_detached(self, session, instance) -> None: ... + +class AttributeEvents(event.Events): + def append(self, target, value, initiator) -> None: ... + def append_wo_mutation(self, target, value, initiator) -> None: ... + def bulk_replace(self, target, values, initiator) -> None: ... + def remove(self, target, value, initiator) -> None: ... + def set(self, target, value, oldvalue, initiator) -> None: ... + def init_scalar(self, target, value, dict_) -> None: ... + def init_collection(self, target, collection, collection_adapter) -> None: ... + def dispose_collection(self, target, collection, collection_adapter) -> None: ... + def modified(self, target, initiator) -> None: ... + +class QueryEvents(event.Events): + def before_compile(self, query) -> None: ... + def before_compile_update(self, query, update_context) -> None: ... + def before_compile_delete(self, query, delete_context) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi new file mode 100644 index 000000000..28a664a27 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi @@ -0,0 +1,33 @@ +from typing import Any + +from .. import exc as sa_exc + +NO_STATE: Any + +class StaleDataError(sa_exc.SQLAlchemyError): ... + +ConcurrentModificationError = StaleDataError + +class FlushError(sa_exc.SQLAlchemyError): ... +class UnmappedError(sa_exc.InvalidRequestError): ... +class ObjectDereferencedError(sa_exc.SQLAlchemyError): ... + +class DetachedInstanceError(sa_exc.SQLAlchemyError): + code: str + +class UnmappedInstanceError(UnmappedError): + def __init__(self, obj, msg: Any | None = ...) -> None: ... + def __reduce__(self): ... + +class UnmappedClassError(UnmappedError): + def __init__(self, cls, msg: Any | None = ...) -> None: ... + def __reduce__(self): ... + +class ObjectDeletedError(sa_exc.InvalidRequestError): + def __init__(self, state, msg: Any | None = ...) -> None: ... + def __reduce__(self): ... + +class UnmappedColumnError(sa_exc.InvalidRequestError): ... + +class LoaderStrategyException(sa_exc.InvalidRequestError): + def __init__(self, applied_to_property_type, requesting_property, applies_to, actual_strategy_type, strategy_key) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi new file mode 100644 index 000000000..deb590c27 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi @@ -0,0 +1,32 @@ +from typing import Any + +class IdentityMap: + def __init__(self) -> None: ... + def keys(self): ... + def replace(self, state) -> None: ... + def add(self, state) -> None: ... + def update(self, dict_) -> None: ... + def clear(self) -> None: ... + def check_modified(self): ... + def has_key(self, key): ... + def popitem(self) -> None: ... + def pop(self, key, *args) -> None: ... + def setdefault(self, key, default: Any | None = ...) -> None: ... + def __len__(self): ... + def copy(self) -> None: ... + def __setitem__(self, key, value) -> None: ... + def __delitem__(self, key) -> None: ... + +class WeakInstanceDict(IdentityMap): + def __getitem__(self, key): ... + def __contains__(self, key): ... + def contains_state(self, state): ... + def replace(self, state): ... + def add(self, state): ... + def get(self, key, default: Any | None = ...): ... + def items(self): ... + def values(self): ... + def __iter__(self): ... + def all_states(self): ... + def discard(self, state) -> None: ... + def safe_discard(self, state) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi new file mode 100644 index 000000000..d3fcb9d9e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi @@ -0,0 +1,87 @@ +from typing import Any + +from ..util import HasMemoized, hybridmethod +from . import base + +DEL_ATTR: Any + +class ClassManager(HasMemoized, dict[Any, Any]): + MANAGER_ATTR: Any + STATE_ATTR: Any + expired_attribute_loader: Any + init_method: Any + factory: Any + mapper: Any + declarative_scan: Any + registry: Any + @property + def deferred_scalar_loader(self): ... + @deferred_scalar_loader.setter + def deferred_scalar_loader(self, obj) -> None: ... + class_: Any + info: Any + new_init: Any + local_attrs: Any + originals: Any + def __init__(self, class_) -> None: ... + def __hash__(self): ... + def __eq__(self, other): ... + @property + def is_mapped(self): ... + # Will be overwritten when mapped + # def mapper(self) -> None: ... + def manage(self) -> None: ... + @hybridmethod + def manager_getter(self): ... + @hybridmethod + def state_getter(self): ... + @hybridmethod + def dict_getter(self): ... + def instrument_attribute(self, key, inst, propagated: bool = ...) -> None: ... + def subclass_managers(self, recursive) -> None: ... + def post_configure_attribute(self, key) -> None: ... + def uninstrument_attribute(self, key, propagated: bool = ...) -> None: ... + def unregister(self) -> None: ... + def install_descriptor(self, key, inst) -> None: ... + def uninstall_descriptor(self, key) -> None: ... + def install_member(self, key, implementation) -> None: ... + def uninstall_member(self, key) -> None: ... + def instrument_collection_class(self, key, collection_class): ... + def initialize_collection(self, key, state, factory): ... + def is_instrumented(self, key, search: bool = ...): ... + def get_impl(self, key): ... + @property + def attributes(self): ... + def new_instance(self, state: Any | None = ...): ... + def setup_instance(self, instance, state: Any | None = ...) -> None: ... + def teardown_instance(self, instance) -> None: ... + def has_state(self, instance): ... + def has_parent(self, state, key, optimistic: bool = ...): ... + def __bool__(self): ... + __nonzero__: Any + +class _SerializeManager: + class_: Any + def __init__(self, state, d) -> None: ... + def __call__(self, state, inst, state_dict) -> None: ... + +class InstrumentationFactory: + def create_manager_for_cls(self, class_): ... + def unregister(self, class_) -> None: ... + +instance_state: Any + +instance_dict: Any +manager_of_class = base.manager_of_class + +def register_class( + class_, + finalize: bool = ..., + mapper: Any | None = ..., + registry: Any | None = ..., + declarative_scan: Any | None = ..., + expired_attribute_loader: Any | None = ..., + init_method: Any | None = ..., +): ... +def unregister_class(class_) -> None: ... +def is_instrumented(instance, key): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi new file mode 100644 index 000000000..7246beb0e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi @@ -0,0 +1,128 @@ +from typing import Any + +from .. import util +from ..sql import operators, roles +from ..sql.base import ExecutableOption +from ..sql.traversals import HasCacheKey +from .base import ( + EXT_CONTINUE as EXT_CONTINUE, + EXT_SKIP as EXT_SKIP, + EXT_STOP as EXT_STOP, + MANYTOMANY as MANYTOMANY, + MANYTOONE as MANYTOONE, + NOT_EXTENSION as NOT_EXTENSION, + ONETOMANY as ONETOMANY, + InspectionAttr as InspectionAttr, + InspectionAttrInfo as InspectionAttrInfo, + _MappedAttribute as _MappedAttribute, +) + +__all__ = [ + "EXT_CONTINUE", + "EXT_STOP", + "EXT_SKIP", + "ONETOMANY", + "MANYTOMANY", + "MANYTOONE", + "NOT_EXTENSION", + "LoaderStrategy", + "MapperOption", + "LoaderOption", + "MapperProperty", + "PropComparator", + "StrategizedProperty", +] + +class ORMStatementRole(roles.StatementRole): ... +class ORMColumnsClauseRole(roles.ColumnsClauseRole): ... +class ORMEntityColumnsClauseRole(ORMColumnsClauseRole): ... +class ORMFromClauseRole(roles.StrictFromClauseRole): ... + +class MapperProperty(HasCacheKey, _MappedAttribute, InspectionAttr, util.MemoizedSlots): + cascade: Any + is_property: bool + def setup(self, context, query_entity, path, adapter, **kwargs) -> None: ... + def create_row_processor(self, context, query_entity, path, mapper, result, adapter, populators) -> None: ... + def cascade_iterator(self, type_, state, dict_, visited_states, halt_on: Any | None = ...): ... + parent: Any + def set_parent(self, parent, init) -> None: ... + def instrument_class(self, mapper) -> None: ... + def __init__(self) -> None: ... + def init(self) -> None: ... + @property + def class_attribute(self): ... + def do_init(self) -> None: ... + def post_instrument_class(self, mapper) -> None: ... + def merge( + self, session, source_state, source_dict, dest_state, dest_dict, load, _recursive, _resolve_conflict_map + ) -> None: ... + +class PropComparator(operators.ColumnOperators): + __visit_name__: str + prop: Any + property: Any + def __init__(self, prop, parentmapper, adapt_to_entity: Any | None = ...) -> None: ... + def __clause_element__(self) -> None: ... + def adapt_to_entity(self, adapt_to_entity): ... + @property + def adapter(self): ... + @property + def info(self): ... + @staticmethod + def any_op(a, b, **kwargs): ... + @staticmethod + def has_op(a, b, **kwargs): ... + @staticmethod + def of_type_op(a, class_): ... + def of_type(self, class_): ... + def and_(self, *criteria): ... + def any(self, criterion: Any | None = ..., **kwargs): ... + def has(self, criterion: Any | None = ..., **kwargs): ... + +class StrategizedProperty(MapperProperty): + inherit_cache: bool + strategy_wildcard_key: Any + def setup(self, context, query_entity, path, adapter, **kwargs) -> None: ... + def create_row_processor(self, context, query_entity, path, mapper, result, adapter, populators) -> None: ... + strategy: Any + def do_init(self) -> None: ... + def post_instrument_class(self, mapper) -> None: ... + @classmethod + def strategy_for(cls, **kw): ... + +class ORMOption(ExecutableOption): + propagate_to_loaders: bool + +class CompileStateOption(HasCacheKey, ORMOption): + def process_compile_state(self, compile_state) -> None: ... + def process_compile_state_replaced_entities(self, compile_state, mapper_entities) -> None: ... + +class LoaderOption(CompileStateOption): + def process_compile_state_replaced_entities(self, compile_state, mapper_entities) -> None: ... + def process_compile_state(self, compile_state) -> None: ... + +class CriteriaOption(CompileStateOption): + def process_compile_state(self, compile_state) -> None: ... + def get_global_criteria(self, attributes) -> None: ... + +class UserDefinedOption(ORMOption): + propagate_to_loaders: bool + payload: Any + def __init__(self, payload: Any | None = ...) -> None: ... + +class MapperOption(ORMOption): + propagate_to_loaders: bool + def process_query(self, query) -> None: ... + def process_query_conditionally(self, query) -> None: ... + +class LoaderStrategy: + parent_property: Any + is_class_level: bool + parent: Any + key: Any + strategy_key: Any + strategy_opts: Any + def __init__(self, parent, strategy_key) -> None: ... + def init_class_attribute(self, mapper) -> None: ... + def setup_query(self, compile_state, query_entity, path, loadopt, adapter, **kwargs) -> None: ... + def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi new file mode 100644 index 000000000..ce8486f59 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi @@ -0,0 +1,47 @@ +from typing import Any + +def instances(cursor, context): ... +def merge_frozen_result(session, statement, frozen_result, load: bool = ...): ... +def merge_result(query, iterator, load: bool = ...): ... +def get_from_identity(session, mapper, key, passive): ... +def load_on_ident( + session, + statement, + key, + load_options: Any | None = ..., + refresh_state: Any | None = ..., + with_for_update: Any | None = ..., + only_load_props: Any | None = ..., + no_autoflush: bool = ..., + bind_arguments=..., + execution_options=..., +): ... +def load_on_pk_identity( + session, + statement, + primary_key_identity, + load_options: Any | None = ..., + refresh_state: Any | None = ..., + with_for_update: Any | None = ..., + only_load_props: Any | None = ..., + identity_token: Any | None = ..., + no_autoflush: bool = ..., + bind_arguments=..., + execution_options=..., +): ... + +class PostLoad: + loaders: Any + states: Any + load_keys: Any + def __init__(self) -> None: ... + def add_state(self, state, overwrite) -> None: ... + def invoke(self, context, path) -> None: ... + @classmethod + def for_context(cls, context, path, only_load_props): ... + @classmethod + def path_exists(cls, context, path, key): ... + @classmethod + def callable_for_path(cls, context, path, limit_to_mapper, token, loader_callable, *arg, **kw) -> None: ... + +def load_scalar_attributes(mapper, state, attribute_names, passive) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi new file mode 100644 index 000000000..931bde703 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi @@ -0,0 +1,143 @@ +from typing import Any + +from ..sql import base as sql_base +from ..util import HasMemoized, memoized_property +from .base import ( + _class_to_mapper as _class_to_mapper, + _state_mapper as _state_mapper, + class_mapper as class_mapper, + state_str as state_str, +) +from .interfaces import InspectionAttr, ORMEntityColumnsClauseRole, ORMFromClauseRole + +NO_ATTRIBUTE: Any + +class Mapper(ORMFromClauseRole, ORMEntityColumnsClauseRole, sql_base.MemoizedHasCacheKey, InspectionAttr): + logger: Any + class_: Any + class_manager: Any + non_primary: Any + always_refresh: Any + version_id_prop: Any + version_id_col: Any + version_id_generator: bool + concrete: Any + single: bool + inherits: Any + local_table: Any + inherit_condition: Any + inherit_foreign_keys: Any + batch: Any + eager_defaults: Any + column_prefix: Any + polymorphic_on: Any + validators: Any + passive_updates: Any + passive_deletes: Any + legacy_is_orphan: Any + allow_partial_pks: Any + confirm_deleted_rows: bool + polymorphic_load: Any + polymorphic_identity: Any + polymorphic_map: Any + include_properties: Any + exclude_properties: Any + def __init__( + self, + class_, + local_table: Any | None = ..., + properties: Any | None = ..., + primary_key: Any | None = ..., + non_primary: bool = ..., + inherits: Any | None = ..., + inherit_condition: Any | None = ..., + inherit_foreign_keys: Any | None = ..., + always_refresh: bool = ..., + version_id_col: Any | None = ..., + version_id_generator: Any | None = ..., + polymorphic_on: Any | None = ..., + _polymorphic_map: Any | None = ..., + polymorphic_identity: Any | None = ..., + concrete: bool = ..., + with_polymorphic: Any | None = ..., + polymorphic_load: Any | None = ..., + allow_partial_pks: bool = ..., + batch: bool = ..., + column_prefix: Any | None = ..., + include_properties: Any | None = ..., + exclude_properties: Any | None = ..., + passive_updates: bool = ..., + passive_deletes: bool = ..., + confirm_deleted_rows: bool = ..., + eager_defaults: bool = ..., + legacy_is_orphan: bool = ..., + _compiled_cache_size: int = ..., + ): ... + is_mapper: bool + represents_outer_join: bool + @property + def mapper(self): ... + @property + def entity(self): ... + persist_selectable: Any + configured: bool + tables: Any + primary_key: Any + base_mapper: Any + columns: Any + c: Any + @property + def mapped_table(self): ... + def add_properties(self, dict_of_properties) -> None: ... + def add_property(self, key, prop) -> None: ... + def has_property(self, key): ... + def get_property(self, key, _configure_mappers: bool = ...): ... + def get_property_by_column(self, column): ... + @property + def iterate_properties(self): ... + with_polymorphic_mappers: Any + def __clause_element__(self): ... + @memoized_property + def select_identity_token(self): ... + @property + def selectable(self): ... + @HasMemoized.memoized_attribute + def attrs(self): ... + @HasMemoized.memoized_attribute + def all_orm_descriptors(self): ... + @HasMemoized.memoized_attribute + def synonyms(self): ... + @property + def entity_namespace(self): ... + @HasMemoized.memoized_attribute + def column_attrs(self): ... + @HasMemoized.memoized_attribute + def relationships(self): ... + @HasMemoized.memoized_attribute + def composites(self): ... + def common_parent(self, other): ... + def is_sibling(self, other): ... + def isa(self, other): ... + def iterate_to_root(self) -> None: ... + @HasMemoized.memoized_attribute + def self_and_descendants(self): ... + def polymorphic_iterator(self): ... + def primary_mapper(self): ... + @property + def primary_base_mapper(self): ... + def identity_key_from_row(self, row, identity_token: Any | None = ..., adapter: Any | None = ...): ... + def identity_key_from_primary_key(self, primary_key, identity_token: Any | None = ...): ... + def identity_key_from_instance(self, instance): ... + def primary_key_from_instance(self, instance): ... + def cascade_iterator(self, type_, state, halt_on: Any | None = ...) -> None: ... + +class _OptGetColumnsNotAvailable(Exception): ... + +def configure_mappers() -> None: ... +def reconstructor(fn): ... +def validates(*names, **kw): ... + +class _ColumnMapping(dict[Any, Any]): + mapper: Any + def __init__(self, mapper) -> None: ... + def __missing__(self, column) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi new file mode 100644 index 000000000..6d76489c4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi @@ -0,0 +1,106 @@ +from typing import Any, ClassVar + +from ..sql.traversals import HasCacheKey +from ..util import memoized_property +from . import base as orm_base + +log: Any + +class PathRegistry(HasCacheKey): + root: ClassVar[RootRegistry] + is_token: bool + is_root: bool + def __eq__(self, other): ... + def __ne__(self, other): ... + def set(self, attributes, key, value) -> None: ... + def setdefault(self, attributes, key, value) -> None: ... + def get(self, attributes, key, value: Any | None = ...): ... + def __len__(self): ... + def __hash__(self): ... + @property + def length(self): ... + def pairs(self) -> None: ... + def contains_mapper(self, mapper): ... + def contains(self, attributes, key): ... + def __reduce__(self): ... + @classmethod + def serialize_context_dict(cls, dict_, tokens): ... + @classmethod + def deserialize_context_dict(cls, serialized): ... + def serialize(self): ... + @classmethod + def deserialize(cls, path): ... + @classmethod + def per_mapper(cls, mapper): ... + @classmethod + def coerce(cls, raw): ... + def token(self, token): ... + def __add__(self, other): ... + +class RootRegistry(PathRegistry): + inherit_cache: bool + path: Any + natural_path: Any + has_entity: bool + is_aliased_class: bool + is_root: bool + def __getitem__(self, entity): ... + +class PathToken(orm_base.InspectionAttr, HasCacheKey, str): + @classmethod + def intern(cls, strvalue): ... + +class TokenRegistry(PathRegistry): + inherit_cache: bool + token: Any + parent: Any + path: Any + natural_path: Any + def __init__(self, parent, token) -> None: ... + has_entity: bool + is_token: bool + def generate_for_superclasses(self) -> None: ... + def __getitem__(self, entity) -> None: ... + +class PropRegistry(PathRegistry): + is_unnatural: bool + inherit_cache: bool + prop: Any + parent: Any + path: Any + natural_path: Any + def __init__(self, parent, prop) -> None: ... + @memoized_property + def has_entity(self): ... + @memoized_property + def entity(self): ... + @property + def mapper(self): ... + @property + def entity_path(self): ... + def __getitem__(self, entity): ... + +class AbstractEntityRegistry(PathRegistry): + has_entity: bool + key: Any + parent: Any + is_aliased_class: Any + entity: Any + path: Any + natural_path: Any + def __init__(self, parent, entity) -> None: ... + @property + def entity_path(self): ... + @property + def mapper(self): ... + def __bool__(self): ... + __nonzero__: Any + def __getitem__(self, entity): ... + +class SlotsEntityRegistry(AbstractEntityRegistry): + inherit_cache: bool + +class CachingEntityRegistry(AbstractEntityRegistry, dict): # type: ignore[misc] + inherit_cache: bool + def __getitem__(self, entity): ... + def __missing__(self, key): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi new file mode 100644 index 000000000..6b9babbfb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi @@ -0,0 +1,27 @@ +from typing import Any + +from ..sql.base import CompileState, Options +from ..sql.dml import DeleteDMLState, UpdateDMLState + +def save_obj(base_mapper, states, uowtransaction, single: bool = ...) -> None: ... +def post_update(base_mapper, states, uowtransaction, post_update_cols) -> None: ... +def delete_obj(base_mapper, states, uowtransaction) -> None: ... + +class BulkUDCompileState(CompileState): + class default_update_options(Options): ... + @classmethod + def orm_pre_session_exec(cls, session, statement, params, execution_options, bind_arguments, is_reentrant_invoke): ... + @classmethod + def orm_setup_cursor_result(cls, session, statement, params, execution_options, bind_arguments, result): ... + +class BulkORMUpdate(UpdateDMLState, BulkUDCompileState): + mapper: Any + extra_criteria_entities: Any + @classmethod + def create_for_statement(cls, statement, compiler, **kw): ... + +class BulkORMDelete(DeleteDMLState, BulkUDCompileState): + mapper: Any + extra_criteria_entities: Any + @classmethod + def create_for_statement(cls, statement, compiler, **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/properties.pyi new file mode 100644 index 000000000..963321511 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/properties.pyi @@ -0,0 +1,44 @@ +from typing import Any + +from .. import util +from .descriptor_props import ( + CompositeProperty as CompositeProperty, + ConcreteInheritedProperty as ConcreteInheritedProperty, + SynonymProperty as SynonymProperty, +) +from .interfaces import PropComparator, StrategizedProperty +from .relationships import RelationshipProperty as RelationshipProperty + +__all__ = ["ColumnProperty", "CompositeProperty", "ConcreteInheritedProperty", "RelationshipProperty", "SynonymProperty"] + +class ColumnProperty(StrategizedProperty): + logger: Any + strategy_wildcard_key: str + inherit_cache: bool + columns: Any + group: Any + deferred: Any + raiseload: Any + instrument: Any + comparator_factory: Any + descriptor: Any + active_history: Any + expire_on_flush: Any + info: Any + doc: Any + strategy_key: Any + def __init__(self, *columns, **kwargs) -> None: ... + def __clause_element__(self): ... + @property + def expression(self): ... + def instrument_class(self, mapper) -> None: ... + def do_init(self) -> None: ... + def copy(self): ... + def merge( + self, session, source_state, source_dict, dest_state, dest_dict, load, _recursive, _resolve_conflict_map + ) -> None: ... + class Comparator(util.MemoizedSlots, PropComparator): + expressions: Any + def _memoized_method___clause_element__(self): ... + def operate(self, op, *other, **kwargs): ... + def reverse_operate(self, op, other, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi new file mode 100644 index 000000000..cbaf8c8bf --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi @@ -0,0 +1,127 @@ +from typing import Any + +from ..sql.annotation import SupportsCloneAnnotations +from ..sql.base import Executable +from ..sql.selectable import GroupedElement, HasHints, HasPrefixes, HasSuffixes, SelectBase, _SelectFromElements +from . import interfaces +from .context import QueryContext as QueryContext +from .util import aliased as aliased + +__all__ = ["Query", "QueryContext", "aliased"] + +class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffixes, HasHints, Executable): + logger: Any + load_options: Any + session: Any + def __init__(self, entities, session: Any | None = ...) -> None: ... + @property + def statement(self): ... + def subquery(self, name: Any | None = ..., with_labels: bool = ..., reduce_columns: bool = ...): ... + def cte(self, name: Any | None = ..., recursive: bool = ..., nesting: bool = ...): ... + def label(self, name): ... + def as_scalar(self): ... + def scalar_subquery(self): ... + @property + def selectable(self): ... + def __clause_element__(self): ... + def only_return_tuples(self, value) -> None: ... + @property + def is_single_entity(self): ... + def enable_eagerloads(self, value) -> None: ... + def with_labels(self): ... + apply_labels: Any + @property + def get_label_style(self): ... + def set_label_style(self, style): ... + def enable_assertions(self, value) -> None: ... + @property + def whereclause(self): ... + def with_polymorphic(self, cls_or_mappers, selectable: Any | None = ..., polymorphic_on: Any | None = ...) -> None: ... + def yield_per(self, count) -> None: ... + def get(self, ident): ... + @property + def lazy_loaded_from(self): ... + def correlate(self, *fromclauses) -> None: ... + def autoflush(self, setting) -> None: ... + def populate_existing(self) -> None: ... + def with_parent(self, instance, property: Any | None = ..., from_entity: Any | None = ...): ... + def add_entity(self, entity, alias: Any | None = ...) -> None: ... + def with_session(self, session) -> None: ... + def from_self(self, *entities): ... + def values(self, *columns): ... + def value(self, column): ... + def with_entities(self, *entities) -> None: ... + def add_columns(self, *column) -> None: ... + def add_column(self, column): ... + def options(self, *args) -> None: ... + def with_transformation(self, fn): ... + def get_execution_options(self): ... + def execution_options(self, **kwargs) -> None: ... + def with_for_update( + self, read: bool = ..., nowait: bool = ..., of: Any | None = ..., skip_locked: bool = ..., key_share: bool = ... + ) -> None: ... + def params(self, *args, **kwargs) -> None: ... + def where(self, *criterion): ... + def filter(self, *criterion) -> None: ... + def filter_by(self, **kwargs): ... + def order_by(self, *clauses) -> None: ... + def group_by(self, *clauses) -> None: ... + def having(self, criterion) -> None: ... + def union(self, *q): ... + def union_all(self, *q): ... + def intersect(self, *q): ... + def intersect_all(self, *q): ... + def except_(self, *q): ... + def except_all(self, *q): ... + def join(self, target, *props, **kwargs) -> None: ... + def outerjoin(self, target, *props, **kwargs): ... + def reset_joinpoint(self) -> None: ... + def select_from(self, *from_obj) -> None: ... + def select_entity_from(self, from_obj) -> None: ... + def __getitem__(self, item): ... + def slice(self, start, stop) -> None: ... + def limit(self, limit) -> None: ... + def offset(self, offset) -> None: ... + def distinct(self, *expr) -> None: ... + def all(self): ... + def from_statement(self, statement) -> None: ... + def first(self): ... + def one_or_none(self): ... + def one(self): ... + def scalar(self): ... + def __iter__(self): ... + @property + def column_descriptions(self): ... + def instances(self, result_proxy, context: Any | None = ...): ... + def merge_result(self, iterator, load: bool = ...): ... + def exists(self): ... + def count(self): ... + def delete(self, synchronize_session: str = ...): ... + def update(self, values, synchronize_session: str = ..., update_args: Any | None = ...): ... + +class FromStatement(GroupedElement, SelectBase, Executable): + __visit_name__: str + element: Any + def __init__(self, entities, element) -> None: ... + def get_label_style(self): ... + def set_label_style(self, label_style): ... + def get_children(self, **kw) -> None: ... # type: ignore[override] + +class AliasOption(interfaces.LoaderOption): + def __init__(self, alias) -> None: ... + inherit_cache: bool + def process_compile_state(self, compile_state) -> None: ... + +class BulkUD: + query: Any + mapper: Any + def __init__(self, query) -> None: ... + @property + def session(self): ... + +class BulkUpdate(BulkUD): + values: Any + update_kwargs: Any + def __init__(self, query, values, update_kwargs) -> None: ... + +class BulkDelete(BulkUD): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi new file mode 100644 index 000000000..69b52d7cb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi @@ -0,0 +1,174 @@ +from typing import Any + +from ..util import memoized_property +from .interfaces import PropComparator, StrategizedProperty + +def remote(expr): ... +def foreign(expr): ... + +class RelationshipProperty(StrategizedProperty): + logger: Any + strategy_wildcard_key: str + inherit_cache: bool + uselist: Any + argument: Any + secondary: Any + primaryjoin: Any + secondaryjoin: Any + post_update: Any + direction: Any + viewonly: Any + sync_backref: Any + lazy: Any + single_parent: Any + collection_class: Any + passive_deletes: Any + cascade_backrefs: Any + passive_updates: Any + remote_side: Any + enable_typechecks: Any + query_class: Any + innerjoin: Any + distinct_target_key: Any + doc: Any + active_history: Any + join_depth: Any + omit_join: Any + local_remote_pairs: Any + bake_queries: Any + load_on_pending: Any + comparator_factory: Any + comparator: Any + info: Any + strategy_key: Any + order_by: Any + back_populates: Any + backref: Any + def __init__( + self, + argument, + secondary: Any | None = ..., + primaryjoin: Any | None = ..., + secondaryjoin: Any | None = ..., + foreign_keys: Any | None = ..., + uselist: Any | None = ..., + order_by: bool = ..., + backref: Any | None = ..., + back_populates: Any | None = ..., + overlaps: Any | None = ..., + post_update: bool = ..., + cascade: bool = ..., + viewonly: bool = ..., + lazy: str = ..., + collection_class: Any | None = ..., + passive_deletes=..., + passive_updates=..., + remote_side: Any | None = ..., + enable_typechecks=..., + join_depth: Any | None = ..., + comparator_factory: Any | None = ..., + single_parent: bool = ..., + innerjoin: bool = ..., + distinct_target_key: Any | None = ..., + doc: Any | None = ..., + active_history=..., + cascade_backrefs=..., + load_on_pending: bool = ..., + bake_queries: bool = ..., + _local_remote_pairs: Any | None = ..., + query_class: Any | None = ..., + info: Any | None = ..., + omit_join: Any | None = ..., + sync_backref: Any | None = ..., + _legacy_inactive_history_style: bool = ..., + ) -> None: ... + def instrument_class(self, mapper) -> None: ... + class Comparator(PropComparator): + prop: Any + def __init__( + self, prop, parentmapper, adapt_to_entity: Any | None = ..., of_type: Any | None = ..., extra_criteria=... + ) -> None: ... + def adapt_to_entity(self, adapt_to_entity): ... + @memoized_property + def entity(self): ... + @memoized_property + def mapper(self): ... + def __clause_element__(self): ... + def of_type(self, cls): ... + def and_(self, *other): ... + def in_(self, other) -> None: ... + __hash__: Any + def __eq__(self, other): ... + def any(self, criterion: Any | None = ..., **kwargs): ... + def has(self, criterion: Any | None = ..., **kwargs): ... + def contains(self, other, **kwargs): ... + def __ne__(self, other): ... + @memoized_property + def property(self): ... + def merge( + self, session, source_state, source_dict, dest_state, dest_dict, load, _recursive, _resolve_conflict_map + ) -> None: ... + def cascade_iterator(self, type_, state, dict_, visited_states, halt_on: Any | None = ...) -> None: ... + @memoized_property + def entity(self): ... + @memoized_property + def mapper(self): ... + def do_init(self) -> None: ... + @property + def cascade(self): ... + @cascade.setter + def cascade(self, cascade) -> None: ... + +class JoinCondition: + parent_persist_selectable: Any + parent_local_selectable: Any + child_persist_selectable: Any + child_local_selectable: Any + parent_equivalents: Any + child_equivalents: Any + primaryjoin: Any + secondaryjoin: Any + secondary: Any + consider_as_foreign_keys: Any + prop: Any + self_referential: Any + support_sync: Any + can_be_synced_fn: Any + def __init__( + self, + parent_persist_selectable, + child_persist_selectable, + parent_local_selectable, + child_local_selectable, + primaryjoin: Any | None = ..., + secondary: Any | None = ..., + secondaryjoin: Any | None = ..., + parent_equivalents: Any | None = ..., + child_equivalents: Any | None = ..., + consider_as_foreign_keys: Any | None = ..., + local_remote_pairs: Any | None = ..., + remote_side: Any | None = ..., + self_referential: bool = ..., + prop: Any | None = ..., + support_sync: bool = ..., + can_be_synced_fn=..., + ): ... + @property + def primaryjoin_minus_local(self): ... + @property + def secondaryjoin_minus_local(self): ... + @memoized_property + def primaryjoin_reverse_remote(self): ... + @memoized_property + def remote_columns(self): ... + @memoized_property + def local_columns(self): ... + @memoized_property + def foreign_key_columns(self): ... + def join_targets(self, source_selectable, dest_selectable, aliased, single_crit: Any | None = ..., extra_criteria=...): ... + def create_lazy_clause(self, reverse_direction: bool = ...): ... + +class _ColInAnnotations: + name: Any + def __init__(self, name) -> None: ... + def __call__(self, c): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi new file mode 100644 index 000000000..23985d766 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi @@ -0,0 +1,95 @@ +from typing import Any + +from ..util import memoized_property + +class ScopedSessionMixin: + def __call__(self, **kw): ... + def configure(self, **kwargs) -> None: ... + +class scoped_session(ScopedSessionMixin): + session_factory: Any + registry: Any + def __init__(self, session_factory, scopefunc: Any | None = ...) -> None: ... + def remove(self) -> None: ... + def query_property(self, query_cls: Any | None = ...): ... + # dynamically proxied from class Session + bind: Any + identity_map: Any + autoflush: Any + autocommit: bool + @property + def dirty(self): ... + @property + def deleted(self): ... + @property + def new(self): ... + @property + def is_active(self): ... + @property + def no_autoflush(self) -> None: ... + @memoized_property + def info(self): ... + @classmethod + def close_all(cls) -> None: ... + @classmethod + def identity_key(cls, *args, **kwargs): ... + @classmethod + def object_session(cls, instance): ... + def __contains__(self, instance): ... + def __iter__(self): ... + def add(self, instance, _warn: bool = ...) -> None: ... + def add_all(self, instances) -> None: ... + def begin(self, subtransactions: bool = ..., nested: bool = ..., _subtrans: bool = ...): ... + def begin_nested(self): ... + def close(self) -> None: ... + def commit(self) -> None: ... + def connection( + self, bind_arguments: Any | None = ..., close_with_result: bool = ..., execution_options: Any | None = ..., **kw + ): ... + def delete(self, instance) -> None: ... + def execute( + self, + statement, + params: Any | None = ..., + execution_options=..., + bind_arguments: Any | None = ..., + _parent_execute_state: Any | None = ..., + _add_event: Any | None = ..., + **kw, + ): ... + def expire(self, instance, attribute_names: Any | None = ...) -> None: ... + def expire_all(self) -> None: ... + def expunge(self, instance) -> None: ... + def expunge_all(self) -> None: ... + def flush(self, objects: Any | None = ...) -> None: ... + def get( + self, + entity, + ident, + options: Any | None = ..., + populate_existing: bool = ..., + with_for_update: Any | None = ..., + identity_token: Any | None = ..., + ): ... + def get_bind( + self, + mapper: Any | None = ..., + clause: Any | None = ..., + bind: Any | None = ..., + _sa_skip_events: Any | None = ..., + _sa_skip_for_implicit_returning: bool = ..., + ): ... + def is_modified(self, instance, include_collections: bool = ...): ... + def bulk_save_objects( + self, objects, return_defaults: bool = ..., update_changed_only: bool = ..., preserve_order: bool = ... + ): ... + def bulk_insert_mappings(self, mapper, mappings, return_defaults: bool = ..., render_nulls: bool = ...) -> None: ... + def bulk_update_mappings(self, mapper, mappings) -> None: ... + def merge(self, instance, load: bool = ..., options: Any | None = ...): ... + def query(self, *entities, **kwargs): ... + def refresh(self, instance, attribute_names: Any | None = ..., with_for_update: Any | None = ...) -> None: ... + def rollback(self) -> None: ... + def scalar(self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw): ... + def scalars(self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw): ... + +ScopedSession = scoped_session diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi new file mode 100644 index 000000000..58e14f06a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi @@ -0,0 +1,201 @@ +from typing import Any + +from ..engine.util import TransactionalContext +from ..util import MemoizedSlots, memoized_property + +class _SessionClassMethods: + @classmethod + def close_all(cls) -> None: ... + @classmethod + def identity_key(cls, *args, **kwargs): ... + @classmethod + def object_session(cls, instance): ... + +class ORMExecuteState(MemoizedSlots): + session: Any + statement: Any + parameters: Any + local_execution_options: Any + execution_options: Any + bind_arguments: Any + def __init__( + self, session, statement, parameters, execution_options, bind_arguments, compile_state_cls, events_todo + ) -> None: ... + def invoke_statement( + self, + statement: Any | None = ..., + params: Any | None = ..., + execution_options: Any | None = ..., + bind_arguments: Any | None = ..., + ): ... + @property + def bind_mapper(self): ... + @property + def all_mappers(self): ... + @property + def is_orm_statement(self): ... + @property + def is_select(self): ... + @property + def is_insert(self): ... + @property + def is_update(self): ... + @property + def is_delete(self): ... + def update_execution_options(self, **opts) -> None: ... + @property + def lazy_loaded_from(self): ... + @property + def loader_strategy_path(self): ... + @property + def is_column_load(self): ... + @property + def is_relationship_load(self): ... + @property + def load_options(self): ... + @property + def update_delete_options(self): ... + @property + def user_defined_options(self): ... + +class SessionTransaction(TransactionalContext): + session: Any + nested: Any + def __init__(self, session, parent: Any | None = ..., nested: bool = ..., autobegin: bool = ...) -> None: ... + @property + def parent(self): ... + @property + def is_active(self): ... + def connection(self, bindkey, execution_options: Any | None = ..., **kwargs): ... + def prepare(self) -> None: ... + def commit(self, _to_root: bool = ...): ... + def rollback(self, _capture_exception: bool = ..., _to_root: bool = ...): ... + def close(self, invalidate: bool = ...) -> None: ... + +class Session(_SessionClassMethods): + identity_map: Any + bind: Any + future: Any + hash_key: Any + autoflush: Any + expire_on_commit: Any + enable_baked_queries: Any + autocommit: bool + twophase: Any + def __init__( + self, + bind: Any | None = ..., + autoflush: bool = ..., + future: bool = ..., + expire_on_commit: bool = ..., + autocommit: bool = ..., + twophase: bool = ..., + binds: Any | None = ..., + enable_baked_queries: bool = ..., + info: Any | None = ..., + query_cls: Any | None = ..., + ) -> None: ... + connection_callable: Any + def __enter__(self): ... + def __exit__(self, type_, value, traceback) -> None: ... + @property + def transaction(self): ... + def in_transaction(self): ... + def in_nested_transaction(self): ... + def get_transaction(self): ... + def get_nested_transaction(self): ... + @memoized_property + def info(self): ... + def begin(self, subtransactions: bool = ..., nested: bool = ..., _subtrans: bool = ...): ... + def begin_nested(self): ... + def rollback(self) -> None: ... + def commit(self) -> None: ... + def prepare(self) -> None: ... + def connection( + self, bind_arguments: Any | None = ..., close_with_result: bool = ..., execution_options: Any | None = ..., **kw + ): ... + def execute( + self, + statement, + params: Any | None = ..., + execution_options=..., + bind_arguments: Any | None = ..., + _parent_execute_state: Any | None = ..., + _add_event: Any | None = ..., + **kw, + ): ... + def scalar(self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw): ... + def scalars(self, statement, params: Any | None = ..., execution_options=..., bind_arguments: Any | None = ..., **kw): ... + def close(self) -> None: ... + def invalidate(self) -> None: ... + def expunge_all(self) -> None: ... + def bind_mapper(self, mapper, bind) -> None: ... + def bind_table(self, table, bind) -> None: ... + def get_bind( + self, + mapper: Any | None = ..., + clause: Any | None = ..., + bind: Any | None = ..., + _sa_skip_events: Any | None = ..., + _sa_skip_for_implicit_returning: bool = ..., + ): ... + def query(self, *entities, **kwargs): ... + @property + def no_autoflush(self) -> None: ... + def refresh(self, instance, attribute_names: Any | None = ..., with_for_update: Any | None = ...) -> None: ... + def expire_all(self) -> None: ... + def expire(self, instance, attribute_names: Any | None = ...) -> None: ... + def expunge(self, instance) -> None: ... + def add(self, instance, _warn: bool = ...) -> None: ... + def add_all(self, instances) -> None: ... + def delete(self, instance) -> None: ... + def get( + self, + entity, + ident, + options: Any | None = ..., + populate_existing: bool = ..., + with_for_update: Any | None = ..., + identity_token: Any | None = ..., + ): ... + def merge(self, instance, load: bool = ..., options: Any | None = ...): ... + def enable_relationship_loading(self, obj) -> None: ... + def __contains__(self, instance): ... + def __iter__(self): ... + def flush(self, objects: Any | None = ...) -> None: ... + def bulk_save_objects( + self, objects, return_defaults: bool = ..., update_changed_only: bool = ..., preserve_order: bool = ... + ): ... + def bulk_insert_mappings(self, mapper, mappings, return_defaults: bool = ..., render_nulls: bool = ...) -> None: ... + def bulk_update_mappings(self, mapper, mappings) -> None: ... + def is_modified(self, instance, include_collections: bool = ...): ... + @property + def is_active(self): ... + @property + def dirty(self): ... + @property + def deleted(self): ... + @property + def new(self): ... + +class sessionmaker(_SessionClassMethods): + kw: Any + class_: Any + def __init__( + self, + bind: Any | None = ..., + class_=..., + autoflush: bool = ..., + autocommit: bool = ..., + expire_on_commit: bool = ..., + info: Any | None = ..., + **kw, + ) -> None: ... + def begin(self): ... + def __call__(self, **local_kw): ... + def configure(self, **new_kw) -> None: ... + +def close_all_sessions() -> None: ... +def make_transient(instance) -> None: ... +def make_transient_to_detached(instance) -> None: ... +def object_session(instance): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/state.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/state.pyi new file mode 100644 index 000000000..134ff2259 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/state.pyi @@ -0,0 +1,83 @@ +from typing import Any + +from ..util import memoized_property +from . import interfaces + +class InstanceState(interfaces.InspectionAttrInfo): + session_id: Any + key: Any + runid: Any + load_options: Any + load_path: Any + insert_order: Any + modified: bool + expired: bool + is_instance: bool + identity_token: Any + callables: Any + class_: Any + manager: Any + committed_state: Any + expired_attributes: Any + def __init__(self, obj, manager) -> None: ... + @memoized_property + def attrs(self): ... + @property + def transient(self): ... + @property + def pending(self): ... + @property + def deleted(self): ... + @property + def was_deleted(self): ... + @property + def persistent(self): ... + @property + def detached(self): ... + @property + def session(self): ... + @property + def async_session(self): ... + @property + def object(self): ... + @property + def identity(self): ... + @property + def identity_key(self): ... + @memoized_property + def parents(self): ... + @memoized_property + def mapper(self): ... + @property + def has_identity(self): ... + def obj(self) -> None: ... + @property + def dict(self): ... + def get_history(self, key, passive): ... + def get_impl(self, key): ... + @property + def unmodified(self): ... + def unmodified_intersection(self, keys): ... + @property + def unloaded(self): ... + @property + def unloaded_expirable(self): ... + +class AttributeState: + state: Any + key: Any + def __init__(self, state, key) -> None: ... + @property + def loaded_value(self): ... + @property + def value(self): ... + @property + def history(self): ... + def load_history(self): ... + +class PendingCollection: + deleted_items: Any + added_items: Any + def __init__(self) -> None: ... + def append(self, value) -> None: ... + def remove(self, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi new file mode 100644 index 000000000..cb72a2b51 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi @@ -0,0 +1,138 @@ +from typing import Any, NamedTuple + +from .. import util +from .interfaces import LoaderStrategy + +class UninstrumentedColumnLoader(LoaderStrategy): + columns: Any + def __init__(self, parent, strategy_key) -> None: ... + def setup_query( + self, compile_state, query_entity, path, loadopt, adapter, column_collection: Any | None = ..., **kwargs + ) -> None: ... + def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... + +class ColumnLoader(LoaderStrategy): + logger: Any + columns: Any + is_composite: Any + def __init__(self, parent, strategy_key) -> None: ... + def setup_query(self, compile_state, query_entity, path, loadopt, adapter, column_collection, memoized_populators, check_for_adapt: bool = ..., **kwargs) -> None: ... # type: ignore[override] + is_class_level: bool + def init_class_attribute(self, mapper) -> None: ... + def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... + +class ExpressionColumnLoader(ColumnLoader): + logger: Any + def __init__(self, parent, strategy_key) -> None: ... + def setup_query(self, compile_state, query_entity, path, loadopt, adapter, column_collection, memoized_populators, **kwargs) -> None: ... # type: ignore[override] + def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... + is_class_level: bool + def init_class_attribute(self, mapper) -> None: ... + +class DeferredColumnLoader(LoaderStrategy): + logger: Any + raiseload: Any + columns: Any + group: Any + def __init__(self, parent, strategy_key) -> None: ... + def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... + is_class_level: bool + def init_class_attribute(self, mapper) -> None: ... + def setup_query(self, compile_state, query_entity, path, loadopt, adapter, column_collection, memoized_populators, only_load_props: Any | None = ..., **kw) -> None: ... # type: ignore[override] + +class LoadDeferredColumns: + key: Any + raiseload: Any + def __init__(self, key, raiseload: bool = ...) -> None: ... + def __call__(self, state, passive=...): ... + +class AbstractRelationshipLoader(LoaderStrategy): + mapper: Any + entity: Any + target: Any + uselist: Any + def __init__(self, parent, strategy_key) -> None: ... + +class DoNothingLoader(LoaderStrategy): + logger: Any + +class NoLoader(AbstractRelationshipLoader): + logger: Any + is_class_level: bool + def init_class_attribute(self, mapper) -> None: ... + def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... + +class LazyLoader(AbstractRelationshipLoader, util.MemoizedSlots): + logger: Any + is_aliased_class: Any + use_get: Any + def __init__(self, parent, strategy_key) -> None: ... + is_class_level: bool + def init_class_attribute(self, mapper) -> None: ... + def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... + +class LoadLazyAttribute: + key: Any + strategy_key: Any + loadopt: Any + extra_criteria: Any + def __init__(self, key, initiating_strategy, loadopt, extra_criteria) -> None: ... + def __call__(self, state, passive=...): ... + +class PostLoader(AbstractRelationshipLoader): ... + +class ImmediateLoader(PostLoader): + def init_class_attribute(self, mapper) -> None: ... + def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... + +class SubqueryLoader(PostLoader): + logger: Any + join_depth: Any + def __init__(self, parent, strategy_key) -> None: ... + def init_class_attribute(self, mapper) -> None: ... + class _SubqCollections: + session: Any + execution_options: Any + load_options: Any + params: Any + subq: Any + def __init__(self, context, subq) -> None: ... + def get(self, key, default): ... + def loader(self, state, dict_, row) -> None: ... + def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators): ... + +class JoinedLoader(AbstractRelationshipLoader): + logger: Any + join_depth: Any + def __init__(self, parent, strategy_key) -> None: ... + def init_class_attribute(self, mapper) -> None: ... + def setup_query( + self, + compile_state, + query_entity, + path, + loadopt, + adapter, + column_collection: Any | None = ..., + parentmapper: Any | None = ..., + chained_from_outerjoin: bool = ..., + **kwargs, + ) -> None: ... + def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... + +class SelectInLoader(PostLoader, util.MemoizedSlots): + logger: Any + class query_info(NamedTuple): + load_only_child: Any + load_with_join: Any + in_expr: Any + pk_cols: Any + zero_idx: Any + child_lookup_cols: Any + join_depth: Any + omit_join: Any + def __init__(self, parent, strategy_key) -> None: ... + def init_class_attribute(self, mapper) -> None: ... + def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators): ... + +def single_parent_validator(desc, prop): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi new file mode 100644 index 000000000..5fa175bbe --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi @@ -0,0 +1,66 @@ +from typing import Any + +from ..sql.base import Generative +from .interfaces import LoaderOption + +class Load(Generative, LoaderOption): + path: Any + context: Any + local_opts: Any + is_class_strategy: bool + def __init__(self, entity) -> None: ... + @classmethod + def for_existing_path(cls, path): ... + is_opts_only: bool + strategy: Any + propagate_to_loaders: bool + def process_compile_state_replaced_entities(self, compile_state, mapper_entities) -> None: ... + def process_compile_state(self, compile_state) -> None: ... + def options(self, *opts) -> None: ... + def set_relationship_strategy(self, attr, strategy, propagate_to_loaders: bool = ...) -> None: ... + def set_column_strategy(self, attrs, strategy, opts: Any | None = ..., opts_only: bool = ...) -> None: ... + def set_generic_strategy(self, attrs, strategy) -> None: ... + def set_class_strategy(self, strategy, opts) -> None: ... + # added dynamically at runtime + def contains_eager(self, attr, alias: Any | None = ...): ... + def load_only(self, *attrs): ... + def joinedload(self, attr, innerjoin: Any | None = ...): ... + def subqueryload(self, attr): ... + def selectinload(self, attr): ... + def lazyload(self, attr): ... + def immediateload(self, attr): ... + def noload(self, attr): ... + def raiseload(self, attr, sql_only: bool = ...): ... + def defaultload(self, attr): ... + def defer(self, key, raiseload: bool = ...): ... + def undefer(self, key): ... + def undefer_group(self, name): ... + def with_expression(self, key, expression): ... + def selectin_polymorphic(self, classes): ... + +class _UnboundLoad(Load): + path: Any + local_opts: Any + def __init__(self) -> None: ... + +class loader_option: + def __init__(self) -> None: ... + name: Any + fn: Any + def __call__(self, fn): ... + +def contains_eager(loadopt, attr, alias: Any | None = ...): ... +def load_only(loadopt, *attrs): ... +def joinedload(loadopt, attr, innerjoin: Any | None = ...): ... +def subqueryload(loadopt, attr): ... +def selectinload(loadopt, attr): ... +def lazyload(loadopt, attr): ... +def immediateload(loadopt, attr): ... +def noload(loadopt, attr): ... +def raiseload(loadopt, attr, sql_only: bool = ...): ... +def defaultload(loadopt, attr): ... +def defer(loadopt, key, raiseload: bool = ...): ... +def undefer(loadopt, key): ... +def undefer_group(loadopt, name): ... +def with_expression(loadopt, key, expression): ... +def selectin_polymorphic(loadopt, classes): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/sync.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/sync.pyi new file mode 100644 index 000000000..558c9c848 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/sync.pyi @@ -0,0 +1,6 @@ +def populate(source, source_mapper, dest, dest_mapper, synchronize_pairs, uowcommit, flag_cascaded_pks) -> None: ... +def bulk_populate_inherit_keys(source_dict, source_mapper, synchronize_pairs) -> None: ... +def clear(dest, dest_mapper, synchronize_pairs) -> None: ... +def update(source, source_mapper, dest, old_prefix, synchronize_pairs) -> None: ... +def populate_dict(source, source_mapper, dict_, synchronize_pairs) -> None: ... +def source_modified(uowcommit, source, source_mapper, synchronize_pairs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/unitofwork.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/unitofwork.pyi new file mode 100644 index 000000000..5ca959e0e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/unitofwork.pyi @@ -0,0 +1,105 @@ +from typing import Any + +def track_cascade_events(descriptor, prop): ... + +class UOWTransaction: + session: Any + attributes: Any + deps: Any + mappers: Any + presort_actions: Any + postsort_actions: Any + dependencies: Any + states: Any + post_update_states: Any + def __init__(self, session): ... + @property + def has_work(self): ... + def was_already_deleted(self, state): ... + def is_deleted(self, state): ... + def memo(self, key, callable_): ... + def remove_state_actions(self, state) -> None: ... + def get_attribute_history(self, state, key, passive=...): ... + def has_dep(self, processor): ... + def register_preprocessor(self, processor, fromparent) -> None: ... + def register_object( + self, + state, + isdelete: bool = ..., + listonly: bool = ..., + cancel_delete: bool = ..., + operation: Any | None = ..., + prop: Any | None = ..., + ): ... + def register_post_update(self, state, post_update_cols) -> None: ... + def filter_states_for_dep(self, dep, states): ... + def states_for_mapper_hierarchy(self, mapper, isdelete, listonly) -> None: ... + def execute(self): ... + def finalize_flush_changes(self) -> None: ... + +class IterateMappersMixin: ... + +class Preprocess(IterateMappersMixin): + dependency_processor: Any + fromparent: Any + processed: Any + setup_flush_actions: bool + def __init__(self, dependency_processor, fromparent) -> None: ... + def execute(self, uow): ... + +class PostSortRec: + disabled: Any + def __new__(cls, uow, *args): ... + def execute_aggregate(self, uow, recs) -> None: ... + +class ProcessAll(IterateMappersMixin, PostSortRec): + dependency_processor: Any + sort_key: Any + isdelete: Any + fromparent: Any + def __init__(self, uow, dependency_processor, isdelete, fromparent) -> None: ... + def execute(self, uow) -> None: ... + def per_state_flush_actions(self, uow): ... + +class PostUpdateAll(PostSortRec): + mapper: Any + isdelete: Any + sort_key: Any + def __init__(self, uow, mapper, isdelete) -> None: ... + def execute(self, uow) -> None: ... + +class SaveUpdateAll(PostSortRec): + mapper: Any + sort_key: Any + def __init__(self, uow, mapper) -> None: ... + def execute(self, uow) -> None: ... + def per_state_flush_actions(self, uow) -> None: ... + +class DeleteAll(PostSortRec): + mapper: Any + sort_key: Any + def __init__(self, uow, mapper) -> None: ... + def execute(self, uow) -> None: ... + def per_state_flush_actions(self, uow) -> None: ... + +class ProcessState(PostSortRec): + dependency_processor: Any + sort_key: Any + isdelete: Any + state: Any + def __init__(self, uow, dependency_processor, isdelete, state) -> None: ... + def execute_aggregate(self, uow, recs) -> None: ... + +class SaveUpdateState(PostSortRec): + state: Any + mapper: Any + sort_key: Any + def __init__(self, uow, state) -> None: ... + def execute_aggregate(self, uow, recs) -> None: ... + +class DeleteState(PostSortRec): + state: Any + mapper: Any + sort_key: Any + def __init__(self, uow, state) -> None: ... + def execute_aggregate(self, uow, recs) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/util.pyi new file mode 100644 index 000000000..ab249d0af --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/orm/util.pyi @@ -0,0 +1,179 @@ +from typing import Any + +from ..sql import base as sql_base, expression, util as sql_util +from ..sql.annotation import SupportsCloneAnnotations +from .base import ( + InspectionAttr as InspectionAttr, + _class_to_mapper as _class_to_mapper, + _never_set as _never_set, + _none_set as _none_set, + attribute_str as attribute_str, + class_mapper as class_mapper, + instance_str as instance_str, + object_mapper as object_mapper, + object_state as object_state, + state_attribute_str as state_attribute_str, + state_class_str as state_class_str, + state_str as state_str, +) +from .interfaces import CriteriaOption, ORMColumnsClauseRole, ORMEntityColumnsClauseRole, ORMFromClauseRole + +all_cascades: Any + +class CascadeOptions(frozenset[Any]): + save_update: Any + delete: Any + refresh_expire: Any + merge: Any + expunge: Any + delete_orphan: Any + def __new__(cls, value_list): ... + @classmethod + def from_string(cls, arg): ... + +def polymorphic_union(table_map, typecolname, aliasname: str = ..., cast_nulls: bool = ...): ... +def identity_key(*args, **kwargs): ... + +class ORMAdapter(sql_util.ColumnAdapter): + mapper: Any + aliased_class: Any + def __init__( + self, + entity, + equivalents: Any | None = ..., + adapt_required: bool = ..., + allow_label_resolve: bool = ..., + anonymize_labels: bool = ..., + ) -> None: ... + +class AliasedClass: + __name__: Any + def __init__( + self, + mapped_class_or_ac, + alias: Any | None = ..., + name: Any | None = ..., + flat: bool = ..., + adapt_on_names: bool = ..., + with_polymorphic_mappers=..., + with_polymorphic_discriminator: Any | None = ..., + base_alias: Any | None = ..., + use_mapper_path: bool = ..., + represents_outer_join: bool = ..., + ) -> None: ... + def __getattr__(self, key): ... + +class AliasedInsp(ORMEntityColumnsClauseRole, ORMFromClauseRole, sql_base.MemoizedHasCacheKey, InspectionAttr): + mapper: Any + selectable: Any + name: Any + polymorphic_on: Any + represents_outer_join: Any + with_polymorphic_mappers: Any + def __init__( + self, + entity, + inspected, + selectable, + name, + with_polymorphic_mappers, + polymorphic_on, + _base_alias, + _use_mapper_path, + adapt_on_names, + represents_outer_join, + ) -> None: ... + @property + def entity(self): ... + is_aliased_class: bool + def __clause_element__(self): ... + @property + def entity_namespace(self): ... + @property + def class_(self): ... + +class _WrapUserEntity: + subject: Any + def __init__(self, subject) -> None: ... + def __getattribute__(self, name): ... + +class LoaderCriteriaOption(CriteriaOption): + root_entity: Any + entity: Any + deferred_where_criteria: bool + where_criteria: Any + include_aliases: Any + propagate_to_loaders: Any + def __init__( + self, + entity_or_base, + where_criteria, + loader_only: bool = ..., + include_aliases: bool = ..., + propagate_to_loaders: bool = ..., + track_closure_variables: bool = ..., + ) -> None: ... + def process_compile_state_replaced_entities(self, compile_state, mapper_entities): ... + def process_compile_state(self, compile_state) -> None: ... + def get_global_criteria(self, attributes) -> None: ... + +def aliased(element, alias: Any | None = ..., name: Any | None = ..., flat: bool = ..., adapt_on_names: bool = ...): ... +def with_polymorphic( + base, + classes, + selectable: bool = ..., + flat: bool = ..., + polymorphic_on: Any | None = ..., + aliased: bool = ..., + innerjoin: bool = ..., + _use_mapper_path: bool = ..., + _existing_alias: Any | None = ..., +): ... + +class Bundle(ORMColumnsClauseRole, SupportsCloneAnnotations, sql_base.MemoizedHasCacheKey, InspectionAttr): + single_entity: bool + is_clause_element: bool + is_mapper: bool + is_aliased_class: bool + is_bundle: bool + name: Any + exprs: Any + c: Any + def __init__(self, name, *exprs, **kw) -> None: ... + @property + def mapper(self): ... + @property + def entity(self): ... + @property + def entity_namespace(self): ... + columns: Any + def __clause_element__(self): ... + @property + def clauses(self): ... + def label(self, name): ... + def create_row_processor(self, query, procs, labels): ... + +class _ORMJoin(expression.Join): + __visit_name__: Any + inherit_cache: bool + onclause: Any + def __init__( + self, + left, + right, + onclause: Any | None = ..., + isouter: bool = ..., + full: bool = ..., + _left_memo: Any | None = ..., + _right_memo: Any | None = ..., + _extra_criteria=..., + ) -> None: ... + def join(self, right, onclause: Any | None = ..., isouter: bool = ..., full: bool = ..., join_to_left: Any | None = ...): ... + def outerjoin(self, right, onclause: Any | None = ..., full: bool = ..., join_to_left: Any | None = ...): ... + +def join(left, right, onclause: Any | None = ..., isouter: bool = ..., full: bool = ..., join_to_left: Any | None = ...): ... +def outerjoin(left, right, onclause: Any | None = ..., full: bool = ..., join_to_left: Any | None = ...): ... +def with_parent(instance, prop, from_entity: Any | None = ...): ... +def has_identity(object_): ... +def was_deleted(object_): ... +def randomize_unitofwork() -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/__init__.pyi new file mode 100644 index 000000000..977c65ad9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/__init__.pyi @@ -0,0 +1,27 @@ +from .base import Pool as Pool, reset_commit as reset_commit, reset_none as reset_none, reset_rollback as reset_rollback +from .dbapi_proxy import clear_managers as clear_managers, manage as manage +from .impl import ( + AssertionPool as AssertionPool, + AsyncAdaptedQueuePool as AsyncAdaptedQueuePool, + FallbackAsyncAdaptedQueuePool as FallbackAsyncAdaptedQueuePool, + NullPool as NullPool, + QueuePool as QueuePool, + SingletonThreadPool as SingletonThreadPool, + StaticPool as StaticPool, +) + +__all__ = [ + "Pool", + "reset_commit", + "reset_none", + "reset_rollback", + "clear_managers", + "manage", + "AssertionPool", + "NullPool", + "QueuePool", + "AsyncAdaptedQueuePool", + "FallbackAsyncAdaptedQueuePool", + "SingletonThreadPool", + "StaticPool", +] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi new file mode 100644 index 000000000..9936b2d12 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi @@ -0,0 +1,88 @@ +from typing import Any + +from .. import log +from ..util import memoized_property + +reset_rollback: Any +reset_commit: Any +reset_none: Any + +class _ConnDialect: + is_async: bool + def do_rollback(self, dbapi_connection) -> None: ... + def do_commit(self, dbapi_connection) -> None: ... + def do_close(self, dbapi_connection) -> None: ... + def do_ping(self, dbapi_connection) -> None: ... + def get_driver_connection(self, connection): ... + +class _AsyncConnDialect(_ConnDialect): + is_async: bool + +class Pool(log.Identified): + logging_name: Any + echo: Any + def __init__( + self, + creator, + recycle: int = ..., + echo: Any | None = ..., + logging_name: Any | None = ..., + reset_on_return: bool = ..., + events: Any | None = ..., + dialect: Any | None = ..., + pre_ping: bool = ..., + _dispatch: Any | None = ..., + ) -> None: ... + def recreate(self) -> None: ... + def dispose(self) -> None: ... + def connect(self): ... + def status(self) -> None: ... + +class _ConnectionRecord: + finalize_callback: Any + def __init__(self, pool, connect: bool = ...) -> None: ... + fresh: bool + fairy_ref: Any + starttime: Any + dbapi_connection: Any + @property + def driver_connection(self): ... + @property + def connection(self): ... + @connection.setter + def connection(self, value) -> None: ... + @memoized_property + def info(self): ... + @memoized_property + def record_info(self): ... + @classmethod + def checkout(cls, pool): ... + def checkin(self, _fairy_was_created: bool = ...) -> None: ... + @property + def in_use(self): ... + @property + def last_connect_time(self): ... + def close(self) -> None: ... + def invalidate(self, e: Any | None = ..., soft: bool = ...) -> None: ... + def get_connection(self): ... + +class _ConnectionFairy: + dbapi_connection: Any + def __init__(self, dbapi_connection, connection_record, echo) -> None: ... + @property + def driver_connection(self): ... + @property + def connection(self): ... + @connection.setter + def connection(self, value) -> None: ... + @property + def is_valid(self): ... + @memoized_property + def info(self): ... + @property + def record_info(self): ... + def invalidate(self, e: Any | None = ..., soft: bool = ...) -> None: ... + def cursor(self, *args, **kwargs): ... + def __getattr__(self, key): ... + def detach(self) -> None: ... + def close(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/dbapi_proxy.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/dbapi_proxy.pyi new file mode 100644 index 000000000..909b78d85 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/dbapi_proxy.pyi @@ -0,0 +1,19 @@ +from typing import Any + +proxies: Any + +def manage(module, **params): ... +def clear_managers() -> None: ... + +class _DBProxy: + module: Any + kw: Any + poolclass: Any + pools: Any + def __init__(self, module, poolclass=..., **kw) -> None: ... + def close(self) -> None: ... + def __del__(self) -> None: ... + def __getattr__(self, key): ... + def get_pool(self, *args, **kw): ... + def connect(self, *args, **kw): ... + def dispose(self, *args, **kw) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/events.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/events.pyi new file mode 100644 index 000000000..8a5dde542 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/events.pyi @@ -0,0 +1,13 @@ +from .. import event + +class PoolEvents(event.Events): + def connect(self, dbapi_connection, connection_record) -> None: ... + def first_connect(self, dbapi_connection, connection_record) -> None: ... + def checkout(self, dbapi_connection, connection_record, connection_proxy) -> None: ... + def checkin(self, dbapi_connection, connection_record) -> None: ... + def reset(self, dbapi_connection, connection_record) -> None: ... + def invalidate(self, dbapi_connection, connection_record, exception) -> None: ... + def soft_invalidate(self, dbapi_connection, connection_record, exception) -> None: ... + def close(self, dbapi_connection, connection_record) -> None: ... + def detach(self, dbapi_connection, connection_record) -> None: ... + def close_detached(self, dbapi_connection) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi new file mode 100644 index 000000000..2646cafd5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi @@ -0,0 +1,46 @@ +from typing import Any + +from ..util import memoized_property +from .base import Pool + +class QueuePool(Pool): + def __init__( + self, creator, pool_size: int = ..., max_overflow: int = ..., timeout: float = ..., use_lifo: bool = ..., **kw + ) -> None: ... + def recreate(self): ... + def dispose(self) -> None: ... + def status(self): ... + def size(self): ... + def timeout(self): ... + def checkedin(self): ... + def overflow(self): ... + def checkedout(self): ... + +class AsyncAdaptedQueuePool(QueuePool): ... +class FallbackAsyncAdaptedQueuePool(AsyncAdaptedQueuePool): ... + +class NullPool(Pool): + def status(self): ... + def recreate(self): ... + def dispose(self) -> None: ... + +class SingletonThreadPool(Pool): + size: Any + def __init__(self, creator, pool_size: int = ..., **kw) -> None: ... + def recreate(self): ... + def dispose(self) -> None: ... + def status(self): ... + def connect(self): ... + +class StaticPool(Pool): + @memoized_property + def connection(self): ... + def status(self): ... + def dispose(self) -> None: ... + def recreate(self): ... + +class AssertionPool(Pool): + def __init__(self, *args, **kw) -> None: ... + def status(self): ... + def dispose(self) -> None: ... + def recreate(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/processors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/processors.pyi new file mode 100644 index 000000000..be304e64e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/processors.pyi @@ -0,0 +1,7 @@ +from typing import Any + +def str_to_datetime_processor_factory(regexp, type_): ... +def py_fallback(): ... +def to_unicode_processor_factory(encoding, errors: Any | None = ...): ... +def to_conditional_unicode_processor_factory(encoding, errors: Any | None = ...): ... +def to_decimal_processor_factory(target_class, scale): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/schema.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/schema.pyi new file mode 100644 index 000000000..ef2cc1ed9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/schema.pyi @@ -0,0 +1,51 @@ +from .sql.base import SchemaVisitor as SchemaVisitor +from .sql.ddl import ( + DDL as DDL, + AddConstraint as AddConstraint, + CreateColumn as CreateColumn, + CreateIndex as CreateIndex, + CreateSchema as CreateSchema, + CreateSequence as CreateSequence, + CreateTable as CreateTable, + DDLBase as DDLBase, + DDLElement as DDLElement, + DropColumnComment as DropColumnComment, + DropConstraint as DropConstraint, + DropIndex as DropIndex, + DropSchema as DropSchema, + DropSequence as DropSequence, + DropTable as DropTable, + DropTableComment as DropTableComment, + SetColumnComment as SetColumnComment, + SetTableComment as SetTableComment, + _CreateDropBase as _CreateDropBase, + _DDLCompiles as _DDLCompiles, + _DropView as _DropView, + sort_tables as sort_tables, + sort_tables_and_constraints as sort_tables_and_constraints, +) +from .sql.naming import conv as conv +from .sql.schema import ( + BLANK_SCHEMA as BLANK_SCHEMA, + CheckConstraint as CheckConstraint, + Column as Column, + ColumnCollectionConstraint as ColumnCollectionConstraint, + ColumnCollectionMixin as ColumnCollectionMixin, + ColumnDefault as ColumnDefault, + Computed as Computed, + Constraint as Constraint, + DefaultClause as DefaultClause, + DefaultGenerator as DefaultGenerator, + FetchedValue as FetchedValue, + ForeignKey as ForeignKey, + ForeignKeyConstraint as ForeignKeyConstraint, + Identity as Identity, + Index as Index, + MetaData as MetaData, + PrimaryKeyConstraint as PrimaryKeyConstraint, + SchemaItem as SchemaItem, + Sequence as Sequence, + Table as Table, + ThreadLocalMetaData as ThreadLocalMetaData, + UniqueConstraint as UniqueConstraint, +) diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/__init__.pyi new file mode 100644 index 000000000..625094b1e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/__init__.pyi @@ -0,0 +1,91 @@ +from . import sqltypes as sqltypes +from .base import Executable as Executable +from .compiler import ( + COLLECT_CARTESIAN_PRODUCTS as COLLECT_CARTESIAN_PRODUCTS, + FROM_LINTING as FROM_LINTING, + NO_LINTING as NO_LINTING, + WARN_LINTING as WARN_LINTING, +) +from .expression import ( + LABEL_STYLE_DEFAULT as LABEL_STYLE_DEFAULT, + LABEL_STYLE_DISAMBIGUATE_ONLY as LABEL_STYLE_DISAMBIGUATE_ONLY, + LABEL_STYLE_NONE as LABEL_STYLE_NONE, + LABEL_STYLE_TABLENAME_PLUS_COL as LABEL_STYLE_TABLENAME_PLUS_COL, + Alias as Alias, + ClauseElement as ClauseElement, + ColumnCollection as ColumnCollection, + ColumnElement as ColumnElement, + CompoundSelect as CompoundSelect, + Delete as Delete, + False_ as False_, + FromClause as FromClause, + Insert as Insert, + Join as Join, + LambdaElement as LambdaElement, + Select as Select, + Selectable as Selectable, + StatementLambdaElement as StatementLambdaElement, + Subquery as Subquery, + TableClause as TableClause, + TableSample as TableSample, + True_ as True_, + Update as Update, + Values as Values, + alias as alias, + all_ as all_, + and_ as and_, + any_ as any_, + asc as asc, + between as between, + bindparam as bindparam, + case as case, + cast as cast, + collate as collate, + column as column, + cte as cte, + delete as delete, + desc as desc, + distinct as distinct, + except_ as except_, + except_all as except_all, + exists as exists, + extract as extract, + false as false, + func as func, + funcfilter as funcfilter, + insert as insert, + intersect as intersect, + intersect_all as intersect_all, + join as join, + label as label, + lambda_stmt as lambda_stmt, + lateral as lateral, + literal as literal, + literal_column as literal_column, + modifier as modifier, + not_ as not_, + null as null, + nulls_first as nulls_first, + nulls_last as nulls_last, + nullsfirst as nullsfirst, + nullslast as nullslast, + or_ as or_, + outerjoin as outerjoin, + outparam as outparam, + over as over, + quoted_name as quoted_name, + select as select, + subquery as subquery, + table as table, + tablesample as tablesample, + text as text, + true as true, + tuple_ as tuple_, + type_coerce as type_coerce, + union as union, + union_all as union_all, + update as update, + values as values, + within_group as within_group, +) +from .visitors import ClauseVisitor as ClauseVisitor diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/annotation.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/annotation.pyi new file mode 100644 index 000000000..202412831 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/annotation.pyi @@ -0,0 +1,19 @@ +from typing import Any + +EMPTY_ANNOTATIONS: Any + +class SupportsAnnotations: ... +class SupportsCloneAnnotations(SupportsAnnotations): ... +class SupportsWrappingAnnotations(SupportsAnnotations): ... + +class Annotated: + def __new__(cls, *args): ... + __dict__: Any + def __init__(self, element, values) -> None: ... + def __reduce__(self): ... + def __hash__(self): ... + def __eq__(self, other): ... + @property + def entity_namespace(self): ... + +annotated_classes: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi new file mode 100644 index 000000000..80036a800 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi @@ -0,0 +1,158 @@ +from collections.abc import MutableMapping +from typing import Any + +from .. import util +from ..util import HasMemoized, hybridmethod, memoized_property +from . import roles +from .traversals import ( + HasCacheKey as HasCacheKey, + HasCopyInternals as HasCopyInternals, + MemoizedHasCacheKey as MemoizedHasCacheKey, +) +from .visitors import ClauseVisitor + +coercions: Any +elements: Any +type_api: Any +PARSE_AUTOCOMMIT: Any +NO_ARG: Any + +class Immutable: + def unique_params(self, *optionaldict, **kwargs) -> None: ... + def params(self, *optionaldict, **kwargs) -> None: ... + +class SingletonConstant(Immutable): + def __new__(cls, *arg, **kw): ... + +class _DialectArgView(MutableMapping[Any, Any]): + obj: Any + def __init__(self, obj) -> None: ... + def __getitem__(self, key): ... + def __setitem__(self, key, value) -> None: ... + def __delitem__(self, key) -> None: ... + def __len__(self): ... + def __iter__(self): ... + +class _DialectArgDict(MutableMapping[Any, Any]): + def __init__(self) -> None: ... + def __len__(self): ... + def __iter__(self): ... + def __getitem__(self, key): ... + def __setitem__(self, key, value) -> None: ... + def __delitem__(self, key) -> None: ... + +class DialectKWArgs: + @classmethod + def argument_for(cls, dialect_name, argument_name, default) -> None: ... + @memoized_property + def dialect_kwargs(self): ... + @property + def kwargs(self): ... + @memoized_property + def dialect_options(self): ... + +class CompileState: + plugins: Any + @classmethod + def create_for_statement(cls, statement, compiler, **kw): ... + statement: Any + def __init__(self, statement, compiler, **kw) -> None: ... + @classmethod + def get_plugin_class(cls, statement): ... + @classmethod + def plugin_for(cls, plugin_name, visit_name): ... + +class Generative(HasMemoized): ... +class InPlaceGenerative(HasMemoized): ... +class HasCompileState(Generative): ... + +class _MetaOptions(type): + def __init__(cls, classname, bases, dict_) -> None: ... + def __add__(self, other): ... + +class Options: + def __init__(self, **kw) -> None: ... + def __add__(self, other): ... + def __eq__(self, other): ... + @classmethod + def isinstance(cls, klass): ... + @hybridmethod + def add_to_element(self, name, value): ... + @classmethod + def safe_merge(cls, other): ... + @classmethod + def from_execution_options(cls, key, attrs, exec_options, statement_exec_options): ... + +class CacheableOptions(Options, HasCacheKey): ... + +class ExecutableOption(HasCopyInternals): + __visit_name__: str + +class Executable(roles.StatementRole, Generative): + supports_execution: bool + is_select: bool + is_update: bool + is_insert: bool + is_text: bool + is_delete: bool + is_dml: bool + def options(self, *options) -> None: ... + def execution_options(self, **kw) -> None: ... + def get_execution_options(self): ... + def execute(self, *multiparams, **params): ... + def scalar(self, *multiparams, **params): ... + @property + def bind(self): ... + +class prefix_anon_map(dict[Any, Any]): + def __missing__(self, key): ... + +class SchemaEventTarget: ... + +class SchemaVisitor(ClauseVisitor): + __traverse_options__: Any + +class ColumnCollection: + def __init__(self, columns: Any | None = ...) -> None: ... + def keys(self): ... + def values(self): ... + def items(self): ... + def __bool__(self): ... + def __len__(self): ... + def __iter__(self): ... + def __getitem__(self, key): ... + def __getattr__(self, key): ... + def __contains__(self, key): ... + def compare(self, other): ... + def __eq__(self, other): ... + def get(self, key, default: Any | None = ...): ... + def __setitem__(self, key, value) -> None: ... + def __delitem__(self, key) -> None: ... + def __setattr__(self, key, obj) -> None: ... + def clear(self) -> None: ... + def remove(self, column) -> None: ... + def update(self, iter_) -> None: ... + __hash__: Any + def add(self, column, key: Any | None = ...) -> None: ... + def contains_column(self, col): ... + def as_immutable(self): ... + def corresponding_column(self, column, require_embedded: bool = ...): ... + +class DedupeColumnCollection(ColumnCollection): + def add(self, column, key: Any | None = ...) -> None: ... + def extend(self, iter_) -> None: ... + def remove(self, column) -> None: ... + def replace(self, column) -> None: ... + +class ImmutableColumnCollection(util.ImmutableContainer, ColumnCollection): + def __init__(self, collection) -> None: ... + add: Any + extend: Any + remove: Any + +class ColumnSet(util.ordered_column_set): + def contains_column(self, col): ... + def extend(self, cols) -> None: ... + def __add__(self, other): ... + def __eq__(self, other): ... + def __hash__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi new file mode 100644 index 000000000..79a24e98d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi @@ -0,0 +1,66 @@ +from typing import Any + +from . import roles + +elements: Any +lambdas: Any +schema: Any +selectable: Any +sqltypes: Any +traversals: Any + +def expect(role, element, apply_propagate_attrs: Any | None = ..., argname: Any | None = ..., post_inspect: bool = ..., **kw): ... +def expect_as_key(role, element, **kw): ... +def expect_col_expression_collection(role, expressions) -> None: ... + +class RoleImpl: + name: Any + def __init__(self, role_class) -> None: ... + +class _Deannotate: ... +class _StringOnly: ... +class _ReturnsStringKey: ... +class _ColumnCoercions: ... +class _NoTextCoercion: ... +class _CoerceLiterals: ... +class LiteralValueImpl(RoleImpl): ... +class _SelectIsNotFrom: ... +class HasCacheKeyImpl(RoleImpl): ... +class ExecutableOptionImpl(RoleImpl): ... +class ExpressionElementImpl(_ColumnCoercions, RoleImpl): ... +class BinaryElementImpl(ExpressionElementImpl, RoleImpl): ... +class InElementImpl(RoleImpl): ... +class OnClauseImpl(_CoerceLiterals, _ColumnCoercions, RoleImpl): ... +class WhereHavingImpl(_CoerceLiterals, _ColumnCoercions, RoleImpl): ... +class StatementOptionImpl(_CoerceLiterals, RoleImpl): ... +class ColumnArgumentImpl(_NoTextCoercion, RoleImpl): ... +class ColumnArgumentOrKeyImpl(_ReturnsStringKey, RoleImpl): ... +class StrAsPlainColumnImpl(_CoerceLiterals, RoleImpl): ... +class ByOfImpl(_CoerceLiterals, _ColumnCoercions, RoleImpl, roles.ByOfRole): ... +class OrderByImpl(ByOfImpl, RoleImpl): ... +class GroupByImpl(ByOfImpl, RoleImpl): ... +class DMLColumnImpl(_ReturnsStringKey, RoleImpl): ... +class ConstExprImpl(RoleImpl): ... +class TruncatedLabelImpl(_StringOnly, RoleImpl): ... +class DDLExpressionImpl(_Deannotate, _CoerceLiterals, RoleImpl): ... +class DDLConstraintColumnImpl(_Deannotate, _ReturnsStringKey, RoleImpl): ... +class DDLReferredColumnImpl(DDLConstraintColumnImpl): ... +class LimitOffsetImpl(RoleImpl): ... +class LabeledColumnExprImpl(ExpressionElementImpl): ... +class ColumnsClauseImpl(_SelectIsNotFrom, _CoerceLiterals, RoleImpl): ... +class ReturnsRowsImpl(RoleImpl): ... +class StatementImpl(_CoerceLiterals, RoleImpl): ... +class SelectStatementImpl(_NoTextCoercion, RoleImpl): ... +class HasCTEImpl(ReturnsRowsImpl): ... +class IsCTEImpl(RoleImpl): ... +class JoinTargetImpl(RoleImpl): ... +class FromClauseImpl(_SelectIsNotFrom, _NoTextCoercion, RoleImpl): ... +class StrictFromClauseImpl(FromClauseImpl): ... +class AnonymizedFromClauseImpl(StrictFromClauseImpl): ... +class DMLTableImpl(_SelectIsNotFrom, _NoTextCoercion, RoleImpl): ... +class DMLSelectImpl(_NoTextCoercion, RoleImpl): ... +class CompoundElementImpl(_NoTextCoercion, RoleImpl): ... + +cls: Any +name: Any +impl: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi new file mode 100644 index 000000000..eb96eab18 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi @@ -0,0 +1,472 @@ +from typing import Any, NamedTuple + +from ..util import memoized_property +from . import elements + +RESERVED_WORDS: Any +LEGAL_CHARACTERS: Any +LEGAL_CHARACTERS_PLUS_SPACE: Any +ILLEGAL_INITIAL_CHARACTERS: Any +FK_ON_DELETE: Any +FK_ON_UPDATE: Any +FK_INITIALLY: Any +BIND_PARAMS: Any +BIND_PARAMS_ESC: Any +BIND_TEMPLATES: Any +OPERATORS: Any +FUNCTIONS: Any +EXTRACT_MAP: Any +COMPOUND_KEYWORDS: Any +RM_RENDERED_NAME: int +RM_NAME: int +RM_OBJECTS: int +RM_TYPE: int + +class ExpandedState(NamedTuple): + statement: Any + additional_parameters: Any + processors: Any + positiontup: Any + parameter_expansion: Any + +NO_LINTING: Any +COLLECT_CARTESIAN_PRODUCTS: Any +WARN_LINTING: Any +FROM_LINTING: Any + +class FromLinter: + def lint(self, start: Any | None = ...): ... + def warn(self) -> None: ... + +class Compiled: + schema_translate_map: Any + execution_options: Any + compile_state: Any + cache_key: Any + dialect: Any + preparer: Any + statement: Any + can_execute: Any + string: Any + def __init__( + self, dialect, statement, schema_translate_map: Any | None = ..., render_schema_translate: bool = ..., compile_kwargs=... + ) -> None: ... + def visit_unsupported_compilation(self, element, err) -> None: ... + @property + def sql_compiler(self) -> None: ... + def process(self, obj, **kwargs): ... + def construct_params(self, params: Any | None = ..., extracted_parameters: Any | None = ...) -> None: ... + @property + def params(self): ... + +class TypeCompiler: + ensure_kwarg: str + dialect: Any + def __init__(self, dialect) -> None: ... + def process(self, type_, **kw): ... + def visit_unsupported_compilation(self, element, err, **kw) -> None: ... + +class _CompileLabel(elements.ColumnElement): + __visit_name__: str + element: Any + name: Any + def __init__(self, col, name, alt_names=...) -> None: ... + @property + def proxy_set(self): ... + @property + def type(self): ... + def self_group(self, **kw): ... + +class SQLCompiler(Compiled): + extract_map: Any + compound_keywords: Any + isdelete: bool + isinsert: bool + isupdate: bool + isplaintext: bool + returning: Any + returning_precedes_values: bool + render_table_with_column_in_update_from: bool + ansi_bind_rules: bool + insert_single_values_expr: Any + literal_execute_params: Any + post_compile_params: Any + escaped_bind_names: Any + has_out_parameters: bool + insert_prefetch: Any + update_prefetch: Any + postfetch_lastrowid: bool + positiontup: Any + inline: bool + column_keys: Any + cache_key: Any + for_executemany: Any + linting: Any + binds: Any + bind_names: Any + stack: Any + positional: Any + bindtemplate: Any + ctes: Any + label_length: Any + anon_map: Any + truncated_names: Any + def __init__( + self, + dialect, + statement, + cache_key: Any | None = ..., + column_keys: Any | None = ..., + for_executemany: bool = ..., + linting=..., + **kwargs, + ) -> None: ... + @property + def current_executable(self): ... + @property + def prefetch(self): ... + def is_subquery(self): ... + @property + def sql_compiler(self): ... + def construct_params(self, params: Any | None = ..., _group_number: Any | None = ..., _check: bool = ..., extracted_parameters: Any | None = ...): ... # type: ignore[override] + @property + def params(self): ... + def default_from(self): ... + def visit_grouping(self, grouping, asfrom: bool = ..., **kwargs): ... + def visit_select_statement_grouping(self, grouping, **kwargs): ... + def visit_label_reference(self, element, within_columns_clause: bool = ..., **kwargs): ... + def visit_textual_label_reference(self, element, within_columns_clause: bool = ..., **kwargs): ... + def visit_label( + self, + label, + add_to_result_map: Any | None = ..., + within_label_clause: bool = ..., + within_columns_clause: bool = ..., + render_label_as_label: Any | None = ..., + result_map_targets=..., + **kw, + ): ... + def visit_lambda_element(self, element, **kw): ... + def visit_column( + self, column, add_to_result_map: Any | None = ..., include_table: bool = ..., result_map_targets=..., **kwargs + ): ... + def visit_collation(self, element, **kw): ... + def visit_fromclause(self, fromclause, **kwargs): ... + def visit_index(self, index, **kwargs): ... + def visit_typeclause(self, typeclause, **kw): ... + def post_process_text(self, text): ... + def escape_literal_column(self, text): ... + def visit_textclause(self, textclause, add_to_result_map: Any | None = ..., **kw): ... + def visit_textual_select(self, taf, compound_index: Any | None = ..., asfrom: bool = ..., **kw): ... + def visit_null(self, expr, **kw): ... + def visit_true(self, expr, **kw): ... + def visit_false(self, expr, **kw): ... + def visit_tuple(self, clauselist, **kw): ... + def visit_clauselist(self, clauselist, **kw): ... + def visit_case(self, clause, **kwargs): ... + def visit_type_coerce(self, type_coerce, **kw): ... + def visit_cast(self, cast, **kwargs): ... + def visit_over(self, over, **kwargs): ... + def visit_withingroup(self, withingroup, **kwargs): ... + def visit_funcfilter(self, funcfilter, **kwargs): ... + def visit_extract(self, extract, **kwargs): ... + def visit_scalar_function_column(self, element, **kw): ... + def visit_function(self, func, add_to_result_map: Any | None = ..., **kwargs): ... + def visit_next_value_func(self, next_value, **kw): ... + def visit_sequence(self, sequence, **kw) -> None: ... + def function_argspec(self, func, **kwargs): ... + compile_state: Any + def visit_compound_select(self, cs, asfrom: bool = ..., compound_index: Any | None = ..., **kwargs): ... + def visit_unary(self, unary, add_to_result_map: Any | None = ..., result_map_targets=..., **kw): ... + def visit_is_true_unary_operator(self, element, operator, **kw): ... + def visit_is_false_unary_operator(self, element, operator, **kw): ... + def visit_not_match_op_binary(self, binary, operator, **kw): ... + def visit_not_in_op_binary(self, binary, operator, **kw): ... + def visit_empty_set_op_expr(self, type_, expand_op): ... + def visit_empty_set_expr(self, element_types) -> None: ... + def visit_binary( + self, + binary, + override_operator: Any | None = ..., + eager_grouping: bool = ..., + from_linter: Any | None = ..., + lateral_from_linter: Any | None = ..., + **kw, + ): ... + def visit_function_as_comparison_op_binary(self, element, operator, **kw): ... + def visit_mod_binary(self, binary, operator, **kw): ... + def visit_custom_op_binary(self, element, operator, **kw): ... + def visit_custom_op_unary_operator(self, element, operator, **kw): ... + def visit_custom_op_unary_modifier(self, element, operator, **kw): ... + def visit_contains_op_binary(self, binary, operator, **kw): ... + def visit_not_contains_op_binary(self, binary, operator, **kw): ... + def visit_startswith_op_binary(self, binary, operator, **kw): ... + def visit_not_startswith_op_binary(self, binary, operator, **kw): ... + def visit_endswith_op_binary(self, binary, operator, **kw): ... + def visit_not_endswith_op_binary(self, binary, operator, **kw): ... + def visit_like_op_binary(self, binary, operator, **kw): ... + def visit_not_like_op_binary(self, binary, operator, **kw): ... + def visit_ilike_op_binary(self, binary, operator, **kw): ... + def visit_not_ilike_op_binary(self, binary, operator, **kw): ... + def visit_between_op_binary(self, binary, operator, **kw): ... + def visit_not_between_op_binary(self, binary, operator, **kw): ... + def visit_regexp_match_op_binary(self, binary, operator, **kw) -> None: ... + def visit_not_regexp_match_op_binary(self, binary, operator, **kw) -> None: ... + def visit_regexp_replace_op_binary(self, binary, operator, **kw) -> None: ... + def visit_bindparam( + self, + bindparam, + within_columns_clause: bool = ..., + literal_binds: bool = ..., + skip_bind_expression: bool = ..., + literal_execute: bool = ..., + render_postcompile: bool = ..., + **kwargs, + ): ... + def render_literal_bindparam(self, bindparam, render_literal_value=..., **kw): ... + def render_literal_value(self, value, type_): ... + def bindparam_string( + self, + name, + positional_names: Any | None = ..., + post_compile: bool = ..., + expanding: bool = ..., + escaped_from: Any | None = ..., + **kw, + ): ... + execution_options: Any + ctes_recursive: bool + def visit_cte( + self, + cte, + asfrom: bool = ..., + ashint: bool = ..., + fromhints: Any | None = ..., + visiting_cte: Any | None = ..., + from_linter: Any | None = ..., + **kwargs, + ): ... + def visit_table_valued_alias(self, element, **kw): ... + def visit_table_valued_column(self, element, **kw): ... + def visit_alias( + self, + alias, + asfrom: bool = ..., + ashint: bool = ..., + iscrud: bool = ..., + fromhints: Any | None = ..., + subquery: bool = ..., + lateral: bool = ..., + enclosing_alias: Any | None = ..., + from_linter: Any | None = ..., + **kwargs, + ): ... + def visit_subquery(self, subquery, **kw): ... + def visit_lateral(self, lateral_, **kw): ... + def visit_tablesample(self, tablesample, asfrom: bool = ..., **kw): ... + def visit_values(self, element, asfrom: bool = ..., from_linter: Any | None = ..., **kw): ... + def get_render_as_alias_suffix(self, alias_name_text): ... + def format_from_hint_text(self, sqltext, table, hint, iscrud): ... + def get_select_hint_text(self, byfroms) -> None: ... + def get_from_hint_text(self, table, text) -> None: ... + def get_crud_hint_text(self, table, text) -> None: ... + def get_statement_hint_text(self, hint_texts): ... + translate_select_structure: Any + def visit_select( + self, + select_stmt, + asfrom: bool = ..., + insert_into: bool = ..., + fromhints: Any | None = ..., + compound_index: Any | None = ..., + select_wraps_for: Any | None = ..., + lateral: bool = ..., + from_linter: Any | None = ..., + **kwargs, + ): ... + def get_cte_preamble(self, recursive): ... + def get_select_precolumns(self, select, **kw): ... + def group_by_clause(self, select, **kw): ... + def order_by_clause(self, select, **kw): ... + def for_update_clause(self, select, **kw): ... + def returning_clause(self, stmt, returning_cols) -> None: ... + def limit_clause(self, select, **kw): ... + def fetch_clause(self, select, **kw): ... + def visit_table( + self, + table, + asfrom: bool = ..., + iscrud: bool = ..., + ashint: bool = ..., + fromhints: Any | None = ..., + use_schema: bool = ..., + from_linter: Any | None = ..., + **kwargs, + ): ... + def visit_join(self, join, asfrom: bool = ..., from_linter: Any | None = ..., **kwargs): ... + def visit_insert(self, insert_stmt, **kw): ... + def update_limit_clause(self, update_stmt) -> None: ... + def update_tables_clause(self, update_stmt, from_table, extra_froms, **kw): ... + def update_from_clause(self, update_stmt, from_table, extra_froms, from_hints, **kw) -> None: ... + def visit_update(self, update_stmt, **kw): ... + def delete_extra_from_clause(self, update_stmt, from_table, extra_froms, from_hints, **kw) -> None: ... + def delete_table_clause(self, delete_stmt, from_table, extra_froms): ... + def visit_delete(self, delete_stmt, **kw): ... + def visit_savepoint(self, savepoint_stmt): ... + def visit_rollback_to_savepoint(self, savepoint_stmt): ... + def visit_release_savepoint(self, savepoint_stmt): ... + +class StrSQLCompiler(SQLCompiler): + def visit_unsupported_compilation(self, element, err, **kw): ... + def visit_getitem_binary(self, binary, operator, **kw): ... + def visit_json_getitem_op_binary(self, binary, operator, **kw): ... + def visit_json_path_getitem_op_binary(self, binary, operator, **kw): ... + def visit_sequence(self, seq, **kw): ... + def returning_clause(self, stmt, returning_cols): ... + def update_from_clause(self, update_stmt, from_table, extra_froms, from_hints, **kw): ... + def delete_extra_from_clause(self, update_stmt, from_table, extra_froms, from_hints, **kw): ... + def visit_empty_set_expr(self, type_): ... + def get_from_hint_text(self, table, text): ... + def visit_regexp_match_op_binary(self, binary, operator, **kw): ... + def visit_not_regexp_match_op_binary(self, binary, operator, **kw): ... + def visit_regexp_replace_op_binary(self, binary, operator, **kw): ... + +class DDLCompiler(Compiled): + @memoized_property + def sql_compiler(self): ... + @memoized_property + def type_compiler(self): ... + def construct_params(self, params: Any | None = ..., extracted_parameters: Any | None = ...) -> None: ... + def visit_ddl(self, ddl, **kwargs): ... + def visit_create_schema(self, create, **kw): ... + def visit_drop_schema(self, drop, **kw): ... + def visit_create_table(self, create, **kw): ... + def visit_create_column(self, create, first_pk: bool = ..., **kw): ... + def create_table_constraints(self, table, _include_foreign_key_constraints: Any | None = ..., **kw): ... + def visit_drop_table(self, drop, **kw): ... + def visit_drop_view(self, drop, **kw): ... + def visit_create_index(self, create, include_schema: bool = ..., include_table_schema: bool = ..., **kw): ... + def visit_drop_index(self, drop, **kw): ... + def visit_add_constraint(self, create, **kw): ... + def visit_set_table_comment(self, create, **kw): ... + def visit_drop_table_comment(self, drop, **kw): ... + def visit_set_column_comment(self, create, **kw): ... + def visit_drop_column_comment(self, drop, **kw): ... + def get_identity_options(self, identity_options): ... + def visit_create_sequence(self, create, prefix: Any | None = ..., **kw): ... + def visit_drop_sequence(self, drop, **kw): ... + def visit_drop_constraint(self, drop, **kw): ... + def get_column_specification(self, column, **kwargs): ... + def create_table_suffix(self, table): ... + def post_create_table(self, table): ... + def get_column_default_string(self, column): ... + def visit_table_or_column_check_constraint(self, constraint, **kw): ... + def visit_check_constraint(self, constraint, **kw): ... + def visit_column_check_constraint(self, constraint, **kw): ... + def visit_primary_key_constraint(self, constraint, **kw): ... + def visit_foreign_key_constraint(self, constraint, **kw): ... + def define_constraint_remote_table(self, constraint, table, preparer): ... + def visit_unique_constraint(self, constraint, **kw): ... + def define_constraint_cascades(self, constraint): ... + def define_constraint_deferrability(self, constraint): ... + def define_constraint_match(self, constraint): ... + def visit_computed_column(self, generated, **kw): ... + def visit_identity_column(self, identity, **kw): ... + +class GenericTypeCompiler(TypeCompiler): + def visit_FLOAT(self, type_, **kw): ... + def visit_REAL(self, type_, **kw): ... + def visit_NUMERIC(self, type_, **kw): ... + def visit_DECIMAL(self, type_, **kw): ... + def visit_INTEGER(self, type_, **kw): ... + def visit_SMALLINT(self, type_, **kw): ... + def visit_BIGINT(self, type_, **kw): ... + def visit_TIMESTAMP(self, type_, **kw): ... + def visit_DATETIME(self, type_, **kw): ... + def visit_DATE(self, type_, **kw): ... + def visit_TIME(self, type_, **kw): ... + def visit_CLOB(self, type_, **kw): ... + def visit_NCLOB(self, type_, **kw): ... + def visit_CHAR(self, type_, **kw): ... + def visit_NCHAR(self, type_, **kw): ... + def visit_VARCHAR(self, type_, **kw): ... + def visit_NVARCHAR(self, type_, **kw): ... + def visit_TEXT(self, type_, **kw): ... + def visit_BLOB(self, type_, **kw): ... + def visit_BINARY(self, type_, **kw): ... + def visit_VARBINARY(self, type_, **kw): ... + def visit_BOOLEAN(self, type_, **kw): ... + def visit_large_binary(self, type_, **kw): ... + def visit_boolean(self, type_, **kw): ... + def visit_time(self, type_, **kw): ... + def visit_datetime(self, type_, **kw): ... + def visit_date(self, type_, **kw): ... + def visit_big_integer(self, type_, **kw): ... + def visit_small_integer(self, type_, **kw): ... + def visit_integer(self, type_, **kw): ... + def visit_real(self, type_, **kw): ... + def visit_float(self, type_, **kw): ... + def visit_numeric(self, type_, **kw): ... + def visit_string(self, type_, **kw): ... + def visit_unicode(self, type_, **kw): ... + def visit_text(self, type_, **kw): ... + def visit_unicode_text(self, type_, **kw): ... + def visit_enum(self, type_, **kw): ... + def visit_null(self, type_, **kw) -> None: ... + def visit_type_decorator(self, type_, **kw): ... + def visit_user_defined(self, type_, **kw): ... + +class StrSQLTypeCompiler(GenericTypeCompiler): + def process(self, type_, **kw): ... + def __getattr__(self, key): ... + def visit_null(self, type_, **kw): ... + def visit_user_defined(self, type_, **kw): ... + +class IdentifierPreparer: + reserved_words: Any + legal_characters: Any + illegal_initial_characters: Any + schema_for_object: Any + dialect: Any + initial_quote: Any + final_quote: Any + escape_quote: Any + escape_to_quote: Any + omit_schema: Any + quote_case_sensitive_collations: Any + def __init__( + self, + dialect, + initial_quote: str = ..., + final_quote: Any | None = ..., + escape_quote: str = ..., + quote_case_sensitive_collations: bool = ..., + omit_schema: bool = ..., + ) -> None: ... + def validate_sql_phrase(self, element, reg): ... + def quote_identifier(self, value): ... + def quote_schema(self, schema, force: Any | None = ...): ... + def quote(self, ident, force: Any | None = ...): ... + def format_collation(self, collation_name): ... + def format_sequence(self, sequence, use_schema: bool = ...): ... + def format_label(self, label, name: Any | None = ...): ... + def format_alias(self, alias, name: Any | None = ...): ... + def format_savepoint(self, savepoint, name: Any | None = ...): ... + def format_constraint(self, constraint, _alembic_quote: bool = ...): ... + def truncate_and_render_index_name(self, name, _alembic_quote: bool = ...): ... + def truncate_and_render_constraint_name(self, name, _alembic_quote: bool = ...): ... + def format_index(self, index): ... + def format_table(self, table, use_schema: bool = ..., name: Any | None = ...): ... + def format_schema(self, name): ... + def format_label_name(self, name, anon_map: Any | None = ...): ... + def format_column( + self, + column, + use_table: bool = ..., + name: Any | None = ..., + table_name: Any | None = ..., + use_schema: bool = ..., + anon_map: Any | None = ..., + ): ... + def format_table_seq(self, table, use_schema: bool = ...): ... + def unformat_identifiers(self, identifiers): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/crud.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/crud.pyi new file mode 100644 index 000000000..0e263aca4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/crud.pyi @@ -0,0 +1,15 @@ +from typing import Any + +from . import elements + +REQUIRED: Any + +class _multiparam_column(elements.ColumnElement): + index: Any + key: Any + original: Any + default: Any + type: Any + def __init__(self, original, index) -> None: ... + def compare(self, other, **kw) -> None: ... + def __eq__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi new file mode 100644 index 000000000..4dba7ea2b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi @@ -0,0 +1,139 @@ +from typing import Any + +from . import roles +from .base import Executable, SchemaVisitor +from .elements import ClauseElement + +class _DDLCompiles(ClauseElement): ... + +class DDLElement(roles.DDLRole, Executable, _DDLCompiles): + target: Any + on: Any + dialect: Any + callable_: Any + def execute(self, bind: Any | None = ..., target: Any | None = ...): ... # type: ignore[override] + def against(self, target) -> None: ... + state: Any + def execute_if(self, dialect: Any | None = ..., callable_: Any | None = ..., state: Any | None = ...) -> None: ... + def __call__(self, target, bind, **kw): ... + bind: Any + +class DDL(DDLElement): + __visit_name__: str + statement: Any + context: Any + def __init__(self, statement, context: Any | None = ..., bind: Any | None = ...) -> None: ... + +class _CreateDropBase(DDLElement): + element: Any + bind: Any + if_exists: Any + if_not_exists: Any + def __init__( + self, element, bind: Any | None = ..., if_exists: bool = ..., if_not_exists: bool = ..., _legacy_bind: Any | None = ... + ) -> None: ... + @property + def stringify_dialect(self): ... + +class CreateSchema(_CreateDropBase): + __visit_name__: str + quote: Any + def __init__(self, name, quote: Any | None = ..., **kw) -> None: ... + +class DropSchema(_CreateDropBase): + __visit_name__: str + quote: Any + cascade: Any + def __init__(self, name, quote: Any | None = ..., cascade: bool = ..., **kw) -> None: ... + +class CreateTable(_CreateDropBase): + __visit_name__: str + columns: Any + include_foreign_key_constraints: Any + def __init__( + self, element, bind: Any | None = ..., include_foreign_key_constraints: Any | None = ..., if_not_exists: bool = ... + ) -> None: ... + +class _DropView(_CreateDropBase): + __visit_name__: str + +class CreateColumn(_DDLCompiles): + __visit_name__: str + element: Any + def __init__(self, element) -> None: ... + +class DropTable(_CreateDropBase): + __visit_name__: str + def __init__(self, element, bind: Any | None = ..., if_exists: bool = ...) -> None: ... + +class CreateSequence(_CreateDropBase): + __visit_name__: str + +class DropSequence(_CreateDropBase): + __visit_name__: str + +class CreateIndex(_CreateDropBase): + __visit_name__: str + def __init__(self, element, bind: Any | None = ..., if_not_exists: bool = ...) -> None: ... + +class DropIndex(_CreateDropBase): + __visit_name__: str + def __init__(self, element, bind: Any | None = ..., if_exists: bool = ...) -> None: ... + +class AddConstraint(_CreateDropBase): + __visit_name__: str + def __init__(self, element, *args, **kw) -> None: ... + +class DropConstraint(_CreateDropBase): + __visit_name__: str + cascade: Any + def __init__(self, element, cascade: bool = ..., **kw) -> None: ... + +class SetTableComment(_CreateDropBase): + __visit_name__: str + +class DropTableComment(_CreateDropBase): + __visit_name__: str + +class SetColumnComment(_CreateDropBase): + __visit_name__: str + +class DropColumnComment(_CreateDropBase): + __visit_name__: str + +class DDLBase(SchemaVisitor): + connection: Any + def __init__(self, connection) -> None: ... + +class SchemaGenerator(DDLBase): + checkfirst: Any + tables: Any + preparer: Any + dialect: Any + memo: Any + def __init__(self, dialect, connection, checkfirst: bool = ..., tables: Any | None = ..., **kwargs) -> None: ... + def visit_metadata(self, metadata) -> None: ... + def visit_table( + self, table, create_ok: bool = ..., include_foreign_key_constraints: Any | None = ..., _is_metadata_operation: bool = ... + ) -> None: ... + def visit_foreign_key_constraint(self, constraint) -> None: ... + def visit_sequence(self, sequence, create_ok: bool = ...) -> None: ... + def visit_index(self, index, create_ok: bool = ...) -> None: ... + +class SchemaDropper(DDLBase): + checkfirst: Any + tables: Any + preparer: Any + dialect: Any + memo: Any + def __init__(self, dialect, connection, checkfirst: bool = ..., tables: Any | None = ..., **kwargs) -> None: ... + def visit_metadata(self, metadata): ... + def visit_index(self, index, drop_ok: bool = ...) -> None: ... + def visit_table(self, table, drop_ok: bool = ..., _is_metadata_operation: bool = ..., _ignore_sequences=...) -> None: ... + def visit_foreign_key_constraint(self, constraint) -> None: ... + def visit_sequence(self, sequence, drop_ok: bool = ...) -> None: ... + +def sort_tables(tables, skip_fn: Any | None = ..., extra_dependencies: Any | None = ...): ... +def sort_tables_and_constraints( + tables, filter_fn: Any | None = ..., extra_dependencies: Any | None = ..., _warn_for_cycles: bool = ... +): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/default_comparator.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/default_comparator.pyi new file mode 100644 index 000000000..ac514fdf0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/default_comparator.pyi @@ -0,0 +1,3 @@ +from typing import Any + +operator_lookup: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi new file mode 100644 index 000000000..ee31b2343 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi @@ -0,0 +1,111 @@ +from typing import Any + +from . import roles +from .base import CompileState, DialectKWArgs, Executable, HasCompileState +from .elements import ClauseElement +from .selectable import HasCTE, HasPrefixes, ReturnsRows + +class DMLState(CompileState): + isupdate: bool + isdelete: bool + isinsert: bool + def __init__(self, statement, compiler, **kw) -> None: ... + @property + def dml_table(self): ... + +class InsertDMLState(DMLState): + isinsert: bool + include_table_with_column_exprs: bool + statement: Any + def __init__(self, statement, compiler, **kw) -> None: ... + +class UpdateDMLState(DMLState): + isupdate: bool + include_table_with_column_exprs: bool + statement: Any + is_multitable: Any + def __init__(self, statement, compiler, **kw) -> None: ... + +class DeleteDMLState(DMLState): + isdelete: bool + statement: Any + def __init__(self, statement, compiler, **kw) -> None: ... + +class UpdateBase(roles.DMLRole, HasCTE, HasCompileState, DialectKWArgs, HasPrefixes, ReturnsRows, Executable, ClauseElement): + __visit_name__: str + named_with_column: bool + is_dml: bool + def params(self, *arg, **kw) -> None: ... + def with_dialect_options(self, **opt) -> None: ... + bind: Any + def returning(self, *cols) -> None: ... + @property + def exported_columns(self): ... + def with_hint(self, text, selectable: Any | None = ..., dialect_name: str = ...) -> None: ... + +class ValuesBase(UpdateBase): + __visit_name__: str + select: Any + table: Any + def __init__(self, table, values, prefixes) -> None: ... + def values(self, *args, **kwargs) -> None: ... + def return_defaults(self, *cols) -> None: ... + +class Insert(ValuesBase): + __visit_name__: str + select: Any + include_insert_from_select_defaults: bool + is_insert: bool + def __init__( + self, + table, + values: Any | None = ..., + inline: bool = ..., + bind: Any | None = ..., + prefixes: Any | None = ..., + returning: Any | None = ..., + return_defaults: bool = ..., + **dialect_kw, + ) -> None: ... + def inline(self) -> None: ... + def from_select(self, names, select, include_defaults: bool = ...) -> None: ... + +class DMLWhereBase: + def where(self, *whereclause) -> None: ... + def filter(self, *criteria): ... + def filter_by(self, **kwargs): ... + @property + def whereclause(self): ... + +class Update(DMLWhereBase, ValuesBase): + __visit_name__: str + is_update: bool + def __init__( + self, + table, + whereclause: Any | None = ..., + values: Any | None = ..., + inline: bool = ..., + bind: Any | None = ..., + prefixes: Any | None = ..., + returning: Any | None = ..., + return_defaults: bool = ..., + preserve_parameter_order: bool = ..., + **dialect_kw, + ) -> None: ... + def ordered_values(self, *args) -> None: ... + def inline(self) -> None: ... + +class Delete(DMLWhereBase, UpdateBase): + __visit_name__: str + is_delete: bool + table: Any + def __init__( + self, + table, + whereclause: Any | None = ..., + bind: Any | None = ..., + returning: Any | None = ..., + prefixes: Any | None = ..., + **dialect_kw, + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi new file mode 100644 index 000000000..ef7345e32 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi @@ -0,0 +1,452 @@ +from typing import Any + +from .. import util +from ..util import HasMemoized, memoized_property +from . import operators, roles +from .annotation import Annotated, SupportsWrappingAnnotations +from .base import Executable, Immutable, SingletonConstant +from .traversals import HasCopyInternals, MemoizedHasCacheKey +from .visitors import Traversible + +def collate(expression, collation): ... +def between(expr, lower_bound, upper_bound, symmetric: bool = ...): ... +def literal(value, type_: Any | None = ...): ... +def outparam(key, type_: Any | None = ...): ... +def not_(clause): ... + +class ClauseElement(roles.SQLRole, SupportsWrappingAnnotations, MemoizedHasCacheKey, HasCopyInternals, Traversible): + __visit_name__: str + supports_execution: bool + stringify_dialect: str + bind: Any + description: Any + is_clause_element: bool + is_selectable: bool + @property + def entity_namespace(self) -> None: ... + def unique_params(self, *optionaldict, **kwargs): ... + def params(self, *optionaldict, **kwargs): ... + def compare(self, other, **kw): ... + def self_group(self, against: Any | None = ...): ... + def compile(self, bind: Any | None = ..., dialect: Any | None = ..., **kw): ... + def __invert__(self): ... + def __bool__(self) -> None: ... + __nonzero__: Any + +class ColumnElement( + roles.ColumnArgumentOrKeyRole, + roles.StatementOptionRole, + roles.WhereHavingRole, + roles.BinaryElementRole, + roles.OrderByRole, + roles.ColumnsClauseRole, + roles.LimitOffsetRole, + roles.DMLColumnRole, + roles.DDLConstraintColumnRole, + roles.DDLExpressionRole, + operators.ColumnOperators, + ClauseElement, +): + __visit_name__: str + primary_key: bool + foreign_keys: Any + key: Any + def self_group(self, against: Any | None = ...): ... + @memoized_property + def type(self): ... + @HasMemoized.memoized_attribute + def comparator(self): ... + def __getattr__(self, key): ... + def operate(self, op, *other, **kwargs): ... + def reverse_operate(self, op, other, **kwargs): ... + @property + def expression(self): ... + @memoized_property + def base_columns(self): ... + @memoized_property + def proxy_set(self): ... + def shares_lineage(self, othercolumn): ... + def cast(self, type_): ... + def label(self, name): ... + @property + def anon_label(self): ... + @property + def anon_key_label(self): ... + +class WrapsColumnExpression: + @property + def wrapped_column_expression(self) -> None: ... + +class BindParameter(roles.InElementRole, ColumnElement): + __visit_name__: str + inherit_cache: bool + key: Any + unique: Any + value: Any + callable: Any + isoutparam: Any + required: Any + expanding: Any + expand_op: Any + literal_execute: Any + type: Any + def __init__( + self, + key, + value=..., + type_: Any | None = ..., + unique: bool = ..., + required=..., + quote: Any | None = ..., + callable_: Any | None = ..., + expanding: bool = ..., + isoutparam: bool = ..., + literal_execute: bool = ..., + _compared_to_operator: Any | None = ..., + _compared_to_type: Any | None = ..., + _is_crud: bool = ..., + ) -> None: ... + @property + def effective_value(self): ... + def render_literal_execute(self): ... + +class TypeClause(ClauseElement): + __visit_name__: str + type: Any + def __init__(self, type_) -> None: ... + +class TextClause( + roles.DDLConstraintColumnRole, + roles.DDLExpressionRole, + roles.StatementOptionRole, + roles.WhereHavingRole, + roles.OrderByRole, + roles.FromClauseRole, + roles.SelectStatementRole, + roles.BinaryElementRole, + roles.InElementRole, + Executable, + ClauseElement, +): + __visit_name__: str + def __and__(self, other): ... + key: Any + text: Any + def __init__(self, text, bind: Any | None = ...): ... + def bindparams(self, *binds, **names_to_values) -> None: ... + def columns(self, *cols, **types): ... + @property + def type(self): ... + @property + def comparator(self): ... + def self_group(self, against: Any | None = ...): ... + +class Null(SingletonConstant, roles.ConstExprRole, ColumnElement): + __visit_name__: str + @memoized_property + def type(self): ... + +class False_(SingletonConstant, roles.ConstExprRole, ColumnElement): + __visit_name__: str + @memoized_property + def type(self): ... + +class True_(SingletonConstant, roles.ConstExprRole, ColumnElement): + __visit_name__: str + @memoized_property + def type(self): ... + +class ClauseList(roles.InElementRole, roles.OrderByRole, roles.ColumnsClauseRole, roles.DMLColumnRole, ClauseElement): + __visit_name__: str + operator: Any + group: Any + group_contents: Any + clauses: Any + def __init__(self, *clauses, **kwargs) -> None: ... + def __iter__(self): ... + def __len__(self): ... + def append(self, clause) -> None: ... + def self_group(self, against: Any | None = ...): ... + +class BooleanClauseList(ClauseList, ColumnElement): + __visit_name__: str + inherit_cache: bool + def __init__(self, *arg, **kw) -> None: ... + @classmethod + def and_(cls, *clauses): ... + @classmethod + def or_(cls, *clauses): ... + def self_group(self, against: Any | None = ...): ... + +and_: Any +or_: Any + +class Tuple(ClauseList, ColumnElement): + __visit_name__: str + type: Any + def __init__(self, *clauses, **kw) -> None: ... + def self_group(self, against: Any | None = ...): ... + +class Case(ColumnElement): + __visit_name__: str + value: Any + type: Any + whens: Any + else_: Any + def __init__(self, *whens, **kw) -> None: ... + +def literal_column(text, type_: Any | None = ...): ... + +class Cast(WrapsColumnExpression, ColumnElement): + __visit_name__: str + type: Any + clause: Any + typeclause: Any + def __init__(self, expression, type_) -> None: ... + @property + def wrapped_column_expression(self): ... + +class TypeCoerce(WrapsColumnExpression, ColumnElement): + __visit_name__: str + type: Any + clause: Any + def __init__(self, expression, type_) -> None: ... + @HasMemoized.memoized_attribute + def typed_expression(self): ... + @property + def wrapped_column_expression(self): ... + def self_group(self, against: Any | None = ...): ... + +class Extract(ColumnElement): + __visit_name__: str + type: Any + field: Any + expr: Any + def __init__(self, field, expr, **kwargs) -> None: ... + +class _label_reference(ColumnElement): + __visit_name__: str + element: Any + def __init__(self, element) -> None: ... + +class _textual_label_reference(ColumnElement): + __visit_name__: str + element: Any + def __init__(self, element) -> None: ... + +class UnaryExpression(ColumnElement): + __visit_name__: str + operator: Any + modifier: Any + element: Any + type: Any + wraps_column_expression: Any + def __init__( + self, + element, + operator: Any | None = ..., + modifier: Any | None = ..., + type_: Any | None = ..., + wraps_column_expression: bool = ..., + ) -> None: ... + def self_group(self, against: Any | None = ...): ... + +class CollectionAggregate(UnaryExpression): + inherit_cache: bool + def operate(self, op, *other, **kwargs): ... + def reverse_operate(self, op, other, **kwargs) -> None: ... + +class AsBoolean(WrapsColumnExpression, UnaryExpression): + inherit_cache: bool + element: Any + type: Any + operator: Any + negate: Any + modifier: Any + wraps_column_expression: bool + def __init__(self, element, operator, negate) -> None: ... + @property + def wrapped_column_expression(self): ... + def self_group(self, against: Any | None = ...): ... + +class BinaryExpression(ColumnElement): + __visit_name__: str + left: Any + right: Any + operator: Any + type: Any + negate: Any + modifiers: Any + def __init__( + self, left, right, operator, type_: Any | None = ..., negate: Any | None = ..., modifiers: Any | None = ... + ) -> None: ... + def __bool__(self): ... + __nonzero__: Any + @property + def is_comparison(self): ... + def self_group(self, against: Any | None = ...): ... + +class Slice(ColumnElement): + __visit_name__: str + start: Any + stop: Any + step: Any + type: Any + def __init__(self, start, stop, step, _name: Any | None = ...) -> None: ... + def self_group(self, against: Any | None = ...): ... + +class IndexExpression(BinaryExpression): + inherit_cache: bool + +class GroupedElement(ClauseElement): + __visit_name__: str + def self_group(self, against: Any | None = ...): ... + +class Grouping(GroupedElement, ColumnElement): + element: Any + type: Any + def __init__(self, element) -> None: ... + def __getattr__(self, attr): ... + +RANGE_UNBOUNDED: Any +RANGE_CURRENT: Any + +class Over(ColumnElement): + __visit_name__: str + order_by: Any + partition_by: Any + element: Any + range_: Any + rows: Any + def __init__( + self, + element, + partition_by: Any | None = ..., + order_by: Any | None = ..., + range_: Any | None = ..., + rows: Any | None = ..., + ) -> None: ... + def __reduce__(self): ... + @memoized_property + def type(self): ... + +class WithinGroup(ColumnElement): + __visit_name__: str + order_by: Any + element: Any + def __init__(self, element, *order_by) -> None: ... + def __reduce__(self): ... + def over( + self, partition_by: Any | None = ..., order_by: Any | None = ..., range_: Any | None = ..., rows: Any | None = ... + ): ... + @memoized_property + def type(self): ... + +class FunctionFilter(ColumnElement): + __visit_name__: str + criterion: Any + func: Any + def __init__(self, func, *criterion) -> None: ... + def filter(self, *criterion): ... + def over( + self, partition_by: Any | None = ..., order_by: Any | None = ..., range_: Any | None = ..., rows: Any | None = ... + ): ... + def self_group(self, against: Any | None = ...): ... + @memoized_property + def type(self): ... + +class Label(roles.LabeledColumnExprRole, ColumnElement): + __visit_name__: str + name: Any + key: Any + def __init__(self, name, element, type_: Any | None = ...) -> None: ... + def __reduce__(self): ... + @memoized_property + def type(self): ... + @HasMemoized.memoized_attribute + def element(self): ... + def self_group(self, against: Any | None = ...): ... + @property + def primary_key(self): ... + @property + def foreign_keys(self): ... + +class NamedColumn(ColumnElement): + is_literal: bool + table: Any + @memoized_property + def description(self): ... + +class ColumnClause(roles.DDLReferredColumnRole, roles.LabeledColumnExprRole, roles.StrAsPlainColumnRole, Immutable, NamedColumn): + table: Any + is_literal: bool + __visit_name__: str + onupdate: Any + default: Any + server_default: Any + server_onupdate: Any + key: Any + type: Any + def __init__(self, text, type_: Any | None = ..., is_literal: bool = ..., _selectable: Any | None = ...) -> None: ... + def get_children(self, column_tables: bool = ..., **kw): ... # type: ignore[override] + @property + def entity_namespace(self): ... + +class TableValuedColumn(NamedColumn): + __visit_name__: str + scalar_alias: Any + key: Any + type: Any + def __init__(self, scalar_alias, type_) -> None: ... + +class CollationClause(ColumnElement): + __visit_name__: str + collation: Any + def __init__(self, collation) -> None: ... + +class _IdentifiedClause(Executable, ClauseElement): + __visit_name__: str + ident: Any + def __init__(self, ident) -> None: ... + +class SavepointClause(_IdentifiedClause): + __visit_name__: str + inherit_cache: bool + +class RollbackToSavepointClause(_IdentifiedClause): + __visit_name__: str + inherit_cache: bool + +class ReleaseSavepointClause(_IdentifiedClause): + __visit_name__: str + inherit_cache: bool + +class quoted_name(util.MemoizedSlots, util.text_type): + quote: Any + def __new__(cls, value, quote): ... + def __reduce__(self): ... + +class AnnotatedColumnElement(Annotated): + def __init__(self, element, values) -> None: ... + @memoized_property + def name(self): ... + @memoized_property + def table(self): ... + @memoized_property + def key(self): ... + @memoized_property + def info(self): ... + +class _truncated_label(quoted_name): + def __new__(cls, value, quote: Any | None = ...): ... + def __reduce__(self): ... + def apply_map(self, map_): ... + +class conv(_truncated_label): ... + +class _anonymous_label(_truncated_label): + @classmethod + def safe_construct(cls, seed, body, enclosing_label: Any | None = ..., sanitize_key: bool = ...): ... + def __add__(self, other): ... + def __radd__(self, other): ... + def apply_map(self, map_): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/events.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/events.pyi new file mode 100644 index 000000000..11765c6af --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/events.pyi @@ -0,0 +1,10 @@ +from .. import event + +class DDLEvents(event.Events): + def before_create(self, target, connection, **kw) -> None: ... + def after_create(self, target, connection, **kw) -> None: ... + def before_drop(self, target, connection, **kw) -> None: ... + def after_drop(self, target, connection, **kw) -> None: ... + def before_parent_attach(self, target, parent) -> None: ... + def after_parent_attach(self, target, parent) -> None: ... + def column_reflect(self, inspector, table, column_info) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/expression.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/expression.pyi new file mode 100644 index 000000000..79df689ce --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/expression.pyi @@ -0,0 +1,201 @@ +from typing import Any + +from .base import PARSE_AUTOCOMMIT as PARSE_AUTOCOMMIT, ColumnCollection as ColumnCollection, Executable as Executable +from .dml import Delete as Delete, Insert as Insert, Update as Update, UpdateBase as UpdateBase, ValuesBase as ValuesBase +from .elements import ( + BinaryExpression as BinaryExpression, + BindParameter as BindParameter, + BooleanClauseList as BooleanClauseList, + Case as Case, + Cast as Cast, + ClauseElement as ClauseElement, + ClauseList as ClauseList, + CollectionAggregate as CollectionAggregate, + ColumnClause as ColumnClause, + ColumnElement as ColumnElement, + Extract as Extract, + False_ as False_, + FunctionFilter as FunctionFilter, + Grouping as Grouping, + Label as Label, + Null as Null, + Over as Over, + ReleaseSavepointClause as ReleaseSavepointClause, + RollbackToSavepointClause as RollbackToSavepointClause, + SavepointClause as SavepointClause, + TextClause as TextClause, + True_ as True_, + Tuple as Tuple, + TypeClause as TypeClause, + TypeCoerce as TypeCoerce, + UnaryExpression as UnaryExpression, + WithinGroup as WithinGroup, + _truncated_label as _truncated_label, + between as between, + collate as collate, + literal as literal, + literal_column as literal_column, + not_ as not_, + outparam as outparam, + quoted_name as quoted_name, +) +from .functions import Function as Function, FunctionElement as FunctionElement, func as func, modifier as modifier +from .lambdas import LambdaElement as LambdaElement, StatementLambdaElement as StatementLambdaElement, lambda_stmt as lambda_stmt +from .operators import ColumnOperators as ColumnOperators, Operators as Operators, custom_op as custom_op +from .selectable import ( + CTE as CTE, + LABEL_STYLE_DEFAULT as LABEL_STYLE_DEFAULT, + LABEL_STYLE_DISAMBIGUATE_ONLY as LABEL_STYLE_DISAMBIGUATE_ONLY, + LABEL_STYLE_NONE as LABEL_STYLE_NONE, + LABEL_STYLE_TABLENAME_PLUS_COL as LABEL_STYLE_TABLENAME_PLUS_COL, + Alias as Alias, + AliasedReturnsRows as AliasedReturnsRows, + CompoundSelect as CompoundSelect, + Exists as Exists, + FromClause as FromClause, + FromGrouping as FromGrouping, + GenerativeSelect as GenerativeSelect, + HasCTE as HasCTE, + HasPrefixes as HasPrefixes, + HasSuffixes as HasSuffixes, + Join as Join, + Lateral as Lateral, + ReturnsRows as ReturnsRows, + ScalarSelect as ScalarSelect, + Select as Select, + Selectable as Selectable, + SelectBase as SelectBase, + Subquery as Subquery, + TableClause as TableClause, + TableSample as TableSample, + TableValuedAlias as TableValuedAlias, + TextAsFrom as TextAsFrom, + TextualSelect as TextualSelect, + Values as Values, + subquery as subquery, +) +from .traversals import CacheKey as CacheKey +from .visitors import Visitable as Visitable + +__all__ = [ + "Alias", + "AliasedReturnsRows", + "any_", + "all_", + "CacheKey", + "ClauseElement", + "ColumnCollection", + "ColumnElement", + "CompoundSelect", + "Delete", + "FromClause", + "Insert", + "Join", + "Lateral", + "LambdaElement", + "StatementLambdaElement", + "Select", + "Selectable", + "TableClause", + "TableValuedAlias", + "Update", + "Values", + "alias", + "and_", + "asc", + "between", + "bindparam", + "case", + "cast", + "column", + "custom_op", + "cte", + "delete", + "desc", + "distinct", + "except_", + "except_all", + "exists", + "extract", + "func", + "modifier", + "collate", + "insert", + "intersect", + "intersect_all", + "join", + "label", + "lateral", + "lambda_stmt", + "literal", + "literal_column", + "not_", + "null", + "nulls_first", + "nulls_last", + "or_", + "outparam", + "outerjoin", + "over", + "select", + "table", + "text", + "tuple_", + "type_coerce", + "quoted_name", + "union", + "union_all", + "update", + "quoted_name", + "within_group", + "Subquery", + "TableSample", + "tablesample", + "values", +] + +all_: Any +any_: Any +and_: Any +alias: Any +tablesample: Any +lateral: Any +or_: Any +bindparam: Any +select: Any +text: Any +table: Any +column: Any +over: Any +within_group: Any +label: Any +case: Any +cast: Any +cte: Any +values: Any +extract: Any +tuple_: Any +except_: Any +except_all: Any +intersect: Any +intersect_all: Any +union: Any +union_all: Any +exists: Any +nulls_first: Any +nullsfirst: Any +nulls_last: Any +nullslast: Any +asc: Any +desc: Any +distinct: Any +type_coerce: Any +true: Any +false: Any +null: Any +join: Any +outerjoin: Any +insert: Any +update: Any +delete: Any +funcfilter: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi new file mode 100644 index 000000000..fe0c3ef16 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi @@ -0,0 +1,223 @@ +from typing import Any + +from ..util import HasMemoized +from .base import Executable, Generative +from .elements import BinaryExpression, ColumnElement, NamedColumn +from .selectable import FromClause +from .visitors import TraversibleType + +def register_function(identifier, fn, package: str = ...) -> None: ... + +class FunctionElement(Executable, ColumnElement, FromClause, Generative): # type: ignore[misc] + packagenames: Any + clause_expr: Any + def __init__(self, *clauses, **kwargs) -> None: ... + def scalar_table_valued(self, name, type_: Any | None = ...): ... + def table_valued(self, *expr, **kw): ... + def column_valued(self, name: Any | None = ...): ... + @property + def columns(self): ... + @property + def exported_columns(self): ... + @HasMemoized.memoized_attribute + def clauses(self): ... + def over( + self, partition_by: Any | None = ..., order_by: Any | None = ..., rows: Any | None = ..., range_: Any | None = ... + ): ... + def within_group(self, *order_by): ... + def filter(self, *criterion): ... + def as_comparison(self, left_index, right_index): ... + def within_group_type(self, within_group) -> None: ... + def alias(self, name: Any | None = ...): ... # type: ignore[override] + def select(self): ... + def scalar(self): ... + def execute(self): ... + def self_group(self, against: Any | None = ...): ... + @property + def entity_namespace(self): ... + +class FunctionAsBinary(BinaryExpression): + sql_function: Any + left_index: Any + right_index: Any + operator: Any + type: Any + negate: Any + modifiers: Any + def __init__(self, fn, left_index, right_index) -> None: ... + @property + def left(self): ... + @left.setter + def left(self, value) -> None: ... + @property + def right(self): ... + @right.setter + def right(self, value) -> None: ... + +class ScalarFunctionColumn(NamedColumn): + __visit_name__: str + is_literal: bool + table: Any + fn: Any + name: Any + type: Any + def __init__(self, fn, name, type_: Any | None = ...) -> None: ... + +class _FunctionGenerator: + opts: Any + def __init__(self, **opts) -> None: ... + def __getattr__(self, name): ... + def __call__(self, *c, **kwargs): ... + +func: Any +modifier: Any + +class Function(FunctionElement): + __visit_name__: str + type: Any + packagenames: Any + name: Any + def __init__(self, name, *clauses, **kw) -> None: ... + +class _GenericMeta(TraversibleType): + def __init__(cls, clsname, bases, clsdict) -> None: ... + +class GenericFunction: + name: Any + identifier: Any + coerce_arguments: bool + inherit_cache: bool + packagenames: Any + clause_expr: Any + type: Any + def __init__(self, *args, **kwargs) -> None: ... + +class next_value(GenericFunction): + type: Any + name: str + sequence: Any + def __init__(self, seq, **kw) -> None: ... + def compare(self, other, **kw): ... + +class AnsiFunction(GenericFunction): + inherit_cache: bool + def __init__(self, *args, **kwargs) -> None: ... + +class ReturnTypeFromArgs(GenericFunction): + inherit_cache: bool + def __init__(self, *args, **kwargs) -> None: ... + +class coalesce(ReturnTypeFromArgs): + inherit_cache: bool + +class max(ReturnTypeFromArgs): + inherit_cache: bool + +class min(ReturnTypeFromArgs): + inherit_cache: bool + +class sum(ReturnTypeFromArgs): + inherit_cache: bool + +class now(GenericFunction): + type: Any + inherit_cache: bool + +class concat(GenericFunction): + type: Any + inherit_cache: bool + +class char_length(GenericFunction): + type: Any + inherit_cache: bool + def __init__(self, arg, **kwargs) -> None: ... + +class random(GenericFunction): + inherit_cache: bool + +class count(GenericFunction): + type: Any + inherit_cache: bool + def __init__(self, expression: Any | None = ..., **kwargs) -> None: ... + +class current_date(AnsiFunction): + type: Any + inherit_cache: bool + +class current_time(AnsiFunction): + type: Any + inherit_cache: bool + +class current_timestamp(AnsiFunction): + type: Any + inherit_cache: bool + +class current_user(AnsiFunction): + type: Any + inherit_cache: bool + +class localtime(AnsiFunction): + type: Any + inherit_cache: bool + +class localtimestamp(AnsiFunction): + type: Any + inherit_cache: bool + +class session_user(AnsiFunction): + type: Any + inherit_cache: bool + +class sysdate(AnsiFunction): + type: Any + inherit_cache: bool + +class user(AnsiFunction): + type: Any + inherit_cache: bool + +class array_agg(GenericFunction): + type: Any + inherit_cache: bool + def __init__(self, *args, **kwargs) -> None: ... + +class OrderedSetAgg(GenericFunction): + array_for_multi_clause: bool + inherit_cache: bool + def within_group_type(self, within_group): ... + +class mode(OrderedSetAgg): + inherit_cache: bool + +class percentile_cont(OrderedSetAgg): + array_for_multi_clause: bool + inherit_cache: bool + +class percentile_disc(OrderedSetAgg): + array_for_multi_clause: bool + inherit_cache: bool + +class rank(GenericFunction): + type: Any + inherit_cache: bool + +class dense_rank(GenericFunction): + type: Any + inherit_cache: bool + +class percent_rank(GenericFunction): + type: Any + inherit_cache: bool + +class cume_dist(GenericFunction): + type: Any + inherit_cache: bool + +class cube(GenericFunction): + inherit_cache: bool + +class rollup(GenericFunction): + inherit_cache: bool + +class grouping_sets(GenericFunction): + inherit_cache: bool diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi new file mode 100644 index 000000000..6f65d391b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi @@ -0,0 +1,113 @@ +from typing import Any + +from . import elements, roles +from .base import Options +from .operators import ColumnOperators + +class LambdaOptions(Options): + enable_tracking: bool + track_closure_variables: bool + track_on: Any + global_track_bound_values: bool + track_bound_values: bool + lambda_cache: Any + +def lambda_stmt( + lmb, + enable_tracking: bool = ..., + track_closure_variables: bool = ..., + track_on: Any | None = ..., + global_track_bound_values: bool = ..., + track_bound_values: bool = ..., + lambda_cache: Any | None = ..., +): ... + +class LambdaElement(elements.ClauseElement): + __visit_name__: str + parent_lambda: Any + fn: Any + role: Any + tracker_key: Any + opts: Any + def __init__(self, fn, role, opts=..., apply_propagate_attrs: Any | None = ...) -> None: ... + def __getattr__(self, key): ... + +class DeferredLambdaElement(LambdaElement): + lambda_args: Any + def __init__(self, fn, role, opts=..., lambda_args=...) -> None: ... + +class StatementLambdaElement(roles.AllowsLambdaRole, LambdaElement): + def __add__(self, other): ... + def add_criteria( + self, + other, + enable_tracking: bool = ..., + track_on: Any | None = ..., + track_closure_variables: bool = ..., + track_bound_values: bool = ..., + ): ... + def spoil(self): ... + +class NullLambdaStatement(roles.AllowsLambdaRole, elements.ClauseElement): + __visit_name__: str + def __init__(self, statement) -> None: ... + def __getattr__(self, key): ... + def __add__(self, other): ... + def add_criteria(self, other, **kw): ... + +class LinkedLambdaElement(StatementLambdaElement): + role: Any + opts: Any + fn: Any + parent_lambda: Any + tracker_key: Any + def __init__(self, fn, parent_lambda, opts) -> None: ... + +class AnalyzedCode: + @classmethod + def get(cls, fn, lambda_element, lambda_kw, **kw): ... + track_bound_values: Any + track_closure_variables: Any + bindparam_trackers: Any + closure_trackers: Any + build_py_wrappers: Any + def __init__(self, fn, lambda_element, opts) -> None: ... + +class NonAnalyzedFunction: + closure_bindparams: Any + bindparam_trackers: Any + expr: Any + def __init__(self, expr) -> None: ... + @property + def expected_expr(self): ... + +class AnalyzedFunction: + analyzed_code: Any + fn: Any + closure_pywrappers: Any + tracker_instrumented_fn: Any + expr: Any + bindparam_trackers: Any + expected_expr: Any + is_sequence: Any + propagate_attrs: Any + closure_bindparams: Any + def __init__(self, analyzed_code, lambda_element, apply_propagate_attrs, fn) -> None: ... + +class PyWrapper(ColumnOperators): + fn: Any + track_bound_values: Any + def __init__( + self, fn, name, to_evaluate, closure_index: Any | None = ..., getter: Any | None = ..., track_bound_values: bool = ... + ) -> None: ... + def __call__(self, *arg, **kw): ... + def operate(self, op, *other, **kwargs): ... + def reverse_operate(self, op, other, **kwargs): ... + def __clause_element__(self): ... + def __bool__(self): ... + def __nonzero__(self): ... + def __getattribute__(self, key): ... + def __iter__(self): ... + def __getitem__(self, key): ... + +def insp(lmb): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/naming.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/naming.pyi new file mode 100644 index 000000000..50bdacf72 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/naming.pyi @@ -0,0 +1,10 @@ +from typing import Any + +from .elements import conv as conv + +class ConventionDict: + const: Any + table: Any + convention: Any + def __init__(self, const, table, convention) -> None: ... + def __getitem__(self, key): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi new file mode 100644 index 000000000..07289f632 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi @@ -0,0 +1,190 @@ +from operator import truediv +from typing import Any + +div = truediv + +class Operators: + def __and__(self, other): ... + def __or__(self, other): ... + def __invert__(self): ... + def op(self, opstring, precedence: int = ..., is_comparison: bool = ..., return_type: Any | None = ...): ... + def bool_op(self, opstring, precedence: int = ...): ... + def operate(self, op, *other, **kwargs) -> None: ... + def reverse_operate(self, op, other, **kwargs) -> None: ... + +class custom_op: + __name__: str + opstring: Any + precedence: Any + is_comparison: Any + natural_self_precedent: Any + eager_grouping: Any + return_type: Any + def __init__( + self, + opstring, + precedence: int = ..., + is_comparison: bool = ..., + return_type: Any | None = ..., + natural_self_precedent: bool = ..., + eager_grouping: bool = ..., + ) -> None: ... + def __eq__(self, other): ... + def __hash__(self): ... + def __call__(self, left, right, **kw): ... + +class ColumnOperators(Operators): + timetuple: Any + def __lt__(self, other): ... + def __le__(self, other): ... + __hash__: Any + def __eq__(self, other): ... + def __ne__(self, other): ... + def is_distinct_from(self, other): ... + def is_not_distinct_from(self, other): ... + isnot_distinct_from: Any + def __gt__(self, other): ... + def __ge__(self, other): ... + def __neg__(self): ... + def __contains__(self, other): ... + def __getitem__(self, index): ... + def __lshift__(self, other): ... + def __rshift__(self, other): ... + def concat(self, other): ... + def like(self, other, escape: Any | None = ...): ... + def ilike(self, other, escape: Any | None = ...): ... + def in_(self, other): ... + def not_in(self, other): ... + notin_: Any + def not_like(self, other, escape: Any | None = ...): ... + notlike: Any + def not_ilike(self, other, escape: Any | None = ...): ... + notilike: Any + def is_(self, other): ... + def is_not(self, other): ... + isnot: Any + def startswith(self, other, **kwargs): ... + def endswith(self, other, **kwargs): ... + def contains(self, other, **kwargs): ... + def match(self, other, **kwargs): ... + def regexp_match(self, pattern, flags: Any | None = ...): ... + def regexp_replace(self, pattern, replacement, flags: Any | None = ...): ... + def desc(self): ... + def asc(self): ... + def nulls_first(self): ... + nullsfirst: Any + def nulls_last(self): ... + nullslast: Any + def collate(self, collation): ... + def __radd__(self, other): ... + def __rsub__(self, other): ... + def __rmul__(self, other): ... + def __rdiv__(self, other): ... + def __rmod__(self, other): ... + def between(self, cleft, cright, symmetric: bool = ...): ... + def distinct(self): ... + def any_(self): ... + def all_(self): ... + def __add__(self, other): ... + def __sub__(self, other): ... + def __mul__(self, other): ... + def __div__(self, other): ... + def __mod__(self, other): ... + def __truediv__(self, other): ... + def __rtruediv__(self, other): ... + +def commutative_op(fn): ... +def comparison_op(fn): ... +def from_() -> None: ... +def function_as_comparison_op() -> None: ... +def as_() -> None: ... +def exists() -> None: ... +def is_true(a) -> None: ... + +istrue = is_true + +def is_false(a) -> None: ... + +isfalse = is_false + +def is_distinct_from(a, b): ... +def is_not_distinct_from(a, b): ... + +isnot_distinct_from = is_not_distinct_from + +def is_(a, b): ... +def is_not(a, b): ... + +isnot = is_not + +def collate(a, b): ... +def op(a, opstring, b): ... +def like_op(a, b, escape: Any | None = ...): ... +def not_like_op(a, b, escape: Any | None = ...): ... + +notlike_op = not_like_op + +def ilike_op(a, b, escape: Any | None = ...): ... +def not_ilike_op(a, b, escape: Any | None = ...): ... + +notilike_op = not_ilike_op + +def between_op(a, b, c, symmetric: bool = ...): ... +def not_between_op(a, b, c, symmetric: bool = ...): ... + +notbetween_op = not_between_op + +def in_op(a, b): ... +def not_in_op(a, b): ... + +notin_op = not_in_op + +def distinct_op(a): ... +def any_op(a): ... +def all_op(a): ... +def startswith_op(a, b, escape: Any | None = ..., autoescape: bool = ...): ... +def not_startswith_op(a, b, escape: Any | None = ..., autoescape: bool = ...): ... + +notstartswith_op = not_startswith_op + +def endswith_op(a, b, escape: Any | None = ..., autoescape: bool = ...): ... +def not_endswith_op(a, b, escape: Any | None = ..., autoescape: bool = ...): ... + +notendswith_op = not_endswith_op + +def contains_op(a, b, escape: Any | None = ..., autoescape: bool = ...): ... +def not_contains_op(a, b, escape: Any | None = ..., autoescape: bool = ...): ... + +notcontains_op = not_contains_op + +def match_op(a, b, **kw): ... +def regexp_match_op(a, b, flags: Any | None = ...): ... +def not_regexp_match_op(a, b, flags: Any | None = ...): ... +def regexp_replace_op(a, b, replacement, flags: Any | None = ...): ... +def not_match_op(a, b, **kw): ... + +notmatch_op = not_match_op + +def comma_op(a, b) -> None: ... +def filter_op(a, b) -> None: ... +def concat_op(a, b): ... +def desc_op(a): ... +def asc_op(a): ... +def nulls_first_op(a): ... + +nullsfirst_op = nulls_first_op + +def nulls_last_op(a): ... + +nullslast_op = nulls_last_op + +def json_getitem_op(a, b) -> None: ... +def json_path_getitem_op(a, b) -> None: ... +def is_comparison(op): ... +def is_commutative(op): ... +def is_ordering_modifier(op): ... +def is_natural_self_precedent(op): ... +def is_boolean(op): ... +def mirror(op): ... +def is_associative(op): ... +def is_precedent(operator, against): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/roles.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/roles.pyi new file mode 100644 index 000000000..e7c290b14 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/roles.pyi @@ -0,0 +1,57 @@ +class SQLRole: + allows_lambda: bool + uses_inspection: bool + +class UsesInspection: + uses_inspection: bool + +class AllowsLambdaRole: + allows_lambda: bool + +class HasCacheKeyRole(SQLRole): ... +class ExecutableOptionRole(SQLRole): ... +class LiteralValueRole(SQLRole): ... +class ColumnArgumentRole(SQLRole): ... +class ColumnArgumentOrKeyRole(ColumnArgumentRole): ... +class StrAsPlainColumnRole(ColumnArgumentRole): ... +class ColumnListRole(SQLRole): ... +class TruncatedLabelRole(SQLRole): ... +class ColumnsClauseRole(AllowsLambdaRole, UsesInspection, ColumnListRole): ... +class LimitOffsetRole(SQLRole): ... +class ByOfRole(ColumnListRole): ... +class GroupByRole(AllowsLambdaRole, UsesInspection, ByOfRole): ... +class OrderByRole(AllowsLambdaRole, ByOfRole): ... +class StructuralRole(SQLRole): ... +class StatementOptionRole(StructuralRole): ... +class OnClauseRole(AllowsLambdaRole, StructuralRole): ... +class WhereHavingRole(OnClauseRole): ... +class ExpressionElementRole(SQLRole): ... +class ConstExprRole(ExpressionElementRole): ... +class LabeledColumnExprRole(ExpressionElementRole): ... +class BinaryElementRole(ExpressionElementRole): ... +class InElementRole(SQLRole): ... +class JoinTargetRole(AllowsLambdaRole, UsesInspection, StructuralRole): ... +class FromClauseRole(ColumnsClauseRole, JoinTargetRole): ... + +class StrictFromClauseRole(FromClauseRole): + @property + def description(self) -> None: ... + +class AnonymizedFromClauseRole(StrictFromClauseRole): ... +class ReturnsRowsRole(SQLRole): ... +class StatementRole(SQLRole): ... + +class SelectStatementRole(StatementRole, ReturnsRowsRole): + def subquery(self) -> None: ... + +class HasCTERole(ReturnsRowsRole): ... +class IsCTERole(SQLRole): ... +class CompoundElementRole(AllowsLambdaRole, SQLRole): ... +class DMLRole(StatementRole): ... +class DMLTableRole(FromClauseRole): ... +class DMLColumnRole(SQLRole): ... +class DMLSelectRole(SQLRole): ... +class DDLRole(StatementRole): ... +class DDLExpressionRole(StructuralRole): ... +class DDLConstraintColumnRole(SQLRole): ... +class DDLReferredColumnRole(DDLConstraintColumnRole): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi new file mode 100644 index 000000000..66b4197d6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi @@ -0,0 +1,375 @@ +from typing import Any + +from ..util import memoized_property +from . import visitors +from .base import DialectKWArgs, Executable, SchemaEventTarget +from .elements import ColumnClause +from .selectable import TableClause + +RETAIN_SCHEMA: Any +BLANK_SCHEMA: Any +NULL_UNSPECIFIED: Any + +class SchemaItem(SchemaEventTarget, visitors.Visitable): + __visit_name__: str + create_drop_stringify_dialect: str + @memoized_property + def info(self): ... + +class Table(DialectKWArgs, SchemaItem, TableClause): + __visit_name__: str + constraints: Any + indexes: Any + def __new__(cls, *args, **kw): ... + def __init__(self, *args, **kw) -> None: ... + @property + def foreign_key_constraints(self): ... + @property + def key(self): ... + @property + def bind(self): ... + def add_is_dependent_on(self, table) -> None: ... + def append_column(self, column, replace_existing: bool = ...) -> None: ... # type: ignore[override] + def append_constraint(self, constraint) -> None: ... + def exists(self, bind: Any | None = ...): ... + def create(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... + def drop(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... + def tometadata(self, metadata, schema=..., referred_schema_fn: Any | None = ..., name: Any | None = ...): ... + def to_metadata(self, metadata, schema=..., referred_schema_fn: Any | None = ..., name: Any | None = ...): ... + +class Column(DialectKWArgs, SchemaItem, ColumnClause): + __visit_name__: str + inherit_cache: bool + key: Any + primary_key: Any + nullable: Any + default: Any + server_default: Any + server_onupdate: Any + index: Any + unique: Any + system: Any + doc: Any + onupdate: Any + autoincrement: Any + constraints: Any + foreign_keys: Any + comment: Any + computed: Any + identity: Any + info: Any + def __init__(self, *args, **kwargs) -> None: ... + def references(self, column): ... + def append_foreign_key(self, fk) -> None: ... + def copy(self, **kw): ... + +class ForeignKey(DialectKWArgs, SchemaItem): + __visit_name__: str + constraint: Any + parent: Any + use_alter: Any + name: Any + onupdate: Any + ondelete: Any + deferrable: Any + initially: Any + link_to_name: Any + match: Any + info: Any + def __init__( + self, + column, + _constraint: Any | None = ..., + use_alter: bool = ..., + name: Any | None = ..., + onupdate: Any | None = ..., + ondelete: Any | None = ..., + deferrable: Any | None = ..., + initially: Any | None = ..., + link_to_name: bool = ..., + match: Any | None = ..., + info: Any | None = ..., + **dialect_kw, + ) -> None: ... + def copy(self, schema: Any | None = ..., **kw): ... + target_fullname: Any + def references(self, table): ... + def get_referent(self, table): ... + @memoized_property + def column(self): ... + +class DefaultGenerator(Executable, SchemaItem): + __visit_name__: str + is_sequence: bool + is_server_default: bool + column: Any + for_update: Any + def __init__(self, for_update: bool = ...) -> None: ... + def execute(self, bind: Any | None = ...): ... # type: ignore[override] + @property + def bind(self): ... + +class ColumnDefault(DefaultGenerator): + arg: Any + def __init__(self, arg, **kwargs) -> None: ... + @memoized_property + def is_callable(self): ... + @memoized_property + def is_clause_element(self): ... + @memoized_property + def is_scalar(self): ... + +class IdentityOptions: + start: Any + increment: Any + minvalue: Any + maxvalue: Any + nominvalue: Any + nomaxvalue: Any + cycle: Any + cache: Any + order: Any + def __init__( + self, + start: Any | None = ..., + increment: Any | None = ..., + minvalue: Any | None = ..., + maxvalue: Any | None = ..., + nominvalue: Any | None = ..., + nomaxvalue: Any | None = ..., + cycle: Any | None = ..., + cache: Any | None = ..., + order: Any | None = ..., + ) -> None: ... + +class Sequence(IdentityOptions, DefaultGenerator): + __visit_name__: str + is_sequence: bool + name: Any + optional: Any + schema: Any + metadata: Any + data_type: Any + def __init__( + self, + name, + start: Any | None = ..., + increment: Any | None = ..., + minvalue: Any | None = ..., + maxvalue: Any | None = ..., + nominvalue: Any | None = ..., + nomaxvalue: Any | None = ..., + cycle: Any | None = ..., + schema: Any | None = ..., + cache: Any | None = ..., + order: Any | None = ..., + data_type: Any | None = ..., + optional: bool = ..., + quote: Any | None = ..., + metadata: Any | None = ..., + quote_schema: Any | None = ..., + for_update: bool = ..., + ) -> None: ... + @memoized_property + def is_callable(self): ... + @memoized_property + def is_clause_element(self): ... + def next_value(self): ... + @property + def bind(self): ... + def create(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... + def drop(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... + +class FetchedValue(SchemaEventTarget): + is_server_default: bool + reflected: bool + has_argument: bool + is_clause_element: bool + for_update: Any + def __init__(self, for_update: bool = ...) -> None: ... + +class DefaultClause(FetchedValue): + has_argument: bool + arg: Any + reflected: Any + def __init__(self, arg, for_update: bool = ..., _reflected: bool = ...) -> None: ... + +class Constraint(DialectKWArgs, SchemaItem): + __visit_name__: str + name: Any + deferrable: Any + initially: Any + info: Any + def __init__( + self, + name: Any | None = ..., + deferrable: Any | None = ..., + initially: Any | None = ..., + _create_rule: Any | None = ..., + info: Any | None = ..., + _type_bound: bool = ..., + **dialect_kw, + ) -> None: ... + @property + def table(self): ... + def copy(self, **kw): ... + +class ColumnCollectionMixin: + columns: Any + def __init__(self, *columns, **kw) -> None: ... + +class ColumnCollectionConstraint(ColumnCollectionMixin, Constraint): + def __init__(self, *columns, **kw) -> None: ... + columns: Any + def __contains__(self, x): ... + def copy(self, target_table: Any | None = ..., **kw): ... + def contains_column(self, col): ... + def __iter__(self): ... + def __len__(self): ... + +class CheckConstraint(ColumnCollectionConstraint): + __visit_name__: str + sqltext: Any + def __init__( + self, + sqltext, + name: Any | None = ..., + deferrable: Any | None = ..., + initially: Any | None = ..., + table: Any | None = ..., + info: Any | None = ..., + _create_rule: Any | None = ..., + _autoattach: bool = ..., + _type_bound: bool = ..., + **kw, + ) -> None: ... + @property + def is_column_level(self): ... + def copy(self, target_table: Any | None = ..., **kw): ... + +class ForeignKeyConstraint(ColumnCollectionConstraint): + __visit_name__: str + onupdate: Any + ondelete: Any + link_to_name: Any + use_alter: Any + match: Any + elements: Any + def __init__( + self, + columns, + refcolumns, + name: Any | None = ..., + onupdate: Any | None = ..., + ondelete: Any | None = ..., + deferrable: Any | None = ..., + initially: Any | None = ..., + use_alter: bool = ..., + link_to_name: bool = ..., + match: Any | None = ..., + table: Any | None = ..., + info: Any | None = ..., + **dialect_kw, + ) -> None: ... + columns: Any + @property + def referred_table(self): ... + @property + def column_keys(self): ... + def copy(self, schema: Any | None = ..., target_table: Any | None = ..., **kw): ... # type: ignore[override] + +class PrimaryKeyConstraint(ColumnCollectionConstraint): + __visit_name__: str + def __init__(self, *columns, **kw) -> None: ... + @property + def columns_autoinc_first(self): ... + +class UniqueConstraint(ColumnCollectionConstraint): + __visit_name__: str + +class Index(DialectKWArgs, ColumnCollectionMixin, SchemaItem): + __visit_name__: str + table: Any + name: Any + unique: Any + info: Any + expressions: Any + def __init__(self, name, *expressions, **kw) -> None: ... + @property + def bind(self): ... + def create(self, bind: Any | None = ..., checkfirst: bool = ...): ... + def drop(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... + +DEFAULT_NAMING_CONVENTION: Any + +class MetaData(SchemaItem): + __visit_name__: str + tables: Any + schema: Any + naming_convention: Any + info: Any + def __init__( + self, + bind: Any | None = ..., + schema: Any | None = ..., + quote_schema: Any | None = ..., + naming_convention: Any | None = ..., + info: Any | None = ..., + ) -> None: ... + def __contains__(self, table_or_key): ... + def is_bound(self): ... + bind: Any + def clear(self) -> None: ... + def remove(self, table) -> None: ... + @property + def sorted_tables(self): ... + def reflect( + self, + bind: Any | None = ..., + schema: Any | None = ..., + views: bool = ..., + only: Any | None = ..., + extend_existing: bool = ..., + autoload_replace: bool = ..., + resolve_fks: bool = ..., + **dialect_kwargs, + ) -> None: ... + def create_all(self, bind: Any | None = ..., tables: Any | None = ..., checkfirst: bool = ...) -> None: ... + def drop_all(self, bind: Any | None = ..., tables: Any | None = ..., checkfirst: bool = ...) -> None: ... + +class ThreadLocalMetaData(MetaData): + __visit_name__: str + context: Any + def __init__(self) -> None: ... + bind: Any + def is_bound(self): ... + def dispose(self) -> None: ... + +class Computed(FetchedValue, SchemaItem): + __visit_name__: str + sqltext: Any + persisted: Any + column: Any + def __init__(self, sqltext, persisted: Any | None = ...) -> None: ... + def copy(self, target_table: Any | None = ..., **kw): ... + +class Identity(IdentityOptions, FetchedValue, SchemaItem): + __visit_name__: str + always: Any + on_null: Any + column: Any + def __init__( + self, + always: bool = ..., + on_null: Any | None = ..., + start: Any | None = ..., + increment: Any | None = ..., + minvalue: Any | None = ..., + maxvalue: Any | None = ..., + nominvalue: Any | None = ..., + nomaxvalue: Any | None = ..., + cycle: Any | None = ..., + cache: Any | None = ..., + order: Any | None = ..., + ) -> None: ... + def copy(self, **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi new file mode 100644 index 000000000..84ac9413a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi @@ -0,0 +1,416 @@ +from typing import Any + +from .. import util +from ..util import HasMemoized, memoized_property +from . import roles, traversals, visitors +from .annotation import Annotated, SupportsCloneAnnotations +from .base import CacheableOptions, CompileState, Executable, Generative, HasCompileState, Immutable +from .elements import ( + BindParameter as BindParameter, + BooleanClauseList as BooleanClauseList, + ClauseElement as ClauseElement, + ClauseList as ClauseList, + ColumnClause as ColumnClause, + GroupedElement as GroupedElement, + Grouping as Grouping, + TableValuedColumn as TableValuedColumn, + UnaryExpression as UnaryExpression, + literal_column as literal_column, +) + +class _OffsetLimitParam(BindParameter): + inherit_cache: bool + +def subquery(alias, *args, **kwargs): ... + +class ReturnsRows(roles.ReturnsRowsRole, ClauseElement): + @property + def selectable(self): ... + @property + def exported_columns(self) -> None: ... + +class Selectable(ReturnsRows): + __visit_name__: str + is_selectable: bool + def lateral(self, name: Any | None = ...): ... + def replace_selectable(self, old, alias): ... + def corresponding_column(self, column, require_embedded: bool = ...): ... + +class HasPrefixes: + def prefix_with(self, *expr, **kw) -> None: ... + +class HasSuffixes: + def suffix_with(self, *expr, **kw) -> None: ... + +class HasHints: + def with_statement_hint(self, text, dialect_name: str = ...): ... + def with_hint(self, selectable, text, dialect_name: str = ...) -> None: ... + +class FromClause(roles.AnonymizedFromClauseRole, Selectable): + __visit_name__: str + named_with_column: bool + schema: Any + is_selectable: bool + def select(self, whereclause: Any | None = ..., **kwargs): ... + def join(self, right, onclause: Any | None = ..., isouter: bool = ..., full: bool = ...): ... + def outerjoin(self, right, onclause: Any | None = ..., full: bool = ...): ... + def alias(self, name: Any | None = ..., flat: bool = ...): ... + def table_valued(self): ... + def tablesample(self, sampling, name: Any | None = ..., seed: Any | None = ...): ... + def is_derived_from(self, fromclause): ... + @property + def description(self): ... + @property + def exported_columns(self): ... + @memoized_property + def columns(self): ... + @property + def entity_namespace(self): ... + @memoized_property + def primary_key(self): ... + @memoized_property + def foreign_keys(self): ... + c: Any + +LABEL_STYLE_NONE: Any +LABEL_STYLE_TABLENAME_PLUS_COL: Any +LABEL_STYLE_DISAMBIGUATE_ONLY: Any +LABEL_STYLE_DEFAULT: Any + +class Join(roles.DMLTableRole, FromClause): + __visit_name__: str + left: Any + right: Any + onclause: Any + isouter: Any + full: Any + def __init__(self, left, right, onclause: Any | None = ..., isouter: bool = ..., full: bool = ...) -> None: ... + @property + def description(self): ... + def is_derived_from(self, fromclause): ... + def self_group(self, against: Any | None = ...): ... + def select(self, whereclause: Any | None = ..., **kwargs): ... + @property + def bind(self): ... + def alias(self, name: Any | None = ..., flat: bool = ...): ... + +class NoInit: + def __init__(self, *arg, **kw) -> None: ... + +class AliasedReturnsRows(NoInit, FromClause): + named_with_column: bool + @property + def description(self): ... + @property + def original(self): ... + def is_derived_from(self, fromclause): ... + @property + def bind(self): ... + +class Alias(roles.DMLTableRole, AliasedReturnsRows): + __visit_name__: str + inherit_cache: bool + +class TableValuedAlias(Alias): + __visit_name__: str + @HasMemoized.memoized_attribute + def column(self): ... + def alias(self, name: Any | None = ...): ... # type: ignore[override] + def lateral(self, name: Any | None = ...): ... + def render_derived(self, name: Any | None = ..., with_types: bool = ...): ... + +class Lateral(AliasedReturnsRows): + __visit_name__: str + inherit_cache: bool + +class TableSample(AliasedReturnsRows): + __visit_name__: str + +class CTE(roles.DMLTableRole, roles.IsCTERole, Generative, HasPrefixes, HasSuffixes, AliasedReturnsRows): + __visit_name__: str + def alias(self, name: Any | None = ..., flat: bool = ...): ... + def union(self, *other): ... + def union_all(self, *other): ... + +class HasCTE(roles.HasCTERole): + def add_cte(self, cte) -> None: ... + def cte(self, name: Any | None = ..., recursive: bool = ..., nesting: bool = ...): ... + +class Subquery(AliasedReturnsRows): + __visit_name__: str + inherit_cache: bool + def as_scalar(self): ... + +class FromGrouping(GroupedElement, FromClause): + element: Any + def __init__(self, element) -> None: ... + @property + def columns(self): ... + @property + def primary_key(self): ... + @property + def foreign_keys(self): ... + def is_derived_from(self, element): ... + def alias(self, **kw): ... + +class TableClause(roles.DMLTableRole, Immutable, FromClause): + __visit_name__: str + named_with_column: bool + implicit_returning: bool + name: Any + primary_key: Any + foreign_keys: Any + schema: Any + fullname: Any + def __init__(self, name, *columns, **kw) -> None: ... + @memoized_property + def description(self): ... + def append_column(self, c, **kw) -> None: ... + def insert(self, values: Any | None = ..., inline: bool = ..., **kwargs): ... + def update(self, whereclause: Any | None = ..., values: Any | None = ..., inline: bool = ..., **kwargs): ... + def delete(self, whereclause: Any | None = ..., **kwargs): ... + +class ForUpdateArg(ClauseElement): + def __eq__(self, other): ... + def __ne__(self, other): ... + def __hash__(self): ... + nowait: Any + read: Any + skip_locked: Any + key_share: Any + of: Any + def __init__( + self, nowait: bool = ..., read: bool = ..., of: Any | None = ..., skip_locked: bool = ..., key_share: bool = ... + ) -> None: ... + +class Values(Generative, FromClause): + named_with_column: bool + __visit_name__: str + name: Any + literal_binds: Any + def __init__(self, *columns, **kw) -> None: ... + def alias(self, name, **kw) -> None: ... # type: ignore[override] + def lateral(self, name: Any | None = ...) -> None: ... + def data(self, values) -> None: ... + +class SelectBase( + roles.SelectStatementRole, + roles.DMLSelectRole, + roles.CompoundElementRole, + roles.InElementRole, + HasCTE, + Executable, + SupportsCloneAnnotations, + Selectable, +): + is_select: bool + @property + def selected_columns(self) -> None: ... + @property + def exported_columns(self): ... + @property + def c(self): ... + @property + def columns(self): ... + def select(self, *arg, **kw): ... + def as_scalar(self): ... + def exists(self): ... + def scalar_subquery(self): ... + def label(self, name): ... + def lateral(self, name: Any | None = ...): ... + def subquery(self, name: Any | None = ...): ... + def alias(self, name: Any | None = ..., flat: bool = ...): ... + +class SelectStatementGrouping(GroupedElement, SelectBase): + __visit_name__: str + element: Any + def __init__(self, element) -> None: ... + def get_label_style(self): ... + def set_label_style(self, label_style): ... + @property + def select_statement(self): ... + def self_group(self, against: Any | None = ...): ... + @property + def selected_columns(self): ... + +class DeprecatedSelectBaseGenerations: + def append_order_by(self, *clauses) -> None: ... + def append_group_by(self, *clauses) -> None: ... + +class GenerativeSelect(DeprecatedSelectBaseGenerations, SelectBase): + def __init__( + self, + _label_style=..., + use_labels: bool = ..., + limit: Any | None = ..., + offset: Any | None = ..., + order_by: Any | None = ..., + group_by: Any | None = ..., + bind: Any | None = ..., + ) -> None: ... + def with_for_update( + self, nowait: bool = ..., read: bool = ..., of: Any | None = ..., skip_locked: bool = ..., key_share: bool = ... + ) -> None: ... + def get_label_style(self): ... + def set_label_style(self, style): ... + def apply_labels(self): ... + def limit(self, limit) -> None: ... + def fetch(self, count, with_ties: bool = ..., percent: bool = ...) -> None: ... + def offset(self, offset) -> None: ... + def slice(self, start, stop) -> None: ... + def order_by(self, *clauses) -> None: ... + def group_by(self, *clauses) -> None: ... + +class CompoundSelectState(CompileState): ... + +class CompoundSelect(HasCompileState, GenerativeSelect): + __visit_name__: str + UNION: Any + UNION_ALL: Any + EXCEPT: Any + EXCEPT_ALL: Any + INTERSECT: Any + INTERSECT_ALL: Any + keyword: Any + selects: Any + def __init__(self, keyword, *selects, **kwargs) -> None: ... + def self_group(self, against: Any | None = ...): ... + def is_derived_from(self, fromclause): ... + @property + def selected_columns(self): ... + @property + def bind(self): ... + @bind.setter + def bind(self, bind) -> None: ... + +class DeprecatedSelectGenerations: + def append_correlation(self, fromclause) -> None: ... + def append_column(self, column) -> None: ... + def append_prefix(self, clause) -> None: ... + def append_whereclause(self, whereclause) -> None: ... + def append_having(self, having) -> None: ... + def append_from(self, fromclause) -> None: ... + +class SelectState(util.MemoizedSlots, CompileState): + class default_select_compile_options(CacheableOptions): ... + statement: Any + from_clauses: Any + froms: Any + columns_plus_names: Any + def __init__(self, statement, compiler, **kw) -> None: ... + @classmethod + def get_column_descriptions(cls, statement) -> None: ... + @classmethod + def from_statement(cls, statement, from_statement) -> None: ... + @classmethod + def get_columns_clause_froms(cls, statement): ... + @classmethod + def determine_last_joined_entity(cls, stmt): ... + @classmethod + def all_selected_columns(cls, statement): ... + +class _SelectFromElements: ... + +class _MemoizedSelectEntities(traversals.HasCacheKey, traversals.HasCopyInternals, visitors.Traversible): + __visit_name__: str + +class Select( + HasPrefixes, HasSuffixes, HasHints, HasCompileState, DeprecatedSelectGenerations, _SelectFromElements, GenerativeSelect +): + __visit_name__: str + @classmethod + def create_legacy_select( + cls, + columns: Any | None = ..., + whereclause: Any | None = ..., + from_obj: Any | None = ..., + distinct: bool = ..., + having: Any | None = ..., + correlate: bool = ..., + prefixes: Any | None = ..., + suffixes: Any | None = ..., + **kwargs, + ): ... + def __init__(self) -> None: ... + def filter(self, *criteria): ... + def filter_by(self, **kwargs): ... + @property + def column_descriptions(self): ... + def from_statement(self, statement): ... + def join(self, target, onclause: Any | None = ..., isouter: bool = ..., full: bool = ...) -> None: ... + def outerjoin_from(self, from_, target, onclause: Any | None = ..., full: bool = ...): ... + def join_from(self, from_, target, onclause: Any | None = ..., isouter: bool = ..., full: bool = ...) -> None: ... + def outerjoin(self, target, onclause: Any | None = ..., full: bool = ...): ... + def get_final_froms(self): ... + @property + def froms(self): ... + @property + def columns_clause_froms(self): ... + @property + def inner_columns(self): ... + def is_derived_from(self, fromclause): ... + def get_children(self, **kwargs): ... + def add_columns(self, *columns) -> None: ... + def column(self, column): ... + def reduce_columns(self, only_synonyms: bool = ...): ... + def with_only_columns(self, *columns, **kw) -> None: ... + @property + def whereclause(self): ... + def where(self, *whereclause) -> None: ... + def having(self, having) -> None: ... + def distinct(self, *expr) -> None: ... + def select_from(self, *froms) -> None: ... + def correlate(self, *fromclauses) -> None: ... + def correlate_except(self, *fromclauses) -> None: ... + @HasMemoized.memoized_attribute + def selected_columns(self): ... + def self_group(self, against: Any | None = ...): ... + def union(self, *other, **kwargs): ... + def union_all(self, *other, **kwargs): ... + def except_(self, *other, **kwargs): ... + def except_all(self, *other, **kwargs): ... + def intersect(self, *other, **kwargs): ... + def intersect_all(self, *other, **kwargs): ... + @property + def bind(self): ... + @bind.setter + def bind(self, bind) -> None: ... + +class ScalarSelect(roles.InElementRole, Generative, Grouping): + inherit_cache: bool + element: Any + type: Any + def __init__(self, element) -> None: ... + @property + def columns(self) -> None: ... + c: Any + def where(self, crit) -> None: ... + def self_group(self, **kwargs): ... + def correlate(self, *fromclauses) -> None: ... + def correlate_except(self, *fromclauses) -> None: ... + +class Exists(UnaryExpression): + inherit_cache: bool + def __init__(self, *args, **kwargs) -> None: ... + def select(self, whereclause: Any | None = ..., **kwargs): ... + def correlate(self, *fromclause): ... + def correlate_except(self, *fromclause): ... + def select_from(self, *froms): ... + def where(self, *clause): ... + +class TextualSelect(SelectBase): + __visit_name__: str + is_text: bool + is_select: bool + element: Any + column_args: Any + positional: Any + def __init__(self, text, columns, positional: bool = ...) -> None: ... + @HasMemoized.memoized_attribute + def selected_columns(self): ... + def bindparams(self, *binds, **bind_as_values) -> None: ... + +TextAsFrom = TextualSelect + +class AnnotatedFromClause(Annotated): + def __init__(self, element, values) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi new file mode 100644 index 000000000..f26c34139 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi @@ -0,0 +1,356 @@ +from typing import Any + +from .base import SchemaEventTarget +from .traversals import HasCacheKey +from .type_api import ( + Emulated as Emulated, + NativeForEmulated as NativeForEmulated, + TypeDecorator as TypeDecorator, + TypeEngine as TypeEngine, + Variant as Variant, + to_instance as to_instance, +) + +class _LookupExpressionAdapter: + class Comparator(TypeEngine.Comparator): ... + comparator_factory: Any + +class Concatenable: + class Comparator(TypeEngine.Comparator): ... + comparator_factory: Any + +class Indexable: + class Comparator(TypeEngine.Comparator): + def __getitem__(self, index): ... + comparator_factory: Any + +class String(Concatenable, TypeEngine): + __visit_name__: str + RETURNS_UNICODE: Any + RETURNS_BYTES: Any + RETURNS_CONDITIONAL: Any + RETURNS_UNKNOWN: Any + length: Any + collation: Any + def __init__( + self, + length: Any | None = ..., + collation: Any | None = ..., + convert_unicode: bool = ..., + unicode_error: Any | None = ..., + _warn_on_bytestring: bool = ..., + _expect_unicode: bool = ..., + ) -> None: ... + def literal_processor(self, dialect): ... + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + @property + def python_type(self): ... + def get_dbapi_type(self, dbapi): ... + +class Text(String): + __visit_name__: str + +class Unicode(String): + __visit_name__: str + def __init__(self, length: Any | None = ..., **kwargs) -> None: ... + +class UnicodeText(Text): + __visit_name__: str + def __init__(self, length: Any | None = ..., **kwargs) -> None: ... + +class Integer(_LookupExpressionAdapter, TypeEngine): + __visit_name__: str + def get_dbapi_type(self, dbapi): ... + @property + def python_type(self): ... + def literal_processor(self, dialect): ... + +class SmallInteger(Integer): + __visit_name__: str + +class BigInteger(Integer): + __visit_name__: str + +class Numeric(_LookupExpressionAdapter, TypeEngine): + __visit_name__: str + precision: Any + scale: Any + decimal_return_scale: Any + asdecimal: Any + def __init__( + self, precision: Any | None = ..., scale: Any | None = ..., decimal_return_scale: Any | None = ..., asdecimal: bool = ... + ) -> None: ... + def get_dbapi_type(self, dbapi): ... + def literal_processor(self, dialect): ... + @property + def python_type(self): ... + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +class Float(Numeric): + __visit_name__: str + scale: Any + precision: Any + asdecimal: Any + decimal_return_scale: Any + def __init__(self, precision: Any | None = ..., asdecimal: bool = ..., decimal_return_scale: Any | None = ...) -> None: ... + def result_processor(self, dialect, coltype): ... + +class DateTime(_LookupExpressionAdapter, TypeEngine): + __visit_name__: str + timezone: Any + def __init__(self, timezone: bool = ...) -> None: ... + def get_dbapi_type(self, dbapi): ... + @property + def python_type(self): ... + +class Date(_LookupExpressionAdapter, TypeEngine): + __visit_name__: str + def get_dbapi_type(self, dbapi): ... + @property + def python_type(self): ... + +class Time(_LookupExpressionAdapter, TypeEngine): + __visit_name__: str + timezone: Any + def __init__(self, timezone: bool = ...) -> None: ... + def get_dbapi_type(self, dbapi): ... + @property + def python_type(self): ... + +class _Binary(TypeEngine): + length: Any + def __init__(self, length: Any | None = ...) -> None: ... + def literal_processor(self, dialect): ... + @property + def python_type(self): ... + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + def coerce_compared_value(self, op, value): ... + def get_dbapi_type(self, dbapi): ... + +class LargeBinary(_Binary): + __visit_name__: str + def __init__(self, length: Any | None = ...) -> None: ... + +class SchemaType(SchemaEventTarget): + name: Any + schema: Any + metadata: Any + inherit_schema: Any + def __init__( + self, + name: Any | None = ..., + schema: Any | None = ..., + metadata: Any | None = ..., + inherit_schema: bool = ..., + quote: Any | None = ..., + _create_events: bool = ..., + ) -> None: ... + def copy(self, **kw): ... + def adapt(self, impltype, **kw): ... + @property + def bind(self): ... + def create(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... + def drop(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... + +class Enum(Emulated, String, SchemaType): + __visit_name__: str + def __init__(self, *enums, **kw) -> None: ... + @property + def sort_key_function(self): ... + @property + def native(self): ... + class Comparator(Concatenable.Comparator): ... + comparator_factory: Any + def as_generic(self, allow_nulltype: bool = ...): ... + def adapt_to_emulated(self, impltype, **kw): ... + def adapt(self, impltype, **kw): ... + def literal_processor(self, dialect): ... + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + def copy(self, **kw): ... + @property + def python_type(self): ... + +class PickleType(TypeDecorator): + impl: Any + cache_ok: bool + protocol: Any + pickler: Any + comparator: Any + def __init__(self, protocol=..., pickler: Any | None = ..., comparator: Any | None = ..., impl: Any | None = ...) -> None: ... + def __reduce__(self): ... + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + def compare_values(self, x, y): ... + +class Boolean(Emulated, TypeEngine, SchemaType): # type: ignore[misc] + __visit_name__: str + native: bool + create_constraint: Any + name: Any + def __init__(self, create_constraint: bool = ..., name: Any | None = ..., _create_events: bool = ...) -> None: ... + @property + def python_type(self): ... + def literal_processor(self, dialect): ... + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +class _AbstractInterval(_LookupExpressionAdapter, TypeEngine): + def coerce_compared_value(self, op, value): ... + +class Interval(Emulated, _AbstractInterval, TypeDecorator): # type: ignore[misc] + impl: Any + epoch: Any + cache_ok: bool + native: Any + second_precision: Any + day_precision: Any + def __init__(self, native: bool = ..., second_precision: Any | None = ..., day_precision: Any | None = ...) -> None: ... + @property + def python_type(self): ... + def adapt_to_emulated(self, impltype, **kw): ... + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +class JSON(Indexable, TypeEngine): + __visit_name__: str + hashable: bool + NULL: Any + none_as_null: Any + def __init__(self, none_as_null: bool = ...) -> None: ... + class JSONElementType(TypeEngine): + def string_bind_processor(self, dialect): ... + def string_literal_processor(self, dialect): ... + def bind_processor(self, dialect): ... + def literal_processor(self, dialect): ... + class JSONIndexType(JSONElementType): ... + class JSONIntIndexType(JSONIndexType): ... + class JSONStrIndexType(JSONIndexType): ... + class JSONPathType(JSONElementType): ... + class Comparator(Indexable.Comparator, Concatenable.Comparator): + def as_boolean(self): ... + def as_string(self): ... + def as_integer(self): ... + def as_float(self): ... + def as_numeric(self, precision, scale, asdecimal: bool = ...): ... + def as_json(self): ... + comparator_factory: Any + @property + def python_type(self): ... + @property # type: ignore[override] + def should_evaluate_none(self): ... + @should_evaluate_none.setter + def should_evaluate_none(self, value) -> None: ... + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + +class ARRAY(SchemaEventTarget, Indexable, Concatenable, TypeEngine): + __visit_name__: str + zero_indexes: bool + class Comparator(Indexable.Comparator, Concatenable.Comparator): + def contains(self, *arg, **kw) -> None: ... + def any(self, other, operator: Any | None = ...): ... + def all(self, other, operator: Any | None = ...): ... + comparator_factory: Any + item_type: Any + as_tuple: Any + dimensions: Any + def __init__(self, item_type, as_tuple: bool = ..., dimensions: Any | None = ..., zero_indexes: bool = ...) -> None: ... + @property + def hashable(self): ... + @property + def python_type(self): ... + def compare_values(self, x, y): ... + +class TupleType(TypeEngine): + types: Any + def __init__(self, *types) -> None: ... + def result_processor(self, dialect, coltype) -> None: ... + +class REAL(Float): + __visit_name__: str + +class FLOAT(Float): + __visit_name__: str + +class NUMERIC(Numeric): + __visit_name__: str + +class DECIMAL(Numeric): + __visit_name__: str + +class INTEGER(Integer): + __visit_name__: str + +INT = INTEGER + +class SMALLINT(SmallInteger): + __visit_name__: str + +class BIGINT(BigInteger): + __visit_name__: str + +class TIMESTAMP(DateTime): + __visit_name__: str + def __init__(self, timezone: bool = ...) -> None: ... + def get_dbapi_type(self, dbapi): ... + +class DATETIME(DateTime): + __visit_name__: str + +class DATE(Date): + __visit_name__: str + +class TIME(Time): + __visit_name__: str + +class TEXT(Text): + __visit_name__: str + +class CLOB(Text): + __visit_name__: str + +class VARCHAR(String): + __visit_name__: str + +class NVARCHAR(Unicode): + __visit_name__: str + +class CHAR(String): + __visit_name__: str + +class NCHAR(Unicode): + __visit_name__: str + +class BLOB(LargeBinary): + __visit_name__: str + +class BINARY(_Binary): + __visit_name__: str + +class VARBINARY(_Binary): + __visit_name__: str + +class BOOLEAN(Boolean): + __visit_name__: str + +class NullType(TypeEngine): + __visit_name__: str + def literal_processor(self, dialect): ... + class Comparator(TypeEngine.Comparator): ... + comparator_factory: Any + +class TableValueType(HasCacheKey, TypeEngine): + def __init__(self, *elements) -> None: ... + +class MatchType(Boolean): ... + +NULLTYPE: Any +BOOLEANTYPE: Any +STRINGTYPE: Any +INTEGERTYPE: Any +MATCHTYPE: Any +TABLEVALUE: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi new file mode 100644 index 000000000..4ce0715c4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi @@ -0,0 +1,158 @@ +from typing import Any + +from .. import util +from ..util import HasMemoized +from .visitors import ExtendedInternalTraversal, InternalTraversal + +SKIP_TRAVERSE: Any +COMPARE_FAILED: bool +COMPARE_SUCCEEDED: bool +NO_CACHE: Any +CACHE_IN_PLACE: Any +CALL_GEN_CACHE_KEY: Any +STATIC_CACHE_KEY: Any +PROPAGATE_ATTRS: Any +ANON_NAME: Any + +def compare(obj1, obj2, **kw): ... + +class HasCacheKey: + inherit_cache: Any + +class MemoizedHasCacheKey(HasCacheKey, HasMemoized): ... + +class CacheKey: + def __hash__(self): ... + def to_offline_string(self, statement_cache, statement, parameters): ... + def __eq__(self, other): ... + +class _CacheKey(ExtendedInternalTraversal): + visit_has_cache_key: Any + visit_clauseelement: Any + visit_clauseelement_list: Any + visit_annotations_key: Any + visit_clauseelement_tuple: Any + visit_memoized_select_entities: Any + visit_string: Any + visit_boolean: Any + visit_operator: Any + visit_plain_obj: Any + visit_statement_hint_list: Any + visit_type: Any + visit_anon_name: Any + visit_propagate_attrs: Any + def visit_with_context_options(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_inspectable(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_string_list(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_multi(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_multi_list(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_has_cache_key_tuples(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_has_cache_key_list(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_executable_options(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_inspectable_list(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_clauseelement_tuples(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_fromclause_ordered_set(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_clauseelement_unordered_set(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_named_ddl_element(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_prefix_sequence(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_setup_join_tuple(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_table_hint_list(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_plain_dict(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_dialect_options(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_string_clauseelement_dict(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_string_multi_dict(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_fromclause_canonical_column_collection(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_unknown_structure(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_dml_ordered_values(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_dml_values(self, attrname, obj, parent, anon_map, bindparams): ... + def visit_dml_multi_values(self, attrname, obj, parent, anon_map, bindparams): ... + +class HasCopyInternals: ... + +class _CopyInternals(InternalTraversal): + def visit_clauseelement(self, attrname, parent, element, clone=..., **kw): ... + def visit_clauseelement_list(self, attrname, parent, element, clone=..., **kw): ... + def visit_clauseelement_tuple(self, attrname, parent, element, clone=..., **kw): ... + def visit_executable_options(self, attrname, parent, element, clone=..., **kw): ... + def visit_clauseelement_unordered_set(self, attrname, parent, element, clone=..., **kw): ... + def visit_clauseelement_tuples(self, attrname, parent, element, clone=..., **kw): ... + def visit_string_clauseelement_dict(self, attrname, parent, element, clone=..., **kw): ... + def visit_setup_join_tuple(self, attrname, parent, element, clone=..., **kw): ... + def visit_memoized_select_entities(self, attrname, parent, element, **kw): ... + def visit_dml_ordered_values(self, attrname, parent, element, clone=..., **kw): ... + def visit_dml_values(self, attrname, parent, element, clone=..., **kw): ... + def visit_dml_multi_values(self, attrname, parent, element, clone=..., **kw): ... + def visit_propagate_attrs(self, attrname, parent, element, clone=..., **kw): ... + +class _GetChildren(InternalTraversal): + def visit_has_cache_key(self, element, **kw): ... + def visit_clauseelement(self, element, **kw): ... + def visit_clauseelement_list(self, element, **kw): ... + def visit_clauseelement_tuple(self, element, **kw): ... + def visit_clauseelement_tuples(self, element, **kw): ... + def visit_fromclause_canonical_column_collection(self, element, **kw): ... + def visit_string_clauseelement_dict(self, element, **kw): ... + def visit_fromclause_ordered_set(self, element, **kw): ... + def visit_clauseelement_unordered_set(self, element, **kw): ... + def visit_setup_join_tuple(self, element, **kw) -> None: ... + def visit_memoized_select_entities(self, element, **kw): ... + def visit_dml_ordered_values(self, element, **kw) -> None: ... + def visit_dml_values(self, element, **kw) -> None: ... + def visit_dml_multi_values(self, element, **kw): ... + def visit_propagate_attrs(self, element, **kw): ... + +class anon_map(dict[Any, Any]): + index: int + def __init__(self) -> None: ... + def __missing__(self, key): ... + +class TraversalComparatorStrategy(InternalTraversal, util.MemoizedSlots): + stack: Any + cache: Any + anon_map: Any + def __init__(self) -> None: ... + def compare(self, obj1, obj2, **kw): ... + def compare_inner(self, obj1, obj2, **kw): ... + def visit_has_cache_key(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_propagate_attrs(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_has_cache_key_list(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_executable_options(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_clauseelement(self, attrname, left_parent, left, right_parent, right, **kw) -> None: ... + def visit_fromclause_canonical_column_collection(self, attrname, left_parent, left, right_parent, right, **kw) -> None: ... + def visit_fromclause_derived_column_collection(self, attrname, left_parent, left, right_parent, right, **kw) -> None: ... + def visit_string_clauseelement_dict(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_clauseelement_tuples(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_clauseelement_list(self, attrname, left_parent, left, right_parent, right, **kw) -> None: ... + def visit_clauseelement_tuple(self, attrname, left_parent, left, right_parent, right, **kw) -> None: ... + def visit_clauseelement_unordered_set(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_fromclause_ordered_set(self, attrname, left_parent, left, right_parent, right, **kw) -> None: ... + def visit_string(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_string_list(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_anon_name(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_boolean(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_operator(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_type(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_plain_dict(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_dialect_options(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_annotations_key(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_with_context_options(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_plain_obj(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_named_ddl_element(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_prefix_sequence(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_setup_join_tuple(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_memoized_select_entities(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_table_hint_list(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_statement_hint_list(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_unknown_structure(self, attrname, left_parent, left, right_parent, right, **kw) -> None: ... + def visit_dml_ordered_values(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_dml_values(self, attrname, left_parent, left, right_parent, right, **kw): ... + def visit_dml_multi_values(self, attrname, left_parent, left, right_parent, right, **kw): ... + def compare_clauselist(self, left, right, **kw): ... + def compare_binary(self, left, right, **kw): ... + def compare_bindparam(self, left, right, **kw): ... + +class ColIdentityComparatorStrategy(TraversalComparatorStrategy): + def compare_column_element(self, left, right, use_proxies: bool = ..., equivalents=..., **kw): ... + def compare_column(self, left, right, **kw): ... + def compare_label(self, left, right, **kw): ... + def compare_table(self, left, right, **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi new file mode 100644 index 000000000..96ad244e5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi @@ -0,0 +1,110 @@ +from typing import Any + +from .. import util +from . import operators +from .base import SchemaEventTarget +from .visitors import Traversible, TraversibleType + +BOOLEANTYPE: Any +INTEGERTYPE: Any +NULLTYPE: Any +STRINGTYPE: Any +MATCHTYPE: Any +INDEXABLE: Any +TABLEVALUE: Any + +class TypeEngine(Traversible): + class Comparator(operators.ColumnOperators): + default_comparator: Any + def __clause_element__(self): ... + expr: Any + type: Any + def __init__(self, expr) -> None: ... + def operate(self, op, *other, **kwargs): ... + def reverse_operate(self, op, other, **kwargs): ... + def __reduce__(self): ... + hashable: bool + comparator_factory: Any + sort_key_function: Any + should_evaluate_none: bool + def evaluates_none(self): ... + def copy(self, **kw): ... + def compare_against_backend(self, dialect, conn_type) -> None: ... + def copy_value(self, value): ... + def literal_processor(self, dialect) -> None: ... + def bind_processor(self, dialect) -> None: ... + def result_processor(self, dialect, coltype) -> None: ... + def column_expression(self, colexpr) -> None: ... + def bind_expression(self, bindvalue) -> None: ... + def compare_values(self, x, y): ... + def get_dbapi_type(self, dbapi) -> None: ... + @property + def python_type(self) -> None: ... + def with_variant(self, type_, dialect_name): ... + def as_generic(self, allow_nulltype: bool = ...): ... + def dialect_impl(self, dialect): ... + def adapt(self, cls, **kw): ... + def coerce_compared_value(self, op, value): ... + def compile(self, dialect: Any | None = ...): ... + +class VisitableCheckKWArg(util.EnsureKWArgType, TraversibleType): ... + +class ExternalType: + cache_ok: Any + +class UserDefinedType: + __visit_name__: str + ensure_kwarg: str + def coerce_compared_value(self, op, value): ... + +class Emulated: + def adapt_to_emulated(self, impltype, **kw): ... + def adapt(self, impltype, **kw): ... + +class NativeForEmulated: + @classmethod + def adapt_native_to_emulated(cls, impl, **kw): ... + @classmethod + def adapt_emulated_to_native(cls, impl, **kw): ... + +class TypeDecorator(ExternalType, SchemaEventTarget, TypeEngine): + __visit_name__: str + impl: Any + def __init__(self, *args, **kwargs) -> None: ... + coerce_to_is_types: Any + class Comparator(TypeEngine.Comparator): + def operate(self, op, *other, **kwargs): ... + def reverse_operate(self, op, other, **kwargs): ... + @property + def comparator_factory(self): ... + def type_engine(self, dialect): ... + def load_dialect_impl(self, dialect): ... + def __getattr__(self, key): ... + def process_literal_param(self, value, dialect) -> None: ... + def process_bind_param(self, value, dialect) -> None: ... + def process_result_value(self, value, dialect) -> None: ... + def literal_processor(self, dialect): ... + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... + def bind_expression(self, bindparam): ... + def column_expression(self, column): ... + def coerce_compared_value(self, op, value): ... + def copy(self, **kw): ... + def get_dbapi_type(self, dbapi): ... + def compare_values(self, x, y): ... + @property + def sort_key_function(self): ... + +class Variant(TypeDecorator): + cache_ok: bool + impl: Any + mapping: Any + def __init__(self, base, mapping) -> None: ... + def coerce_compared_value(self, operator, value): ... + def load_dialect_impl(self, dialect): ... + def with_variant(self, type_, dialect_name): ... + @property + def comparator_factory(self): ... + +def to_instance(typeobj, *arg, **kw): ... +def adapt_type(typeobj, colspecs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi new file mode 100644 index 000000000..965d10654 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi @@ -0,0 +1,101 @@ +from typing import Any + +from . import visitors + +join_condition: Any + +def find_join_source(clauses, join_to): ... +def find_left_clause_that_matches_given(clauses, join_from): ... +def find_left_clause_to_join_from(clauses, join_to, onclause): ... +def visit_binary_product(fn, expr) -> None: ... +def find_tables( + clause, + check_columns: bool = ..., + include_aliases: bool = ..., + include_joins: bool = ..., + include_selects: bool = ..., + include_crud: bool = ..., +): ... +def unwrap_order_by(clause): ... +def unwrap_label_reference(element): ... +def expand_column_list_from_order_by(collist, order_by): ... +def clause_is_present(clause, search): ... +def tables_from_leftmost(clause) -> None: ... +def surface_selectables(clause) -> None: ... +def surface_selectables_only(clause) -> None: ... +def extract_first_column_annotation(column, annotation_name): ... +def selectables_overlap(left, right): ... +def bind_values(clause): ... + +class _repr_base: + max_chars: Any + def trunc(self, value): ... + +class _repr_row(_repr_base): + row: Any + max_chars: Any + def __init__(self, row, max_chars: int = ...) -> None: ... + +class _repr_params(_repr_base): + params: Any + ismulti: Any + batches: Any + max_chars: Any + def __init__(self, params, batches, max_chars: int = ..., ismulti: Any | None = ...) -> None: ... + +def adapt_criterion_to_null(crit, nulls): ... +def splice_joins(left, right, stop_on: Any | None = ...): ... +def reduce_columns(columns, *clauses, **kw): ... +def criterion_as_pairs( + expression, + consider_as_foreign_keys: Any | None = ..., + consider_as_referenced_keys: Any | None = ..., + any_operator: bool = ..., +): ... + +class ClauseAdapter(visitors.ReplacingExternalTraversal): + __traverse_options__: Any + selectable: Any + include_fn: Any + exclude_fn: Any + equivalents: Any + adapt_on_names: Any + adapt_from_selectables: Any + def __init__( + self, + selectable, + equivalents: Any | None = ..., + include_fn: Any | None = ..., + exclude_fn: Any | None = ..., + adapt_on_names: bool = ..., + anonymize_labels: bool = ..., + adapt_from_selectables: Any | None = ..., + ) -> None: ... + def replace(self, col, _include_singleton_constants: bool = ...): ... + +class ColumnAdapter(ClauseAdapter): + columns: Any + adapt_required: Any + allow_label_resolve: Any + def __init__( + self, + selectable, + equivalents: Any | None = ..., + adapt_required: bool = ..., + include_fn: Any | None = ..., + exclude_fn: Any | None = ..., + adapt_on_names: bool = ..., + allow_label_resolve: bool = ..., + anonymize_labels: bool = ..., + adapt_from_selectables: Any | None = ..., + ) -> None: ... + class _IncludeExcludeMapping: + parent: Any + columns: Any + def __init__(self, parent, columns) -> None: ... + def __getitem__(self, key): ... + def wrap(self, adapter): ... + def traverse(self, obj): ... + adapt_clause: Any + adapt_list: Any + def adapt_check_present(self, col): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi new file mode 100644 index 000000000..c3dd44793 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi @@ -0,0 +1,86 @@ +from typing import Any + +class TraversibleType(type): + def __init__(cls, clsname, bases, clsdict) -> None: ... + +class Traversible: + def __class_getitem__(cls, key): ... + def get_children(self, omit_attrs=..., **kw): ... + +class _InternalTraversalType(type): + def __init__(cls, clsname, bases, clsdict) -> None: ... + +class InternalTraversal: + def dispatch(self, visit_symbol): ... + def run_generated_dispatch(self, target, internal_dispatch, generate_dispatcher_name): ... + def generate_dispatch(self, target_cls, internal_dispatch, generate_dispatcher_name): ... + dp_has_cache_key: Any + dp_has_cache_key_list: Any + dp_clauseelement: Any + dp_fromclause_canonical_column_collection: Any + dp_clauseelement_tuples: Any + dp_clauseelement_list: Any + dp_clauseelement_tuple: Any + dp_executable_options: Any + dp_with_context_options: Any + dp_fromclause_ordered_set: Any + dp_string: Any + dp_string_list: Any + dp_anon_name: Any + dp_boolean: Any + dp_operator: Any + dp_type: Any + dp_plain_dict: Any + dp_dialect_options: Any + dp_string_clauseelement_dict: Any + dp_string_multi_dict: Any + dp_annotations_key: Any + dp_plain_obj: Any + dp_named_ddl_element: Any + dp_prefix_sequence: Any + dp_table_hint_list: Any + dp_setup_join_tuple: Any + dp_memoized_select_entities: Any + dp_statement_hint_list: Any + dp_unknown_structure: Any + dp_dml_ordered_values: Any + dp_dml_values: Any + dp_dml_multi_values: Any + dp_propagate_attrs: Any + +class ExtendedInternalTraversal(InternalTraversal): + dp_ignore: Any + dp_inspectable: Any + dp_multi: Any + dp_multi_list: Any + dp_has_cache_key_tuples: Any + dp_inspectable_list: Any + +class ExternalTraversal: + __traverse_options__: Any + def traverse_single(self, obj, **kw): ... + def iterate(self, obj): ... + def traverse(self, obj): ... + @property + def visitor_iterator(self) -> None: ... + def chain(self, visitor): ... + +class CloningExternalTraversal(ExternalTraversal): + def copy_and_process(self, list_): ... + def traverse(self, obj): ... + +class ReplacingExternalTraversal(CloningExternalTraversal): + def replace(self, elem) -> None: ... + def traverse(self, obj): ... + +Visitable = Traversible +VisitableType = TraversibleType +ClauseVisitor = ExternalTraversal +CloningVisitor = CloningExternalTraversal +ReplacingCloningVisitor = ReplacingExternalTraversal + +def iterate(obj, opts=...) -> None: ... +def traverse_using(iterator, obj, visitors): ... +def traverse(obj, opts, visitors): ... +def cloned_traverse(obj, opts, visitors): ... +def replacement_traverse(obj, opts, replace): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/__init__.pyi new file mode 100644 index 000000000..a27e338db --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/__init__.pyi @@ -0,0 +1,74 @@ +from . import config as config, mock as mock +from .assertions import ( + AssertsCompiledSQL as AssertsCompiledSQL, + AssertsExecutionResults as AssertsExecutionResults, + ComparesTables as ComparesTables, + assert_raises as assert_raises, + assert_raises_context_ok as assert_raises_context_ok, + assert_raises_message as assert_raises_message, + assert_raises_message_context_ok as assert_raises_message_context_ok, + emits_warning as emits_warning, + emits_warning_on as emits_warning_on, + eq_ as eq_, + eq_ignore_whitespace as eq_ignore_whitespace, + eq_regex as eq_regex, + expect_deprecated as expect_deprecated, + expect_deprecated_20 as expect_deprecated_20, + expect_raises as expect_raises, + expect_raises_message as expect_raises_message, + expect_warnings as expect_warnings, + in_ as in_, + is_ as is_, + is_false as is_false, + is_instance_of as is_instance_of, + is_none as is_none, + is_not as is_not, + is_not_ as is_not_, + is_not_none as is_not_none, + is_true as is_true, + le_ as le_, + ne_ as ne_, + not_in as not_in, + not_in_ as not_in_, + startswith_ as startswith_, + uses_deprecated as uses_deprecated, +) +from .config import ( + async_test as async_test, + combinations as combinations, + combinations_list as combinations_list, + db as db, + fixture as fixture, +) +from .exclusions import ( + db_spec as db_spec, + exclude as exclude, + fails as fails, + fails_if as fails_if, + fails_on as fails_on, + fails_on_everything_except as fails_on_everything_except, + future as future, + only_if as only_if, + only_on as only_on, + skip as skip, + skip_if as skip_if, +) +from .schema import eq_clause_element as eq_clause_element, eq_type_affinity as eq_type_affinity +from .util import ( + adict as adict, + fail as fail, + flag_combinations as flag_combinations, + force_drop_names as force_drop_names, + lambda_combinations as lambda_combinations, + metadata_fixture as metadata_fixture, + provide_metadata as provide_metadata, + resolve_lambda as resolve_lambda, + rowset as rowset, + run_as_contextmanager as run_as_contextmanager, + teardown_events as teardown_events, +) +from .warnings import assert_warnings as assert_warnings, warn_test_suite as warn_test_suite + +def against(*queries): ... + +crashes = skip diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi new file mode 100644 index 000000000..024be0f28 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi @@ -0,0 +1,85 @@ +from typing import Any + +def expect_warnings(*messages, **kw): ... +def expect_warnings_on(db, *messages, **kw) -> None: ... +def emits_warning(*messages): ... +def expect_deprecated(*messages, **kw): ... +def expect_deprecated_20(*messages, **kw): ... +def emits_warning_on(db, *messages): ... +def uses_deprecated(*messages): ... +def global_cleanup_assertions() -> None: ... +def eq_regex(a, b, msg: Any | None = ...) -> None: ... +def eq_(a, b, msg: Any | None = ...) -> None: ... +def ne_(a, b, msg: Any | None = ...) -> None: ... +def le_(a, b, msg: Any | None = ...) -> None: ... +def is_instance_of(a, b, msg: Any | None = ...) -> None: ... +def is_none(a, msg: Any | None = ...) -> None: ... +def is_not_none(a, msg: Any | None = ...) -> None: ... +def is_true(a, msg: Any | None = ...) -> None: ... +def is_false(a, msg: Any | None = ...) -> None: ... +def is_(a, b, msg: Any | None = ...) -> None: ... +def is_not(a, b, msg: Any | None = ...) -> None: ... + +is_not_ = is_not + +def in_(a, b, msg: Any | None = ...) -> None: ... +def not_in(a, b, msg: Any | None = ...) -> None: ... + +not_in_ = not_in + +def startswith_(a, fragment, msg: Any | None = ...) -> None: ... +def eq_ignore_whitespace(a, b, msg: Any | None = ...) -> None: ... +def assert_raises(except_cls, callable_, *args, **kw): ... +def assert_raises_context_ok(except_cls, callable_, *args, **kw): ... +def assert_raises_message(except_cls, msg, callable_, *args, **kwargs): ... +def assert_raises_message_context_ok(except_cls, msg, callable_, *args, **kwargs): ... + +class _ErrorContainer: + error: Any + +def expect_raises(except_cls, check_context: bool = ...): ... +def expect_raises_message(except_cls, msg, check_context: bool = ...): ... + +class AssertsCompiledSQL: + test_statement: Any + supports_execution: Any + def assert_compile( + self, + clause, + result, + params: Any | None = ..., + checkparams: Any | None = ..., + for_executemany: bool = ..., + check_literal_execute: Any | None = ..., + check_post_param: Any | None = ..., + dialect: Any | None = ..., + checkpositional: Any | None = ..., + check_prefetch: Any | None = ..., + use_default_dialect: bool = ..., + allow_dialect_select: bool = ..., + supports_default_values: bool = ..., + supports_default_metavalue: bool = ..., + literal_binds: bool = ..., + render_postcompile: bool = ..., + schema_translate_map: Any | None = ..., + render_schema_translate: bool = ..., + default_schema_name: Any | None = ..., + from_linting: bool = ..., + ): ... + +class ComparesTables: + def assert_tables_equal(self, table, reflected_table, strict_types: bool = ...) -> None: ... + def assert_types_base(self, c1, c2) -> None: ... + +class AssertsExecutionResults: + def assert_result(self, result, class_, *objects) -> None: ... + def assert_list(self, result, class_, list_) -> None: ... + def assert_row(self, class_, rowobj, desc) -> None: ... + def assert_unordered_result(self, result, cls, *expected): ... + def sql_execution_asserter(self, db: Any | None = ...): ... + def assert_sql_execution(self, db, callable_, *rules): ... + def assert_sql(self, db, callable_, rules): ... + def assert_sql_count(self, db, callable_, count) -> None: ... + def assert_multiple_sql_count(self, dbs, callable_, counts): ... + def assert_execution(self, db, *rules) -> None: ... + def assert_statement_count(self, db, count): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/assertsql.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/assertsql.pyi new file mode 100644 index 000000000..6e30c7727 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/assertsql.pyi @@ -0,0 +1,82 @@ +from typing import Any + +class AssertRule: + is_consumed: bool + errormessage: Any + consume_statement: bool + def process_statement(self, execute_observed) -> None: ... + def no_more_statements(self) -> None: ... + +class SQLMatchRule(AssertRule): ... + +class CursorSQL(SQLMatchRule): + statement: Any + params: Any + consume_statement: Any + def __init__(self, statement, params: Any | None = ..., consume_statement: bool = ...) -> None: ... + errormessage: Any + is_consumed: bool + def process_statement(self, execute_observed) -> None: ... + +class CompiledSQL(SQLMatchRule): + statement: Any + params: Any + dialect: Any + def __init__(self, statement, params: Any | None = ..., dialect: str = ...) -> None: ... + is_consumed: bool + errormessage: Any + def process_statement(self, execute_observed) -> None: ... + +class RegexSQL(CompiledSQL): + regex: Any + orig_regex: Any + params: Any + dialect: Any + def __init__(self, regex, params: Any | None = ..., dialect: str = ...) -> None: ... + +class DialectSQL(CompiledSQL): ... + +class CountStatements(AssertRule): + count: Any + def __init__(self, count) -> None: ... + def process_statement(self, execute_observed) -> None: ... + def no_more_statements(self) -> None: ... + +class AllOf(AssertRule): + rules: Any + def __init__(self, *rules) -> None: ... + is_consumed: bool + errormessage: Any + def process_statement(self, execute_observed) -> None: ... + +class EachOf(AssertRule): + rules: Any + def __init__(self, *rules) -> None: ... + errormessage: Any + is_consumed: bool + def process_statement(self, execute_observed) -> None: ... + def no_more_statements(self) -> None: ... + +class Conditional(EachOf): + def __init__(self, condition, rules, else_rules) -> None: ... + +class Or(AllOf): + is_consumed: bool + errormessage: Any + def process_statement(self, execute_observed) -> None: ... + +class SQLExecuteObserved: + context: Any + clauseelement: Any + parameters: Any + statements: Any + def __init__(self, context, clauseelement, multiparams, params) -> None: ... + +class SQLCursorExecuteObserved: ... + +class SQLAsserter: + accumulated: Any + def __init__(self) -> None: ... + def assert_(self, *rules) -> None: ... + +def assert_engine(engine) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/asyncio.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/asyncio.pyi new file mode 100644 index 000000000..7455e47b8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/asyncio.pyi @@ -0,0 +1 @@ +ENABLE_ASYNCIO: bool diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi new file mode 100644 index 000000000..db67aa9cb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi @@ -0,0 +1,47 @@ +from typing import Any + +requirements: Any +db: Any +db_url: Any +db_opts: Any +file_config: Any +test_schema: Any +test_schema_2: Any +any_async: bool +ident: str + +def combinations(*comb, **kw): ... +def combinations_list(arg_iterable, **kw): ... +def fixture(*arg, **kw): ... +def get_current_test_name(): ... +def mark_base_test_class(): ... + +class Config: + db: Any + db_opts: Any + options: Any + file_config: Any + test_schema: str + test_schema_2: str + is_async: Any + def __init__(self, db, db_opts, options, file_config) -> None: ... + @classmethod + def register(cls, db, db_opts, options, file_config): ... + @classmethod + def set_as_current(cls, config, namespace) -> None: ... + @classmethod + def push_engine(cls, db, namespace) -> None: ... + @classmethod + def push(cls, config, namespace) -> None: ... + @classmethod + def pop(cls, namespace) -> None: ... + @classmethod + def reset(cls, namespace) -> None: ... + @classmethod + def all_configs(cls): ... + @classmethod + def all_dbs(cls) -> None: ... + def skip_test(self, msg) -> None: ... + +def skip_test(msg) -> None: ... +def async_test(fn): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/engines.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/engines.pyi new file mode 100644 index 000000000..400503ba8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/engines.pyi @@ -0,0 +1,68 @@ +from typing import Any + +class ConnectionKiller: + proxy_refs: Any + testing_engines: Any + dbapi_connections: Any + def __init__(self) -> None: ... + def add_pool(self, pool) -> None: ... + def add_engine(self, engine, scope) -> None: ... + def rollback_all(self) -> None: ... + def checkin_all(self) -> None: ... + def close_all(self) -> None: ... + def prepare_for_drop_tables(self, connection) -> None: ... + def after_test(self) -> None: ... + def after_test_outside_fixtures(self, test) -> None: ... + def stop_test_class_inside_fixtures(self) -> None: ... + def stop_test_class_outside_fixtures(self) -> None: ... + def final_cleanup(self) -> None: ... + def assert_all_closed(self) -> None: ... + +testing_reaper: Any + +def assert_conns_closed(fn, *args, **kw) -> None: ... +def rollback_open_connections(fn, *args, **kw) -> None: ... +def close_first(fn, *args, **kw) -> None: ... +def close_open_connections(fn, *args, **kw) -> None: ... +def all_dialects(exclude: Any | None = ...) -> None: ... + +class ReconnectFixture: + dbapi: Any + connections: Any + is_stopped: bool + def __init__(self, dbapi) -> None: ... + def __getattr__(self, key): ... + def connect(self, *args, **kwargs): ... + def shutdown(self, stop: bool = ...) -> None: ... + def restart(self) -> None: ... + +def reconnecting_engine(url: Any | None = ..., options: Any | None = ...): ... +def testing_engine( + url: Any | None = ..., + options: Any | None = ..., + future: Any | None = ..., + asyncio: bool = ..., + transfer_staticpool: bool = ..., +): ... +def mock_engine(dialect_name: Any | None = ...): ... + +class DBAPIProxyCursor: + engine: Any + connection: Any + cursor: Any + def __init__(self, engine, conn, *args, **kwargs) -> None: ... + def execute(self, stmt, parameters: Any | None = ..., **kw): ... + def executemany(self, stmt, params, **kw): ... + def __iter__(self): ... + def __getattr__(self, key): ... + +class DBAPIProxyConnection: + conn: Any + engine: Any + cursor_cls: Any + def __init__(self, engine, cursor_cls) -> None: ... + def cursor(self, *args, **kwargs): ... + def close(self) -> None: ... + def __getattr__(self, key): ... + +def proxying_engine(conn_cls=..., cursor_cls=...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/entities.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/entities.pyi new file mode 100644 index 000000000..0afb34e39 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/entities.pyi @@ -0,0 +1,9 @@ +class BasicEntity: + def __init__(self, **kw) -> None: ... + +class ComparableMixin: + def __ne__(self, other): ... + def __eq__(self, other): ... + +class ComparableEntity(ComparableMixin, BasicEntity): + def __hash__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/exclusions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/exclusions.pyi new file mode 100644 index 000000000..4cc9913e6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/exclusions.pyi @@ -0,0 +1,76 @@ +from typing import Any + +def skip_if(predicate, reason: Any | None = ...): ... +def fails_if(predicate, reason: Any | None = ...): ... + +class compound: + fails: Any + skips: Any + tags: Any + def __init__(self) -> None: ... + def __add__(self, other): ... + def as_skips(self): ... + def add(self, *others): ... + def not_(self): ... + @property + def enabled(self): ... + def enabled_for_config(self, config): ... + def matching_config_reasons(self, config): ... + def include_test(self, include_tags, exclude_tags): ... + def __call__(self, fn): ... + def fail_if(self) -> None: ... + +def requires_tag(tagname): ... +def tags(tagnames): ... +def only_if(predicate, reason: Any | None = ...): ... +def succeeds_if(predicate, reason: Any | None = ...): ... + +class Predicate: + @classmethod + def as_predicate(cls, predicate, description: Any | None = ...): ... + +class BooleanPredicate(Predicate): + value: Any + description: Any + def __init__(self, value, description: Any | None = ...) -> None: ... + def __call__(self, config): ... + +class SpecPredicate(Predicate): + db: Any + op: Any + spec: Any + description: Any + def __init__(self, db, op: Any | None = ..., spec: Any | None = ..., description: Any | None = ...) -> None: ... + def __call__(self, config): ... + +class LambdaPredicate(Predicate): + lambda_: Any + args: Any + kw: Any + description: Any + def __init__(self, lambda_, description: Any | None = ..., args: Any | None = ..., kw: Any | None = ...): ... + def __call__(self, config): ... + +class NotPredicate(Predicate): + predicate: Any + description: Any + def __init__(self, predicate, description: Any | None = ...) -> None: ... + def __call__(self, config): ... + +class OrPredicate(Predicate): + predicates: Any + description: Any + def __init__(self, predicates, description: Any | None = ...) -> None: ... + def __call__(self, config): ... + +def db_spec(*dbs): ... +def open(): ... +def closed(): ... +def fails(reason: Any | None = ...): ... +def future(fn, *arg): ... +def fails_on(db, reason: Any | None = ...): ... +def fails_on_everything_except(*dbs): ... +def skip(db, reason: Any | None = ...): ... +def only_on(dbs, reason: Any | None = ...): ... +def exclude(db, op, spec, reason: Any | None = ...): ... +def against(config, *queries): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/fixtures.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/fixtures.pyi new file mode 100644 index 000000000..58c6be2e8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/fixtures.pyi @@ -0,0 +1,83 @@ +from typing import Any + +from . import assertions +from .entities import ComparableEntity as ComparableEntity + +class TestBase: + __requires__: Any + __unsupported_on__: Any + __only_on__: Any + __skip_if__: Any + __leave_connections_for_teardown__: bool + def assert_(self, val, msg: Any | None = ...) -> None: ... + def connection_no_trans(self) -> None: ... + def connection(self) -> None: ... + def registry(self, metadata) -> None: ... + def future_connection(self, future_engine, connection) -> None: ... + def future_engine(self) -> None: ... + def testing_engine(self): ... + def async_testing_engine(self, testing_engine): ... + def metadata(self, request) -> None: ... + def trans_ctx_manager_fixture(self, request, metadata): ... + +class FutureEngineMixin: ... + +class TablesTest(TestBase): + run_setup_bind: str + run_define_tables: str + run_create_tables: str + run_inserts: str + run_deletes: str + run_dispose_bind: Any + bind: Any + tables: Any + other: Any + sequences: Any + @property + def tables_test_metadata(self): ... + @classmethod + def setup_bind(cls): ... + @classmethod + def dispose_bind(cls, bind) -> None: ... + @classmethod + def define_tables(cls, metadata) -> None: ... + @classmethod + def fixtures(cls): ... + @classmethod + def insert_data(cls, connection) -> None: ... + def sql_count_(self, count, fn) -> None: ... + def sql_eq_(self, callable_, statements) -> None: ... + +class NoCache: ... + +class RemovesEvents: + def event_listen(self, target, name, fn, **kw) -> None: ... + +def fixture_session(**kw): ... +def stop_test_class_inside_fixtures(cls) -> None: ... +def after_test() -> None: ... + +class ORMTest(TestBase): ... + +class MappedTest(TablesTest, assertions.AssertsExecutionResults): + run_setup_classes: str + run_setup_mappers: str + classes: Any + @classmethod + def setup_classes(cls) -> None: ... + @classmethod + def setup_mappers(cls) -> None: ... + +class DeclarativeMappedTest(MappedTest): + run_setup_classes: str + run_setup_mappers: str + +class ComputedReflectionFixtureTest(TablesTest): + run_inserts: Any + run_deletes: Any + __backend__: bool + __requires__: Any + regexp: Any + def normalize(self, text): ... + @classmethod + def define_tables(cls, metadata) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/mock.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/mock.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/pickleable.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/pickleable.pyi new file mode 100644 index 000000000..837dfac04 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/pickleable.pyi @@ -0,0 +1,62 @@ +from typing import Any + +from . import fixtures + +class User(fixtures.ComparableEntity): ... +class Order(fixtures.ComparableEntity): ... +class Dingaling(fixtures.ComparableEntity): ... +class EmailUser(User): ... +class Address(fixtures.ComparableEntity): ... +class Child1(fixtures.ComparableEntity): ... +class Child2(fixtures.ComparableEntity): ... +class Parent(fixtures.ComparableEntity): ... + +class Screen: + obj: Any + parent: Any + def __init__(self, obj, parent: Any | None = ...) -> None: ... + +class Foo: + data: str + stuff: Any + moredata: Any + def __init__(self, moredata, stuff: str = ...) -> None: ... + __hash__: Any + def __eq__(self, other): ... + +class Bar: + x: Any + y: Any + def __init__(self, x, y) -> None: ... + __hash__: Any + def __eq__(self, other): ... + +class OldSchool: + x: Any + y: Any + def __init__(self, x, y) -> None: ... + def __eq__(self, other): ... + +class OldSchoolWithoutCompare: + x: Any + y: Any + def __init__(self, x, y) -> None: ... + +class BarWithoutCompare: + x: Any + y: Any + def __init__(self, x, y) -> None: ... + +class NotComparable: + data: Any + def __init__(self, data) -> None: ... + def __hash__(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class BrokenComparable: + data: Any + def __init__(self, data) -> None: ... + def __hash__(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/plugin/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/plugin/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/plugin/bootstrap.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/plugin/bootstrap.pyi new file mode 100644 index 000000000..5c554d0de --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/plugin/bootstrap.pyi @@ -0,0 +1,6 @@ +from typing import Any + +bootstrap_file: Any +to_bootstrap: Any + +def load_file_as_module(name): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/plugin/plugin_base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/plugin/plugin_base.pyi new file mode 100644 index 000000000..e0cdfbe59 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/plugin/plugin_base.pyi @@ -0,0 +1,63 @@ +import abc +from typing import Any + +bootstrapped_as_sqlalchemy: bool +log: Any +py3k: Any +ABC = abc.ABC + +fixtures: Any +engines: Any +exclusions: Any +warnings: Any +profiling: Any +provision: Any +assertions: Any +requirements: Any +config: Any +testing: Any +util: Any +file_config: Any +include_tags: Any +exclude_tags: Any +options: Any + +def setup_options(make_option) -> None: ... +def configure_follower(follower_ident) -> None: ... +def memoize_important_follower_config(dict_) -> None: ... +def restore_important_follower_config(dict_) -> None: ... +def read_config() -> None: ... +def pre_begin(opt) -> None: ... +def set_coverage_flag(value) -> None: ... +def post_begin() -> None: ... + +pre_configure: Any +post_configure: Any + +def pre(fn): ... +def post(fn): ... +def want_class(name, cls): ... +def want_method(cls, fn): ... +def generate_sub_tests(cls, module) -> None: ... +def start_test_class_outside_fixtures(cls) -> None: ... +def stop_test_class(cls) -> None: ... +def stop_test_class_outside_fixtures(cls) -> None: ... +def final_process_cleanup() -> None: ... +def before_test(test, test_module_name, test_class, test_name) -> None: ... +def after_test(test) -> None: ... +def after_test_fixtures(test) -> None: ... + +class FixtureFunctions(ABC, metaclass=abc.ABCMeta): + @abc.abstractmethod + def skip_test_exception(self, *arg, **kw): ... + @abc.abstractmethod + def combinations(self, *args, **kw): ... + @abc.abstractmethod + def param_ident(self, *args, **kw): ... + @abc.abstractmethod + def fixture(self, *arg, **kw): ... + def get_current_test_name(self) -> None: ... + @abc.abstractmethod + def mark_base_test_class(self): ... + +def set_fixture_functions(fixture_fn_class) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/plugin/pytestplugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/plugin/pytestplugin.pyi new file mode 100644 index 000000000..ded604f35 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/plugin/pytestplugin.pyi @@ -0,0 +1,36 @@ +from typing import Any + +from . import plugin_base + +has_xdist: bool +py2k: Any + +def pytest_addoption(parser) -> None: ... +def pytest_configure(config) -> None: ... + +DUMP_PYANNOTATE: bool + +def collect_types_fixture() -> None: ... +def pytest_sessionstart(session) -> None: ... +def pytest_sessionfinish(session) -> None: ... +def pytest_collection_finish(session): ... +def pytest_configure_node(node) -> None: ... +def pytest_testnodedown(node, error) -> None: ... +def pytest_collection_modifyitems(session, config, items): ... +def pytest_pycollect_makeitem(collector, name, obj): ... +def pytest_runtest_setup(item) -> None: ... +def pytest_runtest_teardown(item, nextitem) -> None: ... +def pytest_runtest_call(item) -> None: ... +def pytest_runtest_logreport(report) -> None: ... +def setup_class_methods(request) -> None: ... +def setup_test_methods(request) -> None: ... +def getargspec(fn): ... + +class PytestFixtureFunctions(plugin_base.FixtureFunctions): + def skip_test_exception(self, *arg, **kw): ... + def mark_base_test_class(self): ... + def combinations(self, *arg_sets, **kw): ... + def param_ident(self, *parameters): ... + def fixture(self, *arg, **kw): ... + def get_current_test_name(self): ... + def async_test(self, fn): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/plugin/reinvent_fixtures_py2k.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/plugin/reinvent_fixtures_py2k.pyi new file mode 100644 index 000000000..83f3da864 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/plugin/reinvent_fixtures_py2k.pyi @@ -0,0 +1,6 @@ +def add_fixture(fn, fixture) -> None: ... +def scan_for_fixtures_to_use_for_class(item) -> None: ... +def run_class_fixture_setup(request) -> None: ... +def run_class_fixture_teardown(request) -> None: ... +def run_fn_fixture_setup(request) -> None: ... +def run_fn_fixture_teardown(request) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/profiling.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/profiling.pyi new file mode 100644 index 000000000..ff48b0d7e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/profiling.pyi @@ -0,0 +1,20 @@ +from typing import Any + +class ProfileStatsFile: + force_write: Any + write: Any + fname: Any + short_fname: Any + data: Any + dump: Any + sort: Any + def __init__(self, filename, sort: str = ..., dump: Any | None = ...): ... + @property + def platform_key(self): ... + def has_stats(self): ... + def result(self, callcount): ... + def reset_count(self) -> None: ... + def replace(self, callcount) -> None: ... + +def function_call_count(variance: float = ..., times: int = ..., warmup: int = ...): ... +def count_functions(variance: float = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi new file mode 100644 index 000000000..ec8c6487d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi @@ -0,0 +1,34 @@ +from typing import Any + +log: Any +FOLLOWER_IDENT: Any + +class register: + fns: Any + def __init__(self) -> None: ... + @classmethod + def init(cls, fn): ... + def for_db(self, *dbnames): ... + def __call__(self, cfg, *arg): ... + +def create_follower_db(follower_ident) -> None: ... +def setup_config(db_url, options, file_config, follower_ident): ... +def drop_follower_db(follower_ident) -> None: ... +def generate_db_urls(db_urls, extra_drivers) -> None: ... +def generate_driver_url(url, driver, query_str): ... +def drop_all_schema_objects_pre_tables(cfg, eng) -> None: ... +def drop_all_schema_objects_post_tables(cfg, eng) -> None: ... +def drop_all_schema_objects(cfg, eng) -> None: ... +def create_db(cfg, eng, ident) -> None: ... +def drop_db(cfg, eng, ident) -> None: ... +def update_db_opts(cfg, db_opts) -> None: ... +def post_configure_engine(url, engine, follower_ident) -> None: ... +def follower_url_from_main(url, ident): ... +def configure_follower(cfg, ident) -> None: ... +def run_reap_dbs(url, ident) -> None: ... +def reap_dbs(idents_file) -> None: ... +def temp_table_keyword_args(cfg, eng) -> None: ... +def prepare_for_drop_tables(config, connection) -> None: ... +def stop_test_class_outside_fixtures(config, db, testcls) -> None: ... +def get_temp_table_name(cfg, eng, base_name): ... +def set_default_schema_on_connection(cfg, dbapi_connection, schema_name) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/requirements.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/requirements.pyi new file mode 100644 index 000000000..5f0a97c1a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/requirements.pyi @@ -0,0 +1,381 @@ +class Requirements: ... + +class SuiteRequirements(Requirements): + @property + def create_table(self): ... + @property + def drop_table(self): ... + @property + def table_ddl_if_exists(self): ... + @property + def index_ddl_if_exists(self): ... + @property + def foreign_keys(self): ... + @property + def table_value_constructor(self): ... + @property + def standard_cursor_sql(self): ... + @property + def on_update_cascade(self): ... + @property + def non_updating_cascade(self): ... + @property + def deferrable_fks(self): ... + @property + def on_update_or_deferrable_fks(self): ... + @property + def queue_pool(self): ... + @property + def self_referential_foreign_keys(self): ... + @property + def foreign_key_ddl(self): ... + @property + def named_constraints(self): ... + @property + def implicitly_named_constraints(self): ... + @property + def subqueries(self): ... + @property + def offset(self): ... + @property + def bound_limit_offset(self): ... + @property + def sql_expression_limit_offset(self): ... + @property + def parens_in_union_contained_select_w_limit_offset(self): ... + @property + def parens_in_union_contained_select_wo_limit_offset(self): ... + @property + def boolean_col_expressions(self): ... + @property + def nullable_booleans(self): ... + @property + def nullsordering(self): ... + @property + def standalone_binds(self): ... + @property + def standalone_null_binds_whereclause(self): ... + @property + def intersect(self): ... + @property + def except_(self): ... + @property + def window_functions(self): ... + @property + def ctes(self): ... + @property + def ctes_with_update_delete(self): ... + @property + def ctes_on_dml(self): ... + @property + def autoincrement_insert(self): ... + @property + def fetch_rows_post_commit(self): ... + @property + def group_by_complex_expression(self): ... + @property + def sane_rowcount(self): ... + @property + def sane_multi_rowcount(self): ... + @property + def sane_rowcount_w_returning(self): ... + @property + def empty_inserts(self): ... + @property + def empty_inserts_executemany(self): ... + @property + def insert_from_select(self): ... + @property + def full_returning(self): ... + @property + def insert_executemany_returning(self): ... + @property + def returning(self): ... + @property + def tuple_in(self): ... + @property + def tuple_in_w_empty(self): ... + @property + def duplicate_names_in_cursor_description(self): ... + @property + def denormalized_names(self): ... + @property + def multivalues_inserts(self): ... + @property + def implements_get_lastrowid(self): ... + @property + def emulated_lastrowid(self): ... + @property + def emulated_lastrowid_even_with_sequences(self): ... + @property + def dbapi_lastrowid(self): ... + @property + def views(self): ... + @property + def schemas(self): ... + @property + def cross_schema_fk_reflection(self): ... + @property + def foreign_key_constraint_name_reflection(self): ... + @property + def implicit_default_schema(self): ... + @property + def default_schema_name_switch(self): ... + @property + def server_side_cursors(self): ... + @property + def sequences(self): ... + @property + def no_sequences(self): ... + @property + def sequences_optional(self): ... + @property + def supports_lastrowid(self): ... + @property + def no_lastrowid_support(self): ... + @property + def reflects_pk_names(self): ... + @property + def table_reflection(self): ... + @property + def reflect_tables_no_columns(self): ... + @property + def comment_reflection(self): ... + @property + def view_column_reflection(self): ... + @property + def view_reflection(self): ... + @property + def schema_reflection(self): ... + @property + def primary_key_constraint_reflection(self): ... + @property + def foreign_key_constraint_reflection(self): ... + @property + def foreign_key_constraint_option_reflection_ondelete(self): ... + @property + def fk_constraint_option_reflection_ondelete_restrict(self): ... + @property + def fk_constraint_option_reflection_ondelete_noaction(self): ... + @property + def foreign_key_constraint_option_reflection_onupdate(self): ... + @property + def fk_constraint_option_reflection_onupdate_restrict(self): ... + @property + def temp_table_reflection(self): ... + @property + def temp_table_reflect_indexes(self): ... + @property + def temp_table_names(self): ... + @property + def temporary_tables(self): ... + @property + def temporary_views(self): ... + @property + def index_reflection(self): ... + @property + def index_reflects_included_columns(self): ... + @property + def indexes_with_ascdesc(self): ... + @property + def indexes_with_expressions(self): ... + @property + def unique_constraint_reflection(self): ... + @property + def check_constraint_reflection(self): ... + @property + def duplicate_key_raises_integrity_error(self): ... + @property + def unbounded_varchar(self): ... + @property + def unicode_data(self): ... + @property + def unicode_ddl(self): ... + @property + def symbol_names_w_double_quote(self): ... + @property + def datetime_literals(self): ... + @property + def datetime(self): ... + @property + def datetime_microseconds(self): ... + @property + def timestamp_microseconds(self): ... + @property + def datetime_historic(self): ... + @property + def date(self): ... + @property + def date_coerces_from_datetime(self): ... + @property + def date_historic(self): ... + @property + def time(self): ... + @property + def time_microseconds(self): ... + @property + def binary_comparisons(self): ... + @property + def binary_literals(self): ... + @property + def autocommit(self): ... + @property + def isolation_level(self): ... + def get_isolation_levels(self, config) -> None: ... + @property + def json_type(self): ... + @property + def json_array_indexes(self): ... + @property + def json_index_supplementary_unicode_element(self): ... + @property + def legacy_unconditional_json_extract(self): ... + @property + def precision_numerics_general(self): ... + @property + def precision_numerics_enotation_small(self): ... + @property + def precision_numerics_enotation_large(self): ... + @property + def precision_numerics_many_significant_digits(self): ... + @property + def cast_precision_numerics_many_significant_digits(self): ... + @property + def implicit_decimal_binds(self): ... + @property + def nested_aggregates(self): ... + @property + def recursive_fk_cascade(self): ... + @property + def precision_numerics_retains_significant_digits(self): ... + @property + def infinity_floats(self): ... + @property + def precision_generic_float_type(self): ... + @property + def floats_to_four_decimals(self): ... + @property + def fetch_null_from_numeric(self): ... + @property + def text_type(self): ... + @property + def empty_strings_varchar(self): ... + @property + def empty_strings_text(self): ... + @property + def expressions_against_unbounded_text(self): ... + @property + def selectone(self): ... + @property + def savepoints(self): ... + @property + def two_phase_transactions(self): ... + @property + def update_from(self): ... + @property + def delete_from(self): ... + @property + def update_where_target_in_subquery(self): ... + @property + def mod_operator_as_percent_sign(self): ... + @property + def percent_schema_names(self): ... + @property + def order_by_col_from_union(self): ... + @property + def order_by_label_with_expression(self): ... + @property + def order_by_collation(self): ... + def get_order_by_collation(self, config) -> None: ... + @property + def unicode_connections(self): ... + @property + def graceful_disconnects(self): ... + @property + def independent_connections(self): ... + @property + def skip_mysql_on_windows(self): ... + @property + def ad_hoc_engines(self): ... + @property + def no_windows(self): ... + @property + def timing_intensive(self): ... + @property + def memory_intensive(self): ... + @property + def threading_with_mock(self): ... + @property + def sqlalchemy2_stubs(self): ... + @property + def python2(self): ... + @property + def python3(self): ... + @property + def pep520(self): ... + @property + def insert_order_dicts(self): ... + @property + def python36(self): ... + @property + def python37(self): ... + @property + def dataclasses(self): ... + @property + def python38(self): ... + @property + def cpython(self): ... + @property + def patch_library(self): ... + @property + def non_broken_pickle(self): ... + @property + def predictable_gc(self): ... + @property + def no_coverage(self): ... + @property + def sqlite(self): ... + @property + def cextensions(self): ... + @property + def async_dialect(self): ... + @property + def greenlet(self): ... + @property + def computed_columns(self): ... + @property + def computed_columns_stored(self): ... + @property + def computed_columns_virtual(self): ... + @property + def computed_columns_default_persisted(self): ... + @property + def computed_columns_reflect_persisted(self): ... + @property + def supports_distinct_on(self): ... + @property + def supports_is_distinct_from(self): ... + @property + def identity_columns(self): ... + @property + def identity_columns_standard(self): ... + @property + def regexp_match(self): ... + @property + def regexp_replace(self): ... + @property + def fetch_first(self): ... + @property + def fetch_percent(self): ... + @property + def fetch_ties(self): ... + @property + def fetch_no_order_by(self): ... + @property + def fetch_offset_with_options(self): ... + @property + def fetch_expression(self): ... + @property + def autoincrement_without_sequence(self): ... + @property + def generic_classes(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/schema.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/schema.pyi new file mode 100644 index 000000000..dc8b62196 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/schema.pyi @@ -0,0 +1,16 @@ +from typing import Any + +def Table(*args, **kw): ... +def Column(*args, **kw): ... + +class eq_type_affinity: + target: Any + def __init__(self, target) -> None: ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class eq_clause_element: + target: Any + def __init__(self, target) -> None: ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi new file mode 100644 index 000000000..e716d838a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi @@ -0,0 +1,38 @@ +from typing import Any + +def non_refcount_gc_collect(*args) -> None: ... # only present on Python implementations with non-refcount gc +def gc_collect(generation: int = ...) -> None: ... +def lazy_gc() -> None: ... +def picklers(): ... +def random_choices(population, k: int = ...): ... +def round_decimal(value, prec): ... + +class RandomSet(set[Any]): + def __iter__(self): ... + def pop(self): ... + def union(self, other): ... + def difference(self, other): ... + def intersection(self, other): ... + def copy(self): ... + +def conforms_partial_ordering(tuples, sorted_elements): ... +def all_partial_orderings(tuples, elements): ... +def function_named(fn, name): ... +def run_as_contextmanager(ctx, fn, *arg, **kw): ... +def rowset(results): ... +def fail(msg) -> None: ... +def provide_metadata(fn, *args, **kw): ... +def flag_combinations(*combinations): ... +def lambda_combinations(lambda_arg_sets, **kw): ... +def resolve_lambda(__fn, **kw): ... +def metadata_fixture(ddl: str = ...): ... +def force_drop_names(*names): ... + +class adict(dict[Any, Any]): + def __getattribute__(self, key): ... + def __call__(self, *keys): ... + get_all: Any + +def drop_all_tables_from_metadata(metadata, engine_or_connection) -> None: ... +def drop_all_tables(engine, inspector, schema: Any | None = ..., include_names: Any | None = ...) -> None: ... +def teardown_events(event_cls): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/warnings.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/warnings.pyi new file mode 100644 index 000000000..9aa4255ce --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/testing/warnings.pyi @@ -0,0 +1,7 @@ +from .. import exc as sa_exc + +class SATestSuiteWarning(sa_exc.SAWarning): ... + +def warn_test_suite(message) -> None: ... +def setup_filters() -> None: ... +def assert_warnings(fn, warning_msgs, regex: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/types.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/types.pyi new file mode 100644 index 000000000..ee455334d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/types.pyi @@ -0,0 +1,106 @@ +from .sql.sqltypes import ( + ARRAY as ARRAY, + BIGINT as BIGINT, + BINARY as BINARY, + BLOB as BLOB, + BOOLEAN as BOOLEAN, + CHAR as CHAR, + CLOB as CLOB, + DATE as DATE, + DATETIME as DATETIME, + DECIMAL as DECIMAL, + FLOAT as FLOAT, + INT as INT, + INTEGER as INTEGER, + JSON as JSON, + NCHAR as NCHAR, + NUMERIC as NUMERIC, + NVARCHAR as NVARCHAR, + REAL as REAL, + SMALLINT as SMALLINT, + TEXT as TEXT, + TIME as TIME, + TIMESTAMP as TIMESTAMP, + VARBINARY as VARBINARY, + VARCHAR as VARCHAR, + BigInteger as BigInteger, + Boolean as Boolean, + Concatenable as Concatenable, + Date as Date, + DateTime as DateTime, + Enum as Enum, + Float as Float, + Indexable as Indexable, + Integer as Integer, + Interval as Interval, + LargeBinary as LargeBinary, + MatchType as MatchType, + NullType as NullType, + Numeric as Numeric, + PickleType as PickleType, + SmallInteger as SmallInteger, + String as String, + Text as Text, + Time as Time, + TupleType as TupleType, + Unicode as Unicode, + UnicodeText as UnicodeText, + _Binary as _Binary, +) +from .sql.type_api import ( + ExternalType as ExternalType, + TypeDecorator as TypeDecorator, + TypeEngine as TypeEngine, + UserDefinedType as UserDefinedType, +) + +__all__ = [ + "TypeEngine", + "TypeDecorator", + "UserDefinedType", + "ExternalType", + "INT", + "CHAR", + "VARCHAR", + "NCHAR", + "NVARCHAR", + "TEXT", + "Text", + "FLOAT", + "NUMERIC", + "REAL", + "DECIMAL", + "TIMESTAMP", + "DATETIME", + "CLOB", + "BLOB", + "BINARY", + "VARBINARY", + "BOOLEAN", + "BIGINT", + "SMALLINT", + "INTEGER", + "DATE", + "TIME", + "TupleType", + "String", + "Integer", + "SmallInteger", + "BigInteger", + "Numeric", + "Float", + "DateTime", + "Date", + "Time", + "LargeBinary", + "Boolean", + "Unicode", + "Concatenable", + "UnicodeText", + "PickleType", + "Interval", + "Enum", + "Indexable", + "ARRAY", + "JSON", +] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi new file mode 100644 index 000000000..d569a665d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi @@ -0,0 +1,174 @@ +from collections import defaultdict as defaultdict +from contextlib import contextmanager as contextmanager +from functools import partial as partial, update_wrapper as update_wrapper + +from ._collections import ( + EMPTY_DICT as EMPTY_DICT, + EMPTY_SET as EMPTY_SET, + FacadeDict as FacadeDict, + IdentitySet as IdentitySet, + ImmutableContainer as ImmutableContainer, + ImmutableProperties as ImmutableProperties, + LRUCache as LRUCache, + OrderedDict as OrderedDict, + OrderedIdentitySet as OrderedIdentitySet, + OrderedProperties as OrderedProperties, + OrderedSet as OrderedSet, + PopulateDict as PopulateDict, + Properties as Properties, + ScopedRegistry as ScopedRegistry, + ThreadLocalRegistry as ThreadLocalRegistry, + UniqueAppender as UniqueAppender, + WeakPopulateDict as WeakPopulateDict, + WeakSequence as WeakSequence, + coerce_generator_arg as coerce_generator_arg, + coerce_to_immutabledict as coerce_to_immutabledict, + collections_abc as collections_abc, + column_dict as column_dict, + column_set as column_set, + flatten_iterator as flatten_iterator, + has_dupes as has_dupes, + has_intersection as has_intersection, + immutabledict as immutabledict, + ordered_column_set as ordered_column_set, + sort_dictionary as sort_dictionary, + to_column_set as to_column_set, + to_list as to_list, + to_set as to_set, + unique_list as unique_list, + update_copy as update_copy, +) +from ._preloaded import preload_module as preload_module, preloaded as preloaded +from .compat import ( + ABC as ABC, + TYPE_CHECKING as TYPE_CHECKING, + StringIO as StringIO, + arm as arm, + b as b, + b64decode as b64decode, + b64encode as b64encode, + binary_type as binary_type, + binary_types as binary_types, + byte_buffer as byte_buffer, + callable as callable, + cmp as cmp, + cpython as cpython, + dataclass_fields as dataclass_fields, + decode_backslashreplace as decode_backslashreplace, + dottedgetter as dottedgetter, + has_refcount_gc as has_refcount_gc, + inspect_getfullargspec as inspect_getfullargspec, + int_types as int_types, + iterbytes as iterbytes, + itertools_filter as itertools_filter, + itertools_filterfalse as itertools_filterfalse, + local_dataclass_fields as local_dataclass_fields, + namedtuple as namedtuple, + next as next, + nullcontext as nullcontext, + osx as osx, + parse_qsl as parse_qsl, + perf_counter as perf_counter, + pickle as pickle, + print_ as print_, + py2k as py2k, + py3k as py3k, + py37 as py37, + py38 as py38, + py39 as py39, + pypy as pypy, + quote_plus as quote_plus, + raise_ as raise_, + raise_from_cause as raise_from_cause, + reduce as reduce, + reraise as reraise, + string_types as string_types, + text_type as text_type, + threading as threading, + timezone as timezone, + u as u, + ue as ue, + unquote as unquote, + unquote_plus as unquote_plus, + win32 as win32, + with_metaclass as with_metaclass, + zip_longest as zip_longest, +) +from .concurrency import ( + asyncio as asyncio, + await_fallback as await_fallback, + await_only as await_only, + greenlet_spawn as greenlet_spawn, + is_exit_exception as is_exit_exception, +) +from .deprecations import ( + SQLALCHEMY_WARN_20 as SQLALCHEMY_WARN_20, + deprecated as deprecated, + deprecated_20 as deprecated_20, + deprecated_20_cls as deprecated_20_cls, + deprecated_cls as deprecated_cls, + deprecated_params as deprecated_params, + inject_docstring_text as inject_docstring_text, + moved_20 as moved_20, + warn_deprecated as warn_deprecated, + warn_deprecated_20 as warn_deprecated_20, +) +from .langhelpers import ( + EnsureKWArgType as EnsureKWArgType, + HasMemoized as HasMemoized, + MemoizedSlots as MemoizedSlots, + NoneType as NoneType, + PluginLoader as PluginLoader, + add_parameter_text as add_parameter_text, + as_interface as as_interface, + asbool as asbool, + asint as asint, + assert_arg_type as assert_arg_type, + attrsetter as attrsetter, + bool_or_str as bool_or_str, + chop_traceback as chop_traceback, + class_hierarchy as class_hierarchy, + classproperty as classproperty, + clsname_as_plain_name as clsname_as_plain_name, + coerce_kw_type as coerce_kw_type, + constructor_copy as constructor_copy, + constructor_key as constructor_key, + counter as counter, + create_proxy_methods as create_proxy_methods, + decode_slice as decode_slice, + decorator as decorator, + dictlike_iteritems as dictlike_iteritems, + duck_type_collection as duck_type_collection, + ellipses_string as ellipses_string, + format_argspec_init as format_argspec_init, + format_argspec_plus as format_argspec_plus, + generic_repr as generic_repr, + get_callable_argspec as get_callable_argspec, + get_cls_kwargs as get_cls_kwargs, + get_func_kwargs as get_func_kwargs, + getargspec_init as getargspec_init, + has_compiled_ext as has_compiled_ext, + hybridmethod as hybridmethod, + hybridproperty as hybridproperty, + iterate_attributes as iterate_attributes, + map_bits as map_bits, + md5_hex as md5_hex, + memoized_instancemethod as memoized_instancemethod, + memoized_property as memoized_property, + method_is_overridden as method_is_overridden, + methods_equivalent as methods_equivalent, + monkeypatch_proxied_specials as monkeypatch_proxied_specials, + only_once as only_once, + portable_instancemethod as portable_instancemethod, + quoted_token_parser as quoted_token_parser, + safe_reraise as safe_reraise, + set_creation_order as set_creation_order, + string_or_unprintable as string_or_unprintable, + symbol as symbol, + unbound_method_to_callable as unbound_method_to_callable, + walk_subclasses as walk_subclasses, + warn as warn, + warn_exception as warn_exception, + warn_limited as warn_limited, + wrap_callable as wrap_callable, +) diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi new file mode 100644 index 000000000..08b0fb8af --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi @@ -0,0 +1,217 @@ +import collections.abc +import sys +from typing import Any + +from ..cimmutabledict import immutabledict as immutabledict + +collections_abc = collections.abc + +EMPTY_SET: Any + +class ImmutableContainer: + __delitem__: Any + __setitem__: Any + __setattr__: Any + +def coerce_to_immutabledict(d): ... + +EMPTY_DICT: Any + +class FacadeDict(ImmutableContainer, dict[Any, Any]): + clear: Any + pop: Any + popitem: Any + setdefault: Any + update: Any + def __new__(cls, *args): ... + def copy(self) -> None: ... # type: ignore[override] + def __reduce__(self): ... + +class Properties: + def __init__(self, data) -> None: ... + def __len__(self): ... + def __iter__(self): ... + def __dir__(self): ... + def __add__(self, other): ... + def __setitem__(self, key, obj) -> None: ... + def __getitem__(self, key): ... + def __delitem__(self, key) -> None: ... + def __setattr__(self, key, obj) -> None: ... + def __getattr__(self, key): ... + def __contains__(self, key): ... + def as_immutable(self): ... + def update(self, value) -> None: ... + def get(self, key, default: Any | None = ...): ... + def keys(self): ... + def values(self): ... + def items(self): ... + def has_key(self, key): ... + def clear(self) -> None: ... + +class OrderedProperties(Properties): + def __init__(self) -> None: ... + +class ImmutableProperties(ImmutableContainer, Properties): ... + +if sys.version_info >= (3, 7): + OrderedDict = dict +else: + class OrderedDict(dict[Any, Any]): + def __reduce__(self): ... + def __init__(self, ____sequence: Any | None = ..., **kwargs) -> None: ... + def clear(self) -> None: ... + def copy(self): ... + def __copy__(self): ... + def update(self, ____sequence: Any | None = ..., **kwargs) -> None: ... + def setdefault(self, key, value): ... + def __iter__(self): ... + def keys(self): ... + def values(self): ... + def items(self): ... + def __setitem__(self, key, obj) -> None: ... + def __delitem__(self, key) -> None: ... + def pop(self, key, *default): ... + def popitem(self): ... + +def sort_dictionary(d, key: Any | None = ...): ... + +class OrderedSet(set[Any]): + def __init__(self, d: Any | None = ...) -> None: ... + def add(self, element) -> None: ... + def remove(self, element) -> None: ... + def insert(self, pos, element) -> None: ... + def discard(self, element) -> None: ... + def clear(self) -> None: ... + def __getitem__(self, key): ... + def __iter__(self): ... + def __add__(self, other): ... + def update(self, iterable): ... + __ior__: Any + def union(self, other): ... + __or__: Any + def intersection(self, other): ... + __and__: Any + def symmetric_difference(self, other): ... + __xor__: Any + def difference(self, other): ... + __sub__: Any + def intersection_update(self, other): ... + __iand__: Any + def symmetric_difference_update(self, other): ... + __ixor__: Any + def difference_update(self, other): ... + __isub__: Any + +class IdentitySet: + def __init__(self, iterable: Any | None = ...) -> None: ... + def add(self, value) -> None: ... + def __contains__(self, value): ... + def remove(self, value) -> None: ... + def discard(self, value) -> None: ... + def pop(self): ... + def clear(self) -> None: ... + def __cmp__(self, other) -> None: ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def issubset(self, iterable): ... + def __le__(self, other): ... + def __lt__(self, other): ... + def issuperset(self, iterable): ... + def __ge__(self, other): ... + def __gt__(self, other): ... + def union(self, iterable): ... + def __or__(self, other): ... + def update(self, iterable) -> None: ... + def __ior__(self, other): ... + def difference(self, iterable): ... + def __sub__(self, other): ... + def difference_update(self, iterable) -> None: ... + def __isub__(self, other): ... + def intersection(self, iterable): ... + def __and__(self, other): ... + def intersection_update(self, iterable) -> None: ... + def __iand__(self, other): ... + def symmetric_difference(self, iterable): ... + def __xor__(self, other): ... + def symmetric_difference_update(self, iterable) -> None: ... + def __ixor__(self, other): ... + def copy(self): ... + __copy__: Any + def __len__(self): ... + def __iter__(self): ... + def __hash__(self): ... + +class WeakSequence: + def __init__(self, __elements=...) -> None: ... + def append(self, item) -> None: ... + def __len__(self): ... + def __iter__(self): ... + def __getitem__(self, index): ... + +class OrderedIdentitySet(IdentitySet): + def __init__(self, iterable: Any | None = ...) -> None: ... + +class PopulateDict(dict[Any, Any]): + creator: Any + def __init__(self, creator) -> None: ... + def __missing__(self, key): ... + +class WeakPopulateDict(dict[Any, Any]): + creator: Any + weakself: Any + def __init__(self, creator_method) -> None: ... + def __missing__(self, key): ... + +column_set = set +column_dict = dict +ordered_column_set = OrderedSet + +def unique_list(seq, hashfunc: Any | None = ...): ... + +class UniqueAppender: + data: Any + def __init__(self, data, via: Any | None = ...) -> None: ... + def append(self, item) -> None: ... + def __iter__(self): ... + +def coerce_generator_arg(arg): ... +def to_list(x, default: Any | None = ...): ... +def has_intersection(set_, iterable): ... +def to_set(x): ... +def to_column_set(x): ... +def update_copy(d, _new: Any | None = ..., **kw): ... +def flatten_iterator(x) -> None: ... + +class LRUCache(dict[Any, Any]): + capacity: Any + threshold: Any + size_alert: Any + def __init__(self, capacity: int = ..., threshold: float = ..., size_alert: Any | None = ...) -> None: ... + def get(self, key, default: Any | None = ...): ... + def __getitem__(self, key): ... + def values(self): ... + def setdefault(self, key, value): ... + def __setitem__(self, key, value) -> None: ... + @property + def size_threshold(self): ... + +class ScopedRegistry: + createfunc: Any + scopefunc: Any + registry: Any + def __init__(self, createfunc, scopefunc) -> None: ... + def __call__(self): ... + def has(self): ... + def set(self, obj) -> None: ... + def clear(self) -> None: ... + +class ThreadLocalRegistry(ScopedRegistry): + createfunc: Any + registry: Any + def __init__(self, createfunc) -> None: ... + def __call__(self): ... + def has(self): ... + def set(self, obj) -> None: ... + def clear(self) -> None: ... + +def has_dupes(sequence, target): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_compat_py3k.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_compat_py3k.pyi new file mode 100644 index 000000000..d23165bf6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_compat_py3k.pyi @@ -0,0 +1,10 @@ +from typing import Any + +class _AsyncGeneratorContextManager: + gen: Any + __doc__: Any + def __init__(self, func, args, kwds) -> None: ... + async def __aenter__(self): ... + async def __aexit__(self, typ, value, traceback): ... + +def asynccontextmanager(func): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi new file mode 100644 index 000000000..b900f1a84 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi @@ -0,0 +1,26 @@ +import asyncio as asyncio +from collections.abc import Callable, Coroutine +from typing import Any + +from .langhelpers import memoized_property + +_greenlet = Any # actually greenlet.greenlet + +def is_exit_exception(e): ... + +class _AsyncIoGreenlet(_greenlet): + driver: Any + gr_context: Any + def __init__(self, fn, driver) -> None: ... + +def await_only(awaitable: Coroutine[Any, Any, Any]) -> Any: ... +def await_fallback(awaitable: Coroutine[Any, Any, Any]) -> Any: ... +async def greenlet_spawn(fn: Callable[..., Any], *args, _require_await: bool = ..., **kwargs) -> Any: ... + +class AsyncAdaptedLock: + @memoized_property + def mutex(self): ... + def __enter__(self): ... + def __exit__(self, *arg, **kw) -> None: ... + +def get_event_loop(): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_preloaded.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_preloaded.pyi new file mode 100644 index 000000000..eaabad390 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/_preloaded.pyi @@ -0,0 +1,11 @@ +from typing import Any + +class _ModuleRegistry: + module_registry: Any + prefix: Any + def __init__(self, prefix: str = ...) -> None: ... + def preload_module(self, *deps): ... + def import_prefix(self, path) -> None: ... + +preloaded: Any +preload_module: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi new file mode 100644 index 000000000..38065012f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi @@ -0,0 +1,104 @@ +import builtins +import collections +import contextlib +import itertools +import operator +import pickle as pickle +import threading as threading +from abc import ABC as ABC +from datetime import timezone as timezone +from functools import reduce as reduce +from io import BytesIO as BytesIO, StringIO as StringIO +from itertools import zip_longest as zip_longest +from time import perf_counter as perf_counter +from typing import TYPE_CHECKING as TYPE_CHECKING, Any, NamedTuple +from urllib.parse import ( + parse_qsl as parse_qsl, + quote as quote, + quote_plus as quote_plus, + unquote as unquote, + unquote_plus as unquote_plus, +) + +byte_buffer = BytesIO + +py39: Any +py38: Any +py37: Any +py3k: Any +py2k: Any +pypy: Any +cpython: Any +win32: Any +osx: Any +arm: Any +has_refcount_gc: Any +contextmanager = contextlib.contextmanager +dottedgetter = operator.attrgetter +namedtuple = collections.namedtuple +next = builtins.next + +class FullArgSpec(NamedTuple): + args: Any + varargs: Any + varkw: Any + defaults: Any + kwonlyargs: Any + kwonlydefaults: Any + annotations: Any + +class nullcontext: + enter_result: Any + def __init__(self, enter_result: Any | None = ...) -> None: ... + def __enter__(self): ... + def __exit__(self, *excinfo) -> None: ... + +def inspect_getfullargspec(func): ... +def importlib_metadata_get(group): ... + +string_types: tuple[type, ...] +binary_types: tuple[type, ...] +binary_type = bytes +text_type = str +int_types: tuple[type, ...] +iterbytes = iter +long_type = int +itertools_filterfalse = itertools.filterfalse +itertools_filter = filter +itertools_imap = map +exec_: Any +import_: Any +print_: Any + +def b(s): ... +def b64decode(x): ... +def b64encode(x): ... +def decode_backslashreplace(text, encoding): ... +def cmp(a, b): ... +def raise_(exception, with_traceback: Any | None = ..., replace_context: Any | None = ..., from_: bool = ...) -> None: ... +def u(s): ... +def ue(s): ... + +callable = builtins.callable + +def safe_bytestring(text): ... +def inspect_formatargspec( + args, + varargs: Any | None = ..., + varkw: Any | None = ..., + defaults: Any | None = ..., + kwonlyargs=..., + kwonlydefaults=..., + annotations=..., + formatarg=..., + formatvarargs=..., + formatvarkw=..., + formatvalue=..., + formatreturns=..., + formatannotation=..., +): ... +def dataclass_fields(cls): ... +def local_dataclass_fields(cls): ... +def raise_from_cause(exception, exc_info: Any | None = ...) -> None: ... +def reraise(tp, value, tb: Any | None = ..., cause: Any | None = ...) -> None: ... +def with_metaclass(meta, *bases, **kw): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/concurrency.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/concurrency.pyi new file mode 100644 index 000000000..40fbc5750 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/concurrency.pyi @@ -0,0 +1,13 @@ +from typing import Any + +from ._compat_py3k import asynccontextmanager as asynccontextmanager +from ._concurrency_py3k import ( + AsyncAdaptedLock as AsyncAdaptedLock, + await_fallback as await_fallback, + await_only as await_only, + greenlet_spawn as greenlet_spawn, + is_exit_exception as is_exit_exception, +) + +have_greenlet: bool +asyncio: Any | None diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi new file mode 100644 index 000000000..73f7d1722 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi @@ -0,0 +1,25 @@ +from typing import Any + +from .langhelpers import ( + decorator as decorator, + inject_docstring_text as inject_docstring_text, + inject_param_text as inject_param_text, +) + +SQLALCHEMY_WARN_20: bool + +def warn_deprecated(msg, version, stacklevel: int = ..., code: Any | None = ...) -> None: ... +def warn_deprecated_limited(msg, args, version, stacklevel: int = ..., code: Any | None = ...) -> None: ... +def warn_deprecated_20(msg, stacklevel: int = ..., code: Any | None = ...) -> None: ... +def deprecated_cls(version, message, constructor: str = ...): ... +def deprecated_20_cls(clsname, alternative: Any | None = ..., constructor: str = ..., becomes_legacy: bool = ...): ... +def deprecated( + version, + message: Any | None = ..., + add_deprecation_to_docstring: bool = ..., + warning: Any | None = ..., + enable_warnings: bool = ..., +): ... +def moved_20(message, **kw): ... +def deprecated_20(api_name, alternative: Any | None = ..., becomes_legacy: bool = ..., **kw): ... +def deprecated_params(**specs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi new file mode 100644 index 000000000..35fe7c230 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi @@ -0,0 +1,162 @@ +from collections.abc import Callable +from typing import Any, Generic, TypeVar, overload + +from . import compat + +_R = TypeVar("_R") +_T = TypeVar("_T") + +def md5_hex(x): ... + +class safe_reraise: + warn_only: Any + def __init__(self, warn_only: bool = ...) -> None: ... + def __enter__(self) -> None: ... + def __exit__(self, type_, value, traceback) -> None: ... + +def walk_subclasses(cls) -> None: ... +def string_or_unprintable(element): ... +def clsname_as_plain_name(cls): ... +def method_is_overridden(instance_or_cls, against_method): ... +def decode_slice(slc): ... +def map_bits(fn, n) -> None: ... +def decorator(target): ... +def public_factory(target, location, class_location: Any | None = ...): ... + +class PluginLoader: + group: Any + impls: Any + auto_fn: Any + def __init__(self, group, auto_fn: Any | None = ...) -> None: ... + def clear(self) -> None: ... + def load(self, name): ... + def register(self, name, modulepath, objname): ... + +def get_cls_kwargs(cls, _set: Any | None = ...): ... +def get_func_kwargs(func): ... +def get_callable_argspec(fn, no_self: bool = ..., _is_init: bool = ...): ... +def format_argspec_plus(fn, grouped: bool = ...): ... +def format_argspec_init(method, grouped: bool = ...): ... +def create_proxy_methods( + target_cls, target_cls_sphinx_name, proxy_cls_sphinx_name, classmethods=..., methods=..., attributes=... +): ... +def getargspec_init(method): ... +def unbound_method_to_callable(func_or_cls): ... +def generic_repr(obj, additional_kw=..., to_inspect: Any | None = ..., omit_kwarg=...): ... + +class portable_instancemethod: + target: Any + name: Any + kwargs: Any + def __init__(self, meth, kwargs=...) -> None: ... + def __call__(self, *arg, **kw): ... + +def class_hierarchy(cls): ... +def iterate_attributes(cls) -> None: ... +def monkeypatch_proxied_specials( + into_cls, from_cls, skip: Any | None = ..., only: Any | None = ..., name: str = ..., from_instance: Any | None = ... +) -> None: ... +def methods_equivalent(meth1, meth2): ... +def as_interface(obj, cls: Any | None = ..., methods: Any | None = ..., required: Any | None = ...): ... + +class memoized_property(Generic[_R]): + fget: Callable[..., _R] + __doc__: str + __name__: str + def __init__(self, fget: Callable[..., _R], doc: str | None = ...) -> None: ... + @overload + def __get__(self: _T, obj: None, cls: object) -> _T: ... + @overload + def __get__(self, obj: object, cls: object) -> _R: ... + @classmethod + def reset(cls, obj: object, name: str) -> None: ... + +def memoized_instancemethod(fn): ... + +class HasMemoized: + class memoized_attribute(Generic[_R]): + fget: Callable[..., _R] + __doc__: str + __name__: str + def __init__(self, fget: Callable[..., _R], doc: str | None = ...) -> None: ... + @overload + def __get__(self: _T, obj: None, cls: object) -> _T: ... + @overload + def __get__(self, obj: object, cls: object) -> _R: ... + @classmethod + def memoized_instancemethod(cls, fn): ... + +class MemoizedSlots: + def __getattr__(self, key): ... + +def asbool(obj): ... +def bool_or_str(*text): ... +def asint(value): ... +def coerce_kw_type(kw, key, type_, flexi_bool: bool = ..., dest: Any | None = ...) -> None: ... +def constructor_key(obj, cls): ... +def constructor_copy(obj, cls, *args, **kw): ... +def counter(): ... +def duck_type_collection(specimen, default: Any | None = ...): ... +def assert_arg_type(arg, argtype, name): ... +def dictlike_iteritems(dictlike): ... + +class classproperty(property): + __doc__: Any + def __init__(self, fget, *arg, **kw) -> None: ... + def __get__(self, self_, cls): ... + +class hybridproperty(Generic[_R]): + func: Callable[..., _R] + clslevel: Callable[..., _R] + def __init__(self, func: Callable[..., _R]) -> None: ... + @overload + def __get__(self, instance: None, owner: Any) -> _R: ... + @overload + def __get__(self, instance: object, owner: object) -> _R: ... + def classlevel(self: _T, func: Callable[..., _R]) -> _T: ... + +class hybridmethod: + func: Any + clslevel: Any + def __init__(self, func) -> None: ... + def __get__(self, instance, owner): ... + def classlevel(self, func): ... + +class _symbol(int): + def __new__(cls, name, doc: Any | None = ..., canonical: Any | None = ...): ... + def __reduce__(self): ... + +class symbol: + symbols: Any + def __new__(cls, name, doc: Any | None = ..., canonical: Any | None = ...): ... + @classmethod + def parse_user_argument(cls, arg, choices, name, resolve_symbol_names: bool = ...): ... + +def set_creation_order(instance) -> None: ... +def warn_exception(func, *args, **kwargs): ... +def ellipses_string(value, len_: int = ...): ... + +class _hash_limit_string(compat.text_type): + def __new__(cls, value, num, args): ... + def __hash__(self): ... + def __eq__(self, other): ... + +def warn(msg, code: Any | None = ...) -> None: ... +def warn_limited(msg, args) -> None: ... +def only_once(fn, retry_on_exception): ... +def chop_traceback(tb, exclude_prefix=..., exclude_suffix=...): ... + +NoneType: Any + +def attrsetter(attrname): ... + +class EnsureKWArgType(type): + def __init__(cls, clsname, bases, clsdict) -> None: ... + +def wrap_callable(wrapper, fn): ... +def quoted_token_parser(value): ... +def add_parameter_text(params, text): ... +def inject_docstring_text(doctext, injecttext, pos): ... +def inject_param_text(doctext, inject_params): ... +def repr_tuple_names(names): ... +def has_compiled_ext(): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/queue.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/queue.pyi new file mode 100644 index 000000000..d7b986a37 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/queue.pyi @@ -0,0 +1,34 @@ +from typing import Any + +class Empty(Exception): ... +class Full(Exception): ... + +class Queue: + mutex: Any + not_empty: Any + not_full: Any + use_lifo: Any + def __init__(self, maxsize: int = ..., use_lifo: bool = ...) -> None: ... + def qsize(self): ... + def empty(self): ... + def full(self): ... + def put(self, item, block: bool = ..., timeout: Any | None = ...) -> None: ... + def put_nowait(self, item): ... + def get(self, block: bool = ..., timeout: Any | None = ...): ... + def get_nowait(self): ... + +class AsyncAdaptedQueue: + await_: Any + use_lifo: Any + maxsize: Any + def __init__(self, maxsize: int = ..., use_lifo: bool = ...) -> None: ... + def empty(self): ... + def full(self): ... + def qsize(self): ... + def put_nowait(self, item): ... + def put(self, item, block: bool = ..., timeout: Any | None = ...): ... + def get_nowait(self): ... + def get(self, block: bool = ..., timeout: Any | None = ...): ... + +class FallbackAsyncAdaptedQueue(AsyncAdaptedQueue): + await_: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/topological.pyi b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/topological.pyi new file mode 100644 index 000000000..04428e1ba --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/SQLAlchemy/sqlalchemy/util/topological.pyi @@ -0,0 +1,3 @@ +def sort_as_subsets(tuples, allitems) -> None: ... +def sort(tuples, allitems, deterministic_order: bool = ...) -> None: ... +def find_cycles(tuples, allitems): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/lib/error.pyi b/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/lib/error.pyi index 7e3ed16e6..b088bb8f2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/lib/error.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/lib/error.pyi @@ -1,14 +1,15 @@ -from typing import Any, Type +from typing import Type def assert_(condition: object) -> None: ... ERR_FRAGMENT: str -class AuthorizationError(Exception): - url: Any +class DAVError(Exception): + url: str | None reason: str + def __init__(self, url: str | None = ..., reason: str | None = ...) -> None: ... -class DAVError(Exception): ... +class AuthorizationError(DAVError): ... class PropsetError(DAVError): ... class ProppatchError(DAVError): ... class PropfindError(DAVError): ... @@ -19,6 +20,6 @@ class PutError(DAVError): ... class DeleteError(DAVError): ... class NotFoundError(DAVError): ... class ConsistencyError(DAVError): ... -class ReponseError(DAVError): ... +class ResponseError(DAVError): ... exception_by_method: dict[str, Type[DAVError]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/click-spinner/click_spinner/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/click-spinner/click_spinner/__init__.pyi index 5ec098ed3..6ddb0e8f4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/click-spinner/click_spinner/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/click-spinner/click_spinner/__init__.pyi @@ -1,7 +1,7 @@ import threading from types import TracebackType -from typing import Iterator, Type -from typing_extensions import Literal, Protocol +from typing import Iterator, Protocol, Type +from typing_extensions import Literal __version__: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-2020/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/flake8-2020/METADATA.toml new file mode 100644 index 000000000..6cf9fae44 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-2020/METADATA.toml @@ -0,0 +1 @@ +version = "1.6.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-2020/flake8_2020.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8-2020/flake8_2020.pyi new file mode 100644 index 000000000..3577b66a6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-2020/flake8_2020.pyi @@ -0,0 +1,14 @@ +# flake8-2020 has type annotations, but PEP 561 states: +# This PEP does not support distributing typing information as part of module-only distributions or single-file modules within namespace packages. +# Therefore typeshed is the best place. + +import ast +from typing import Any, ClassVar, Generator, Type + +class Plugin: + name: ClassVar[str] + version: ClassVar[str] + def __init__(self, tree: ast.AST) -> None: ... + def run(self) -> Generator[tuple[int, int, str, Type[Any]], None, None]: ... + +def __getattr__(name: str) -> Any: ... # incomplete (other attributes are normally not accessed) diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/METADATA.toml new file mode 100644 index 000000000..4965db3af --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/METADATA.toml @@ -0,0 +1 @@ +version = "21.11.29" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/bugbear.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/bugbear.pyi new file mode 100644 index 000000000..b435e5bce --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/bugbear.pyi @@ -0,0 +1,27 @@ +import argparse +import ast +from typing import Any, Sequence + +class BugBearChecker: + name: str + version: str + tree: ast.AST | None + filename: str + lines: Sequence[str] | None + max_line_length: int + visitor: ast.NodeVisitor + options: argparse.Namespace | None + def run(self) -> None: ... + @staticmethod + def add_options(optmanager: Any) -> None: ... + def __init__( + self, + tree: ast.AST | None = ..., + filename: str = ..., + lines: Sequence[str] | None = ..., + max_line_length: int = ..., + options: argparse.Namespace | None = ..., + ) -> None: ... + def __getattr__(self, name: str) -> Any: ... # incomplete (other attributes are normally not accessed) + +def __getattr__(name: str) -> Any: ... # incomplete (other attributes are normally not accessed) diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-builtins/flake8_builtins.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8-builtins/flake8_builtins.pyi index 4600e0bff..e5a3d89c5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-builtins/flake8_builtins.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-builtins/flake8_builtins.pyi @@ -1,9 +1,9 @@ import ast -from typing import Any, Generator, Type +from typing import Any, ClassVar, Generator, Type class BuiltinsChecker: - name: str - version: str + name: ClassVar[str] + version: ClassVar[str] def __init__(self, tree: ast.AST, filename: str) -> None: ... def run(self) -> Generator[tuple[int, int, str, Type[Any]], None, None]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-docstrings/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/flake8-docstrings/METADATA.toml new file mode 100644 index 000000000..6cf9fae44 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-docstrings/METADATA.toml @@ -0,0 +1 @@ +version = "1.6.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-docstrings/flake8_docstrings.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8-docstrings/flake8_docstrings.pyi new file mode 100644 index 000000000..bd8621cfe --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-docstrings/flake8_docstrings.pyi @@ -0,0 +1,19 @@ +import argparse +import ast +from typing import Any, ClassVar, Generator, Iterable, Type + +class pep257Checker: + name: ClassVar[str] + version: ClassVar[str] + tree: ast.AST + filename: str + checker: Any + source: str + def __init__(self, tree: ast.AST, filename: str, lines: Iterable[str]) -> None: ... + @classmethod + def add_options(cls, parser: Any) -> None: ... + @classmethod + def parse_options(cls, options: argparse.Namespace) -> None: ... + def run(self) -> Generator[tuple[int, int, str, Type[Any]], None, None]: ... + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/METADATA.toml new file mode 100644 index 000000000..3ea18392d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/METADATA.toml @@ -0,0 +1 @@ +version = "1.3.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/flake8_plugin_utils/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/flake8_plugin_utils/__init__.pyi new file mode 100644 index 000000000..0c3f4bced --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/flake8_plugin_utils/__init__.pyi @@ -0,0 +1,9 @@ +from .plugin import Error as Error, Plugin as Plugin, Visitor as Visitor +from .utils import ( + assert_error as assert_error, + assert_not_error as assert_not_error, + check_equivalent_nodes as check_equivalent_nodes, + is_false as is_false, + is_none as is_none, + is_true as is_true, +) diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/flake8_plugin_utils/plugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/flake8_plugin_utils/plugin.pyi new file mode 100644 index 000000000..066a43e53 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/flake8_plugin_utils/plugin.pyi @@ -0,0 +1,36 @@ +import argparse +import ast +from typing import Any, Generic, Iterable, Iterator, Tuple, Type, TypeVar + +FLAKE8_ERROR = Tuple[int, int, str, Type[Any]] +TConfig = TypeVar("TConfig") # noqa: Y001 + +class Error: + code: str + message: str + lineno: int + col_offset: int + def __init__(self, lineno: int, col_offset: int, **kwargs: Any) -> None: ... + @classmethod + def formatted_message(cls, **kwargs: Any) -> str: ... + +class Visitor(ast.NodeVisitor, Generic[TConfig]): + errors: list[Error] + def __init__(self, config: TConfig | None = ...) -> None: ... + @property + def config(self) -> TConfig: ... + def error_from_node(self, error: Type[Error], node: ast.AST, **kwargs: Any) -> None: ... + +class Plugin(Generic[TConfig]): + name: str + version: str + visitors: list[Type[Visitor[TConfig]]] + config: TConfig + def __init__(self, tree: ast.AST) -> None: ... + def run(self) -> Iterable[FLAKE8_ERROR]: ... + @classmethod + def parse_options(cls, option_manager: Any, options: argparse.Namespace, args: list[str]) -> None: ... + @classmethod + def parse_options_to_config(cls, option_manager: Any, options: argparse.Namespace, args: list[str]) -> TConfig | None: ... + @classmethod + def test_config(cls, config: TConfig) -> Iterator[None]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/flake8_plugin_utils/utils/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/flake8_plugin_utils/utils/__init__.pyi new file mode 100644 index 000000000..095dbe4c7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/flake8_plugin_utils/utils/__init__.pyi @@ -0,0 +1,3 @@ +from .assertions import assert_error as assert_error, assert_not_error as assert_not_error +from .constants import is_false as is_false, is_none as is_none, is_true as is_true +from .equiv_nodes import check_equivalent_nodes as check_equivalent_nodes diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/flake8_plugin_utils/utils/assertions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/flake8_plugin_utils/utils/assertions.pyi new file mode 100644 index 000000000..2bd61dd84 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/flake8_plugin_utils/utils/assertions.pyi @@ -0,0 +1,8 @@ +from typing import Any, Type + +from ..plugin import Error as Error, TConfig as TConfig, Visitor as Visitor + +def assert_error( + visitor_cls: Type[Visitor[TConfig]], src: str, expected: Type[Error], config: TConfig | None = ..., **kwargs: Any +) -> None: ... +def assert_not_error(visitor_cls: Type[Visitor[TConfig]], src: str, config: TConfig | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/flake8_plugin_utils/utils/constants.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/flake8_plugin_utils/utils/constants.pyi new file mode 100644 index 000000000..8503693c6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/flake8_plugin_utils/utils/constants.pyi @@ -0,0 +1,5 @@ +import ast + +def is_none(node: ast.AST) -> bool: ... +def is_false(node: ast.AST) -> bool: ... +def is_true(node: ast.AST) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/flake8_plugin_utils/utils/equiv_nodes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/flake8_plugin_utils/utils/equiv_nodes.pyi new file mode 100644 index 000000000..641945b10 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-plugin-utils/flake8_plugin_utils/utils/equiv_nodes.pyi @@ -0,0 +1,3 @@ +import ast + +def check_equivalent_nodes(node1: ast.AST, node2: ast.AST) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-simplify/flake8_simplify.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8-simplify/flake8_simplify.pyi index ff5d229fc..0d5e35b60 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-simplify/flake8_simplify.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-simplify/flake8_simplify.pyi @@ -1,8 +1,8 @@ import ast -from typing import Any, Generator, Type +from typing import Any, ClassVar, Generator, Type class Plugin: - name: str - version: str + name: ClassVar[str] + version: ClassVar[str] def __init__(self, tree: ast.AST) -> None: ... def run(self) -> Generator[tuple[int, int, str, Type[Any]], None, None]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-typing-imports/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/flake8-typing-imports/METADATA.toml new file mode 100644 index 000000000..88c1356c9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-typing-imports/METADATA.toml @@ -0,0 +1 @@ +version = "1.11.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-typing-imports/flake8_typing_imports.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8-typing-imports/flake8_typing_imports.pyi new file mode 100644 index 000000000..045859668 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-typing-imports/flake8_typing_imports.pyi @@ -0,0 +1,15 @@ +import argparse +import ast +from typing import Any, ClassVar, Generator, Type + +class Plugin: + name: ClassVar[str] + version: ClassVar[str] + @staticmethod + def add_options(option_manager: Any) -> None: ... + @classmethod + def parse_options(cls, options: argparse.Namespace) -> None: ... + def __init__(self, tree: ast.AST) -> None: ... + def run(self) -> Generator[tuple[int, int, str, Type[Any]], None, None]: ... + +def __getattr__(name: str) -> Any: ... # incomplete (other attributes are normally not accessed) diff --git a/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/METADATA.toml new file mode 100644 index 000000000..4e51482b6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/METADATA.toml @@ -0,0 +1 @@ +version = "2.10.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/hdbcli/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/hdbcli/__init__.pyi new file mode 100644 index 000000000..bda5b5a7f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/hdbcli/__init__.pyi @@ -0,0 +1 @@ +__version__: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/hdbcli/dbapi.pyi b/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/hdbcli/dbapi.pyi new file mode 100644 index 000000000..7ab8c8be9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/hdbcli/dbapi.pyi @@ -0,0 +1,115 @@ +import decimal +from _typeshed import ReadableBuffer +from datetime import date, datetime, time +from typing import Any, Sequence, Tuple, Type, overload +from typing_extensions import Literal + +from .resultrow import ResultRow + +apilevel: str +threadsafety: int +paramstyle: Tuple[str, ...] +connect = Connection + +class Connection: + def __init__( + self, + address: str, + port: int, + username: str, + password: str, + autocommit: bool = ..., + packetsize: int | None = ..., + userkey: str | None = ..., + *, + sessionvariables: dict[str, str] | None = ..., + forcebulkfetch: bool | None = ..., + ) -> None: ... + def cancel(self) -> bool: ... + def close(self) -> None: ... + def commit(self) -> None: ... + def cursor(self) -> Cursor: ... + def getaddress(self) -> str: ... + def getautocommit(self) -> bool: ... + def getclientinfo(self, key: str = ...) -> str | dict[str, str]: ... + def isconnected(self) -> bool: ... + def rollback(self) -> None: ... + def setautocommit(self, auto: bool = ...) -> None: ... + def setclientinfo(self, key: str, value: str | None = ...) -> None: ... + +class LOB: + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def close(self) -> bool: ... + def find(self, object: str, length: int, position: int = ...) -> int: ... + def read(self, size: int = ..., position: int = ...) -> str | bytes: ... + def write(self, object: str | bytes) -> int: ... + +_Parameters = Sequence[Tuple[Any, ...]] + +class Cursor: + description: Tuple[Tuple[Any, ...], ...] + rowcount: int + statementhash: str | None + connection: Connection + arraysize: int + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def callproc(self, procname: str, parameters: Tuple[Any, ...] = ..., overview: bool = ...) -> Tuple[Any, ...]: ... + def close(self) -> None: ... + def description_ext(self) -> Sequence[Tuple[Any, ...]]: ... + def execute(self, operation: str, parameters: Tuple[Any, ...]) -> bool: ... + def executemany(self, operation: str, parameters: _Parameters) -> Any: ... + def executemanyprepared(self, parameters: _Parameters) -> Any: ... + def executeprepared(self, parameters: _Parameters = ...) -> Any: ... + def fetchone(self, uselob: bool = ...) -> ResultRow | None: ... + def fetchall(self) -> list[ResultRow]: ... + def fetchmany(self, size: int | None = ...) -> list[ResultRow]: ... + def get_resultset_holdability(self) -> int: ... + def getwarning(self) -> Warning | None: ... + def haswarning(self) -> bool: ... + def nextset(self) -> None: ... + def parameter_description(self) -> Tuple[str, ...]: ... + @overload + def prepare(self, operation: str, newcursor: Literal[True]) -> Cursor: ... + @overload + def prepare(self, operation: str, newcursor: Literal[False]) -> Any: ... + def scroll(self, value: int, mode: Literal["absolute"] | Literal["relative"] = ...) -> None: ... + def server_cpu_time(self) -> int: ... + def server_memory_usage(self) -> int: ... + def server_processing_time(self) -> int: ... + def setinputsizes(self, *args: Any, **kwargs: Any) -> None: ... + def setfetchsize(self, value: int) -> None: ... + def set_resultset_holdability(self, holdability: int) -> None: ... + def setoutputsize(self, *args: Any, **kwargs: Any) -> None: ... + +class Warning(Exception): + errorcode: int + errortext: str + +class Error(Exception): + errorcode: int + errortext: str + +class DatabaseError(Error): ... +class OperationalError(DatabaseError): ... +class ProgrammingError(DatabaseError): ... +class IntegrityError(DatabaseError): ... +class InterfaceError(Error): ... +class InternalError(DatabaseError): ... +class DataError(DatabaseError): ... +class NotSupportedError(DatabaseError): ... + +def Date(year: int, month: int, day: int) -> date: ... +def Time(hour: int, minute: int, second: int, millisecond: int = ...) -> time: ... +def Timestamp(year: int, month: int, day: int, hour: int, minute: int, second: int, millisecond: int = ...) -> datetime: ... +def DateFromTicks(ticks: float) -> date: ... +def TimeFromTicks(ticks: float) -> time: ... +def TimestampFromTicks(ticks: float) -> datetime: ... +def Binary(data: ReadableBuffer) -> memoryview: ... + +Decimal = decimal.Decimal + +NUMBER: Type[int] | Type[float] | Type[complex] +DATETIME: Type[date] | Type[time] | Type[datetime] +STRING = str +BINARY = memoryview +ROWID = int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/hdbcli/resultrow.pyi b/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/hdbcli/resultrow.pyi new file mode 100644 index 000000000..02a02eca9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/hdbcli/resultrow.pyi @@ -0,0 +1,6 @@ +from typing import Any, Tuple + +class ResultRow: + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + column_names: Tuple[str, ...] + column_values: Tuple[Any, ...] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/METADATA.toml index 38c94680a..a51d6edb1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/METADATA.toml @@ -1 +1 @@ -version = "3.2.*" +version = "4.3.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/__init__.pyi index 87b8e96f5..dcb925bc6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/__init__.pyi @@ -4,6 +4,8 @@ from jsonschema._format import ( draft4_format_checker as draft4_format_checker, draft6_format_checker as draft6_format_checker, draft7_format_checker as draft7_format_checker, + draft201909_format_checker as draft201909_format_checker, + draft202012_format_checker as draft202012_format_checker, ) from jsonschema._types import TypeChecker as TypeChecker from jsonschema.exceptions import ( @@ -13,11 +15,14 @@ from jsonschema.exceptions import ( SchemaError as SchemaError, ValidationError as ValidationError, ) +from jsonschema.protocols import Validator as Validator from jsonschema.validators import ( Draft3Validator as Draft3Validator, Draft4Validator as Draft4Validator, Draft6Validator as Draft6Validator, Draft7Validator as Draft7Validator, + Draft201909Validator as Draft201909Validator, + Draft202012Validator as Draft202012Validator, RefResolver as RefResolver, validate as validate, ) diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_format.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_format.pyi index fdab126bb..492800ab5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_format.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_format.pyi @@ -1,35 +1,42 @@ -from typing import Any +from typing import Any, Iterable class FormatChecker: checkers: Any - def __init__(self, formats: Any | None = ...) -> None: ... + def __init__(self, formats: Iterable[str] | None = ...) -> None: ... def checks(self, format, raises=...): ... cls_checks: Any def check(self, instance, format) -> None: ... - def conforms(self, instance, format): ... + def conforms(self, instance, format) -> bool: ... -draft3_format_checker: Any -draft4_format_checker: Any -draft6_format_checker: Any -draft7_format_checker: Any +draft3_format_checker: FormatChecker +draft4_format_checker: FormatChecker +draft6_format_checker: FormatChecker +draft7_format_checker: FormatChecker +draft201909_format_checker: FormatChecker +draft202012_format_checker: FormatChecker -def is_email(instance): ... -def is_ipv4(instance): ... -def is_ipv6(instance): ... -def is_host_name(instance): ... -def is_idn_host_name(instance): ... -def is_uri(instance): ... -def is_uri_reference(instance): ... -def is_iri(instance): ... -def is_iri_reference(instance): ... -def is_datetime(instance): ... -def is_time(instance): ... -def is_regex(instance): ... -def is_date(instance): ... -def is_draft3_time(instance): ... -def is_css_color_code(instance): ... -def is_css21_color(instance): ... -def is_css3_color(instance): ... -def is_json_pointer(instance): ... -def is_relative_json_pointer(instance): ... -def is_uri_template(instance, template_validator=...): ... +def is_email(instance) -> bool: ... +def is_ipv4(instance) -> bool: ... +def is_ipv6(instance) -> bool: ... + +# is_host_name is only defined if fqdn is installed. +def is_host_name(instance) -> bool: ... +def is_idn_host_name(instance) -> bool: ... +def is_uri(instance) -> bool: ... +def is_uri_reference(instance) -> bool: ... +def is_iri(instance) -> bool: ... +def is_iri_reference(instance) -> bool: ... +def is_datetime(instance) -> bool: ... +def is_time(instance) -> bool: ... +def is_regex(instance) -> bool: ... +def is_date(instance) -> bool: ... +def is_draft3_time(instance) -> bool: ... +def is_css_color_code(instance) -> bool: ... +def is_css21_color(instance) -> bool: ... +def is_json_pointer(instance) -> bool: ... +def is_relative_json_pointer(instance) -> bool: ... +def is_uri_template(instance) -> bool: ... + +# is_duration is only defined if isoduration is installed. +def is_duration(instance) -> bool: ... +def is_uuid(instance) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_legacy_validators.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_legacy_validators.pyi index 40e61896d..08a7dd539 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_legacy_validators.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_legacy_validators.pyi @@ -1,8 +1,15 @@ +from typing import Any, ItemsView + +def ignore_ref_siblings(schema) -> list[tuple[str, Any]] | ItemsView[str, Any]: ... def dependencies_draft3(validator, dependencies, instance, schema) -> None: ... +def dependencies_draft4_draft6_draft7(validator, dependencies, instance, schema) -> None: ... def disallow_draft3(validator, disallow, instance, schema) -> None: ... def extends_draft3(validator, extends, instance, schema) -> None: ... def items_draft3_draft4(validator, items, instance, schema) -> None: ... +def items_draft6_draft7_draft201909(validator, items, instance, schema) -> None: ... def minimum_draft3_draft4(validator, minimum, instance, schema) -> None: ... def maximum_draft3_draft4(validator, maximum, instance, schema) -> None: ... def properties_draft3(validator, properties, instance, schema) -> None: ... def type_draft3(validator, types, instance, schema) -> None: ... +def contains_draft6_draft7(validator, contains, instance, schema) -> None: ... +def recursiveRef(validator, recursiveRef, instance, schema) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_types.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_types.pyi index efbe6ba4e..5c9705544 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_types.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_types.pyi @@ -1,26 +1,24 @@ -from typing import Any +from typing import Callable, Iterable, Mapping -def is_array(checker, instance): ... -def is_bool(checker, instance): ... -def is_integer(checker, instance): ... -def is_null(checker, instance): ... -def is_number(checker, instance): ... -def is_object(checker, instance): ... -def is_string(checker, instance): ... -def is_any(checker, instance): ... +def is_array(checker, instance) -> bool: ... +def is_bool(checker, instance) -> bool: ... +def is_integer(checker, instance) -> bool: ... +def is_null(checker, instance) -> bool: ... +def is_number(checker, instance) -> bool: ... +def is_object(checker, instance) -> bool: ... +def is_string(checker, instance) -> bool: ... +def is_any(checker, instance) -> bool: ... class TypeChecker: - def is_type(self, instance, type): ... - def redefine(self, type, fn): ... - def redefine_many(self, definitions=...): ... - def remove(self, *types): ... - def __init__(self, type_checkers=...) -> None: ... - def __lt__(self, other): ... - def __le__(self, other): ... - def __gt__(self, other): ... - def __ge__(self, other): ... + def __init__(self, type_checkers: Mapping[str, Callable[[object], bool]] = ...) -> None: ... + def is_type(self, instance, type: str) -> bool: ... + def redefine(self, type: str, fn: Callable[..., bool]) -> TypeChecker: ... + def redefine_many(self, definitions=...) -> TypeChecker: ... + def remove(self, *types: Iterable[str]) -> TypeChecker: ... -draft3_type_checker: Any -draft4_type_checker: Any -draft6_type_checker: Any -draft7_type_checker: Any +draft3_type_checker: TypeChecker +draft4_type_checker: TypeChecker +draft6_type_checker: TypeChecker +draft7_type_checker: TypeChecker +draft201909_type_checker: TypeChecker +draft202012_type_checker: TypeChecker diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_utils.pyi index 596ec6472..448be7e91 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_utils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_utils.pyi @@ -1,8 +1,8 @@ -from typing import Any, MutableMapping +from typing import Any, Generator, Iterable, Mapping, MutableMapping, Sized class URIDict(MutableMapping[Any, Any]): - def normalize(self, uri): ... - store: Any + def normalize(self, uri: str) -> str: ... + store: dict[Any, Any] def __init__(self, *args, **kwargs) -> None: ... def __getitem__(self, uri): ... def __setitem__(self, uri, value) -> None: ... @@ -13,13 +13,12 @@ class URIDict(MutableMapping[Any, Any]): class Unset: ... def load_schema(name): ... -def indent(string, times: int = ...): ... -def format_as_index(indices): ... -def find_additional_properties(instance, schema) -> None: ... -def extras_msg(extras): ... -def types_msg(instance, types): ... -def flatten(suitable_for_isinstance): ... -def ensure_list(thing): ... -def equal(one, two): ... +def format_as_index(container: str, indices) -> str: ... +def find_additional_properties(instance: Iterable[Any], schema: Mapping[Any, Any]) -> Generator[Any, None, None]: ... +def extras_msg(extras: Iterable[Any] | Sized) -> str: ... +def ensure_list(thing) -> list[Any]: ... +def equal(one, two) -> bool: ... def unbool(element, true=..., false=...): ... -def uniq(container): ... +def uniq(container) -> bool: ... +def find_evaluated_item_indexes_by_schema(validator, instance, schema) -> list[Any]: ... +def find_evaluated_property_keys_by_schema(validator, instance, schema) -> list[Any]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_validators.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_validators.pyi index 8afcc3c07..f6daf1268 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_validators.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_validators.pyi @@ -17,9 +17,11 @@ def pattern(validator, patrn, instance, schema) -> None: ... def format(validator, format, instance, schema) -> None: ... def minLength(validator, mL, instance, schema) -> None: ... def maxLength(validator, mL, instance, schema) -> None: ... -def dependencies(validator, dependencies, instance, schema) -> None: ... +def dependentRequired(validator, dependentRequired, instance, schema) -> None: ... +def dependentSchemas(validator, dependentSchemas, instance, schema) -> None: ... def enum(validator, enums, instance, schema) -> None: ... def ref(validator, ref, instance, schema) -> None: ... +def dynamicRef(validator, dynamicRef, instance, schema) -> None: ... def type(validator, types, instance, schema) -> None: ... def properties(validator, properties, instance, schema) -> None: ... def required(validator, required, instance, schema) -> None: ... @@ -30,3 +32,6 @@ def anyOf(validator, anyOf, instance, schema) -> None: ... def oneOf(validator, oneOf, instance, schema) -> None: ... def not_(validator, not_schema, instance, schema) -> None: ... def if_(validator, if_schema, instance, schema) -> None: ... +def unevaluatedItems(validator, unevaluatedItems, instance, schema) -> None: ... +def unevaluatedProperties(validator, unevaluatedProperties, instance, schema) -> None: ... +def prefixItems(validator, prefixItems, instance, schema) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/cli.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/cli.pyi index 1ccff3f60..85c3bd71d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/cli.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/cli.pyi @@ -1,10 +1,32 @@ from typing import Any -from jsonschema._reflect import namedAny as namedAny -from jsonschema.validators import validator_for as validator_for +class _CannotLoadFile(Exception): ... + +class _Outputter: + def __init__(self, formatter, stdout, stderr): ... + @classmethod + def from_arguments(cls, arguments, stdout, stderr): ... + def load(self, path): ... + def filenotfound_error(self, **kwargs) -> None: ... + def parsing_error(self, **kwargs) -> None: ... + def validation_error(self, **kwargs) -> None: ... + def validation_success(self, **kwargs) -> None: ... + +class _PrettyFormatter: + def filenotfound_error(self, path, exc_info): ... + def parsing_error(self, path, exc_info): ... + def validation_error(self, instance_path, error): ... + def validation_success(self, instance_path): ... + +class _PlainFormatter: + def __init__(self, error_format): ... + def filenotfound_error(self, path, exc_info): ... + def parsing_error(self, path, exc_info): ... + def validation_error(self, instance_path, error): ... + def validation_success(self, instance_path): ... parser: Any def parse_args(args): ... def main(args=...) -> None: ... -def run(arguments, stdout=..., stderr=...): ... +def run(arguments, stdout=..., stderr=..., stdin=...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/exceptions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/exceptions.pyi index 078d44b64..466264dbb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/exceptions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/exceptions.pyi @@ -27,41 +27,35 @@ class _Error(Exception): schema_path=..., parent: Any | None = ..., ) -> None: ... - def __unicode__(self): ... @classmethod def create_from(cls, other): ... @property def absolute_path(self): ... @property def absolute_schema_path(self): ... + @property + def json_path(self): ... class ValidationError(_Error): ... class SchemaError(_Error): ... class RefResolutionError(Exception): - def __init__(self, cause) -> None: ... - def __lt__(self, other): ... - def __le__(self, other): ... - def __gt__(self, other): ... - def __ge__(self, other): ... + def __init__(self, cause: str) -> None: ... class UndefinedTypeCheck(Exception): type: Any def __init__(self, type) -> None: ... - def __unicode__(self): ... class UnknownType(Exception): type: Any instance: Any schema: Any def __init__(self, type, instance, schema) -> None: ... - def __unicode__(self): ... class FormatError(Exception): message: Any cause: Any def __init__(self, message, cause: Any | None = ...) -> None: ... - def __unicode__(self): ... class ErrorTree: errors: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/protocols.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/protocols.pyi new file mode 100644 index 000000000..451e4ec67 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/protocols.pyi @@ -0,0 +1,22 @@ +from typing import Any, ClassVar, Iterator, Protocol + +from jsonschema._format import FormatChecker +from jsonschema._types import TypeChecker +from jsonschema.exceptions import ValidationError +from jsonschema.validators import RefResolver + +class Validator(Protocol): + META_SCHEMA: ClassVar[dict[Any, Any]] + VALIDATORS: ClassVar[dict[Any, Any]] + TYPE_CHECKER: ClassVar[TypeChecker] + schema: dict[Any, Any] | bool + def __init__( + self, schema: dict[Any, Any] | bool, resolver: RefResolver | None = ..., format_checker: FormatChecker | None = ... + ) -> None: ... + @classmethod + def check_schema(cls, schema: dict[Any, Any]) -> None: ... + def is_type(self, instance: Any, type: str) -> bool: ... + def is_valid(self, instance: dict[Any, Any]) -> bool: ... + def iter_errors(self, instance: dict[Any, Any]) -> Iterator[ValidationError]: ... + def validate(self, instance: dict[Any, Any]) -> None: ... + def evolve(self, **kwargs) -> "Validator": ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/validators.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/validators.pyi index b9a078e60..782902178 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/validators.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/validators.pyi @@ -1,32 +1,15 @@ -from typing import Any +from typing import Any, Callable -from jsonschema import exceptions as exceptions -from jsonschema.exceptions import ErrorTree as ErrorTree - -class _DontDoThat(Exception): ... - -validators: Any -meta_schemas: Any - -def validates(version): ... - -class _DefaultTypesDeprecatingMetaClass(type): - DEFAULT_TYPES: Any - -def create( - meta_schema, - validators=..., - version: Any | None = ..., - default_types: Any | None = ..., - type_checker: Any | None = ..., - id_of=..., -): ... +def validates(version: str) -> Callable[..., Any]: ... +def create(meta_schema, validators=..., version: Any | None = ..., type_checker=..., id_of=..., applicable_validators=...): ... def extend(validator, validators=..., version: Any | None = ..., type_checker: Any | None = ...): ... Draft3Validator: Any Draft4Validator: Any Draft6Validator: Any Draft7Validator: Any +Draft201909Validator: Any +Draft202012Validator: Any class RefResolver: referrer: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/METADATA.toml new file mode 100644 index 000000000..77ff5706c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/METADATA.toml @@ -0,0 +1,2 @@ +version = "2.9.*" +requires = [] # requires types-pyasn1 (not available yet) diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/__init__.pyi new file mode 100644 index 000000000..4f72194fa --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/__init__.pyi @@ -0,0 +1,104 @@ +from typing import Any, Tuple, Type +from typing_extensions import Literal + +from .abstract.attrDef import AttrDef as AttrDef +from .abstract.attribute import ( + Attribute as Attribute, + OperationalAttribute as OperationalAttribute, + WritableAttribute as WritableAttribute, +) +from .abstract.cursor import Reader as Reader, Writer as Writer +from .abstract.entry import Entry as Entry, WritableEntry as WritableEntry +from .abstract.objectDef import ObjectDef as ObjectDef +from .core.connection import Connection as Connection +from .core.pooling import ServerPool as ServerPool +from .core.rdns import ReverseDnsSetting as ReverseDnsSetting +from .core.server import Server as Server +from .core.tls import Tls as Tls +from .protocol.rfc4512 import DsaInfo as DsaInfo, SchemaInfo as SchemaInfo +from .utils.config import get_config_parameter as get_config_parameter, set_config_parameter as set_config_parameter +from .version import __description__ as __description__, __status__ as __status__, __url__ as __url__ + +ANONYMOUS: Literal["ANONYMOUS"] +SIMPLE: Literal["SIMPLE"] +SASL: Literal["SASL"] +NTLM: Literal["NTLM"] + +EXTERNAL: Literal["EXTERNAL"] +DIGEST_MD5: Literal["DIGEST-MD5"] +KERBEROS: Literal["GSSAPI"] +GSSAPI: Literal["GSSAPI"] +PLAIN: Literal["PLAIN"] + +AUTO_BIND_DEFAULT: Literal["DEFAULT"] +AUTO_BIND_NONE: Literal["NONE"] +AUTO_BIND_NO_TLS: Literal["NO_TLS"] +AUTO_BIND_TLS_BEFORE_BIND: Literal["TLS_BEFORE_BIND"] +AUTO_BIND_TLS_AFTER_BIND: Literal["TLS_AFTER_BIND"] + +IP_SYSTEM_DEFAULT: Literal["IP_SYSTEM_DEFAULT"] +IP_V4_ONLY: Literal["IP_V4_ONLY"] +IP_V6_ONLY: Literal["IP_V6_ONLY"] +IP_V4_PREFERRED: Literal["IP_V4_PREFERRED"] +IP_V6_PREFERRED: Literal["IP_V6_PREFERRED"] + +BASE: Literal["BASE"] +LEVEL: Literal["LEVEL"] +SUBTREE: Literal["SUBTREE"] + +DEREF_NEVER: Literal["NEVER"] +DEREF_SEARCH: Literal["SEARCH"] +DEREF_BASE: Literal["FINDING_BASE"] +DEREF_ALWAYS: Literal["ALWAYS"] + +ALL_ATTRIBUTES: Literal["*"] +NO_ATTRIBUTES: Literal["1.1"] +ALL_OPERATIONAL_ATTRIBUTES: Literal["+"] + +MODIFY_ADD: Literal["MODIFY_ADD"] +MODIFY_DELETE: Literal["MODIFY_DELETE"] +MODIFY_REPLACE: Literal["MODIFY_REPLACE"] +MODIFY_INCREMENT: Literal["MODIFY_INCREMENT"] + +SYNC: Literal["SYNC"] +SAFE_SYNC: Literal["SAFE_SYNC"] +SAFE_RESTARTABLE: Literal["SAFE_RESTARTABLE"] +ASYNC: Literal["ASYNC"] +LDIF: Literal["LDIF"] +RESTARTABLE: Literal["RESTARTABLE"] +REUSABLE: Literal["REUSABLE"] +MOCK_SYNC: Literal["MOCK_SYNC"] +MOCK_ASYNC: Literal["MOCK_ASYNC"] +ASYNC_STREAM: Literal["ASYNC_STREAM"] + +NONE: Literal["NO_INFO"] +DSA: Literal["DSA"] +SCHEMA: Literal["SCHEMA"] +ALL: Literal["ALL"] + +OFFLINE_EDIR_8_8_8: Literal["EDIR_8_8_8"] +OFFLINE_EDIR_9_1_4: Literal["EDIR_9_1_4"] +OFFLINE_AD_2012_R2: Literal["AD_2012_R2"] +OFFLINE_SLAPD_2_4: Literal["SLAPD_2_4"] +OFFLINE_DS389_1_3_3: Literal["DS389_1_3_3"] + +FIRST: Literal["FIRST"] +ROUND_ROBIN: Literal["ROUND_ROBIN"] +RANDOM: Literal["RANDOM"] + +HASHED_NONE: Literal["PLAIN"] +HASHED_SHA: Literal["SHA"] +HASHED_SHA256: Literal["SHA256"] +HASHED_SHA384: Literal["SHA384"] +HASHED_SHA512: Literal["SHA512"] +HASHED_MD5: Literal["MD5"] +HASHED_SALTED_SHA: Literal["SALTED_SHA"] +HASHED_SALTED_SHA256: Literal["SALTED_SHA256"] +HASHED_SALTED_SHA384: Literal["SALTED_SHA384"] +HASHED_SALTED_SHA512: Literal["SALTED_SHA512"] +HASHED_SALTED_MD5: Literal["SALTED_MD5"] + +NUMERIC_TYPES: Tuple[Type[Any], ...] +INTEGER_TYPES: Tuple[Type[Any], ...] +STRING_TYPES: Tuple[Type[Any], ...] +SEQUENCE_TYPES: Tuple[Type[Any], ...] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/__init__.pyi new file mode 100644 index 000000000..5c2b1bd77 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/__init__.pyi @@ -0,0 +1,15 @@ +from typing import Any + +STATUS_INIT: str +STATUS_VIRTUAL: str +STATUS_MANDATORY_MISSING: str +STATUS_READ: str +STATUS_WRITABLE: str +STATUS_PENDING_CHANGES: str +STATUS_COMMITTED: str +STATUS_READY_FOR_DELETION: str +STATUS_READY_FOR_MOVING: str +STATUS_READY_FOR_RENAMING: str +STATUS_DELETED: str +STATUSES: Any +INITIAL_STATUSES: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/attrDef.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/attrDef.pyi new file mode 100644 index 000000000..980262393 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/attrDef.pyi @@ -0,0 +1,33 @@ +from typing import Any + +class AttrDef: + name: Any + key: Any + validate: Any + pre_query: Any + post_query: Any + default: Any + dereference_dn: Any + description: Any + mandatory: Any + single_value: Any + oid_info: Any + other_names: Any + def __init__( + self, + name, + key: Any | None = ..., + validate: Any | None = ..., + pre_query: Any | None = ..., + post_query: Any | None = ..., + default=..., + dereference_dn: Any | None = ..., + description: Any | None = ..., + mandatory: bool = ..., + single_value: Any | None = ..., + alias: Any | None = ..., + ) -> None: ... + def __eq__(self, other): ... + def __lt__(self, other): ... + def __hash__(self): ... + def __setattr__(self, key, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/attribute.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/attribute.pyi new file mode 100644 index 000000000..d5ed793db --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/attribute.pyi @@ -0,0 +1,34 @@ +from typing import Any + +class Attribute: + key: Any + definition: Any + values: Any + raw_values: Any + response: Any + entry: Any + cursor: Any + other_names: Any + def __init__(self, attr_def, entry, cursor) -> None: ... + def __len__(self): ... + def __iter__(self): ... + def __getitem__(self, item): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + @property + def value(self): ... + +class OperationalAttribute(Attribute): ... + +class WritableAttribute(Attribute): + def __iadd__(self, other): ... + def __isub__(self, other): ... + def add(self, values) -> None: ... + def set(self, values) -> None: ... + def delete(self, values) -> None: ... + def remove(self) -> None: ... + def discard(self) -> None: ... + @property + def virtual(self): ... + @property + def changes(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/cursor.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/cursor.pyi new file mode 100644 index 000000000..ee27126af --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/cursor.pyi @@ -0,0 +1,102 @@ +from typing import Any, NamedTuple + +class Operation(NamedTuple): + request: Any + result: Any + response: Any + +class Cursor: + connection: Any + get_operational_attributes: Any + definition: Any + attributes: Any + controls: Any + execution_time: Any + entries: Any + schema: Any + def __init__( + self, + connection, + object_def, + get_operational_attributes: bool = ..., + attributes: Any | None = ..., + controls: Any | None = ..., + auxiliary_class: Any | None = ..., + ) -> None: ... + def __iter__(self): ... + def __getitem__(self, item): ... + def __len__(self): ... + def __bool__(self): ... + def match_dn(self, dn): ... + def match(self, attributes, value): ... + def remove(self, entry) -> None: ... + @property + def operations(self): ... + @property + def errors(self): ... + @property + def failed(self): ... + +class Reader(Cursor): + entry_class: Any + attribute_class: Any + entry_initial_status: Any + sub_tree: Any + base: Any + dereference_aliases: Any + validated_query: Any + query_filter: Any + def __init__( + self, + connection, + object_def, + base, + query: str = ..., + components_in_and: bool = ..., + sub_tree: bool = ..., + get_operational_attributes: bool = ..., + attributes: Any | None = ..., + controls: Any | None = ..., + auxiliary_class: Any | None = ..., + ) -> None: ... + @property + def query(self): ... + @query.setter + def query(self, value) -> None: ... + @property + def components_in_and(self): ... + @components_in_and.setter + def components_in_and(self, value) -> None: ... + def clear(self) -> None: ... + execution_time: Any + entries: Any + def reset(self) -> None: ... + def search(self, attributes: Any | None = ...): ... + def search_object(self, entry_dn: Any | None = ..., attributes: Any | None = ...): ... + def search_level(self, attributes: Any | None = ...): ... + def search_subtree(self, attributes: Any | None = ...): ... + def search_paged(self, paged_size, paged_criticality: bool = ..., generator: bool = ..., attributes: Any | None = ...): ... + +class Writer(Cursor): + entry_class: Any + attribute_class: Any + entry_initial_status: Any + @staticmethod + def from_cursor(cursor, connection: Any | None = ..., object_def: Any | None = ..., custom_validator: Any | None = ...): ... + @staticmethod + def from_response(connection, object_def, response: Any | None = ...): ... + dereference_aliases: Any + def __init__( + self, + connection, + object_def, + get_operational_attributes: bool = ..., + attributes: Any | None = ..., + controls: Any | None = ..., + auxiliary_class: Any | None = ..., + ) -> None: ... + execution_time: Any + def commit(self, refresh: bool = ...): ... + def discard(self) -> None: ... + def new(self, dn): ... + def refresh_entry(self, entry, tries: int = ..., seconds: int = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/entry.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/entry.pyi new file mode 100644 index 000000000..b7392e22c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/entry.pyi @@ -0,0 +1,83 @@ +from typing import Any + +class EntryState: + dn: Any + status: Any + attributes: Any + raw_attributes: Any + response: Any + cursor: Any + origin: Any + read_time: Any + changes: Any + definition: Any + def __init__(self, dn, cursor) -> None: ... + def set_status(self, status) -> None: ... + @property + def entry_raw_attributes(self): ... + +class EntryBase: + def __init__(self, dn, cursor) -> None: ... + def __iter__(self): ... + def __contains__(self, item): ... + def __getattr__(self, item): ... + def __setattr__(self, item, value) -> None: ... + def __getitem__(self, item): ... + def __eq__(self, other): ... + def __lt__(self, other): ... + @property + def entry_dn(self): ... + @property + def entry_cursor(self): ... + @property + def entry_status(self): ... + @property + def entry_definition(self): ... + @property + def entry_raw_attributes(self): ... + def entry_raw_attribute(self, name): ... + @property + def entry_mandatory_attributes(self): ... + @property + def entry_attributes(self): ... + @property + def entry_attributes_as_dict(self): ... + @property + def entry_read_time(self): ... + def entry_to_json( + self, + raw: bool = ..., + indent: int = ..., + sort: bool = ..., + stream: Any | None = ..., + checked_attributes: bool = ..., + include_empty: bool = ..., + ): ... + def entry_to_ldif( + self, all_base64: bool = ..., line_separator: Any | None = ..., sort_order: Any | None = ..., stream: Any | None = ... + ): ... + +class Entry(EntryBase): + def entry_writable( + self, + object_def: Any | None = ..., + writer_cursor: Any | None = ..., + attributes: Any | None = ..., + custom_validator: Any | None = ..., + auxiliary_class: Any | None = ..., + ): ... + +class WritableEntry(EntryBase): + def __setitem__(self, key, value) -> None: ... + def __setattr__(self, item, value) -> None: ... + def __getattr__(self, item): ... + @property + def entry_virtual_attributes(self): ... + def entry_commit_changes(self, refresh: bool = ..., controls: Any | None = ..., clear_history: bool = ...): ... + def entry_discard_changes(self) -> None: ... + def entry_delete(self) -> None: ... + def entry_refresh(self, tries: int = ..., seconds: int = ...): ... + def entry_move(self, destination_dn) -> None: ... + def entry_rename(self, new_name) -> None: ... + @property + def entry_changes(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/objectDef.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/objectDef.pyi new file mode 100644 index 000000000..31931796f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/abstract/objectDef.pyi @@ -0,0 +1,23 @@ +from typing import Any + +class ObjectDef: + def __init__( + self, + object_class: Any | None = ..., + schema: Any | None = ..., + custom_validator: Any | None = ..., + auxiliary_class: Any | None = ..., + ) -> None: ... + def __getitem__(self, item): ... + def __getattr__(self, item): ... + def __setattr__(self, key, value) -> None: ... + def __iadd__(self, other): ... + def __isub__(self, other): ... + def __iter__(self): ... + def __len__(self): ... + def __bool__(self): ... + def __contains__(self, item): ... + def add_from_schema(self, attribute_name, mandatory: bool = ...) -> None: ... + def add_attribute(self, definition: Any | None = ...) -> None: ... + def remove_attribute(self, item) -> None: ... + def clear_attributes(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/connection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/connection.pyi new file mode 100644 index 000000000..2b21d779b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/connection.pyi @@ -0,0 +1,170 @@ +from _typeshed import Self +from types import TracebackType +from typing import Any, Type +from typing_extensions import Literal + +from .server import Server + +SASL_AVAILABLE_MECHANISMS: Any +CLIENT_STRATEGIES: Any + +class Connection: + connection_lock: Any + last_error: str + strategy_type: Any + user: Any + password: Any + authentication: Any + version: Any + auto_referrals: Any + request: Any + response: Any | None + result: Any + bound: bool + listening: bool + closed: bool + auto_bind: Any + sasl_mechanism: Any + sasl_credentials: Any + socket: Any + tls_started: bool + sasl_in_progress: bool + read_only: Any + lazy: Any + pool_name: Any + pool_size: int | None + cred_store: Any + pool_lifetime: Any + pool_keepalive: Any + starting_tls: bool + check_names: Any + raise_exceptions: Any + auto_range: Any + extend: Any + fast_decoder: Any + receive_timeout: Any + empty_attributes: Any + use_referral_cache: Any + auto_escape: Any + auto_encode: Any + source_address: Any + source_port_list: Any + server_pool: Any | None + server: Any + strategy: Any + send: Any + open: Any + get_response: Any + post_send_single_response: Any + post_send_search: Any + def __init__( + self, + server: Server | str, + user: str | None = ..., + password: str | None = ..., + auto_bind: Literal["DEFAULT", "NONE", "NO_TLS", "TLS_BEFORE_BIND", "TLS_AFTER_BIND"] = ..., + version: int = ..., + authentication: Literal["ANONYMOUS", "SIMPLE", "SASL", "NTLM"] | None = ..., + client_strategy: Literal[ + "SYNC", "SAFE_SYNC", "ASYNC", "LDIF", "RESTARTABLE", "REUSABLE", "MOCK_SYNC", "MOCK_ASYNC", "ASYNC_STREAM" + ] = ..., + auto_referrals: bool = ..., + auto_range: bool = ..., + sasl_mechanism: str | None = ..., + sasl_credentials: Any | None = ..., + check_names: bool = ..., + collect_usage: bool = ..., + read_only: bool = ..., + lazy: bool = ..., + raise_exceptions: bool = ..., + pool_name: str | None = ..., + pool_size: int | None = ..., + pool_lifetime: int | None = ..., + cred_store: Any | None = ..., + fast_decoder: bool = ..., + receive_timeout: Any | None = ..., + return_empty_attributes: bool = ..., + use_referral_cache: bool = ..., + auto_escape: bool = ..., + auto_encode: bool = ..., + pool_keepalive: Any | None = ..., + source_address: str | None = ..., + source_port: int | None = ..., + source_port_list: Any | None = ..., + ) -> None: ... + def repr_with_sensitive_data_stripped(self): ... + @property + def stream(self): ... + @stream.setter + def stream(self, value) -> None: ... + @property + def usage(self): ... + def __enter__(self: Self) -> Self: ... + def __exit__( + self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> Literal[False] | None: ... + def bind(self, read_server_info: bool = ..., controls: Any | None = ...): ... + def rebind( + self, + user: Any | None = ..., + password: Any | None = ..., + authentication: Any | None = ..., + sasl_mechanism: Any | None = ..., + sasl_credentials: Any | None = ..., + read_server_info: bool = ..., + controls: Any | None = ..., + ): ... + def unbind(self, controls: Any | None = ...): ... + def search( + self, + search_base: str, + search_filter: str, + search_scope: Literal["BASE", "LEVEL", "SUBTREE"] = ..., + dereference_aliases: Literal["NEVER", "SEARCH", "FINDING_BASE", "ALWAYS"] = ..., + attributes: Any | None = ..., + size_limit: int = ..., + time_limit: int = ..., + types_only: bool = ..., + get_operational_attributes: bool = ..., + controls: Any | None = ..., + paged_size: int | None = ..., + paged_criticality: bool = ..., + paged_cookie: str | bytes | None = ..., + auto_escape: bool | None = ..., + ): ... + def compare(self, dn, attribute, value, controls: Any | None = ...): ... + def add(self, dn, object_class: Any | None = ..., attributes: Any | None = ..., controls: Any | None = ...): ... + def delete(self, dn, controls: Any | None = ...): ... + def modify(self, dn, changes, controls: Any | None = ...): ... + def modify_dn( + self, dn, relative_dn, delete_old_dn: bool = ..., new_superior: Any | None = ..., controls: Any | None = ... + ): ... + def abandon(self, message_id, controls: Any | None = ...): ... + def extended( + self, request_name, request_value: Any | None = ..., controls: Any | None = ..., no_encode: Any | None = ... + ): ... + def start_tls(self, read_server_info: bool = ...): ... + def do_sasl_bind(self, controls): ... + def do_ntlm_bind(self, controls): ... + def refresh_server_info(self) -> None: ... + def response_to_ldif( + self, + search_result: Any | None = ..., + all_base64: bool = ..., + line_separator: Any | None = ..., + sort_order: Any | None = ..., + stream: Any | None = ..., + ): ... + def response_to_json( + self, + raw: bool = ..., + search_result: Any | None = ..., + indent: int = ..., + sort: bool = ..., + stream: Any | None = ..., + checked_attributes: bool = ..., + include_empty: bool = ..., + ): ... + def response_to_file(self, target, raw: bool = ..., indent: int = ..., sort: bool = ...) -> None: ... + @property + def entries(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/exceptions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/exceptions.pyi new file mode 100644 index 000000000..9e1cc8138 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/exceptions.pyi @@ -0,0 +1,146 @@ +import socket +from typing import Any, Type, TypeVar + +_T = TypeVar("_T") + +class LDAPException(Exception): ... + +class LDAPOperationResult(LDAPException): + def __new__( + cls: Type[_T], + result: Any | None = ..., + description: Any | None = ..., + dn: Any | None = ..., + message: Any | None = ..., + response_type: Any | None = ..., + response: Any | None = ..., + ) -> _T: ... + result: Any + description: Any + dn: Any + message: Any + type: Any + response: Any + def __init__( + self, + result: Any | None = ..., + description: Any | None = ..., + dn: Any | None = ..., + message: Any | None = ..., + response_type: Any | None = ..., + response: Any | None = ..., + ) -> None: ... + +class LDAPOperationsErrorResult(LDAPOperationResult): ... +class LDAPProtocolErrorResult(LDAPOperationResult): ... +class LDAPTimeLimitExceededResult(LDAPOperationResult): ... +class LDAPSizeLimitExceededResult(LDAPOperationResult): ... +class LDAPAuthMethodNotSupportedResult(LDAPOperationResult): ... +class LDAPStrongerAuthRequiredResult(LDAPOperationResult): ... +class LDAPReferralResult(LDAPOperationResult): ... +class LDAPAdminLimitExceededResult(LDAPOperationResult): ... +class LDAPUnavailableCriticalExtensionResult(LDAPOperationResult): ... +class LDAPConfidentialityRequiredResult(LDAPOperationResult): ... +class LDAPSASLBindInProgressResult(LDAPOperationResult): ... +class LDAPNoSuchAttributeResult(LDAPOperationResult): ... +class LDAPUndefinedAttributeTypeResult(LDAPOperationResult): ... +class LDAPInappropriateMatchingResult(LDAPOperationResult): ... +class LDAPConstraintViolationResult(LDAPOperationResult): ... +class LDAPAttributeOrValueExistsResult(LDAPOperationResult): ... +class LDAPInvalidAttributeSyntaxResult(LDAPOperationResult): ... +class LDAPNoSuchObjectResult(LDAPOperationResult): ... +class LDAPAliasProblemResult(LDAPOperationResult): ... +class LDAPInvalidDNSyntaxResult(LDAPOperationResult): ... +class LDAPAliasDereferencingProblemResult(LDAPOperationResult): ... +class LDAPInappropriateAuthenticationResult(LDAPOperationResult): ... +class LDAPInvalidCredentialsResult(LDAPOperationResult): ... +class LDAPInsufficientAccessRightsResult(LDAPOperationResult): ... +class LDAPBusyResult(LDAPOperationResult): ... +class LDAPUnavailableResult(LDAPOperationResult): ... +class LDAPUnwillingToPerformResult(LDAPOperationResult): ... +class LDAPLoopDetectedResult(LDAPOperationResult): ... +class LDAPNamingViolationResult(LDAPOperationResult): ... +class LDAPObjectClassViolationResult(LDAPOperationResult): ... +class LDAPNotAllowedOnNotLeafResult(LDAPOperationResult): ... +class LDAPNotAllowedOnRDNResult(LDAPOperationResult): ... +class LDAPEntryAlreadyExistsResult(LDAPOperationResult): ... +class LDAPObjectClassModsProhibitedResult(LDAPOperationResult): ... +class LDAPAffectMultipleDSASResult(LDAPOperationResult): ... +class LDAPOtherResult(LDAPOperationResult): ... +class LDAPLCUPResourcesExhaustedResult(LDAPOperationResult): ... +class LDAPLCUPSecurityViolationResult(LDAPOperationResult): ... +class LDAPLCUPInvalidDataResult(LDAPOperationResult): ... +class LDAPLCUPUnsupportedSchemeResult(LDAPOperationResult): ... +class LDAPLCUPReloadRequiredResult(LDAPOperationResult): ... +class LDAPCanceledResult(LDAPOperationResult): ... +class LDAPNoSuchOperationResult(LDAPOperationResult): ... +class LDAPTooLateResult(LDAPOperationResult): ... +class LDAPCannotCancelResult(LDAPOperationResult): ... +class LDAPAssertionFailedResult(LDAPOperationResult): ... +class LDAPAuthorizationDeniedResult(LDAPOperationResult): ... +class LDAPESyncRefreshRequiredResult(LDAPOperationResult): ... + +exception_table: Any + +class LDAPExceptionError(LDAPException): ... +class LDAPConfigurationError(LDAPExceptionError): ... +class LDAPUnknownStrategyError(LDAPConfigurationError): ... +class LDAPUnknownAuthenticationMethodError(LDAPConfigurationError): ... +class LDAPSSLConfigurationError(LDAPConfigurationError): ... +class LDAPDefinitionError(LDAPConfigurationError): ... +class LDAPPackageUnavailableError(LDAPConfigurationError, ImportError): ... +class LDAPConfigurationParameterError(LDAPConfigurationError): ... +class LDAPKeyError(LDAPExceptionError, KeyError, AttributeError): ... +class LDAPObjectError(LDAPExceptionError, ValueError): ... +class LDAPAttributeError(LDAPExceptionError, ValueError, TypeError): ... +class LDAPCursorError(LDAPExceptionError): ... +class LDAPCursorAttributeError(LDAPCursorError, AttributeError): ... +class LDAPObjectDereferenceError(LDAPExceptionError): ... +class LDAPSSLNotSupportedError(LDAPExceptionError, ImportError): ... +class LDAPInvalidTlsSpecificationError(LDAPExceptionError): ... +class LDAPInvalidHashAlgorithmError(LDAPExceptionError, ValueError): ... +class LDAPSignatureVerificationFailedError(LDAPExceptionError): ... +class LDAPBindError(LDAPExceptionError): ... +class LDAPInvalidServerError(LDAPExceptionError): ... +class LDAPSASLMechanismNotSupportedError(LDAPExceptionError): ... +class LDAPConnectionIsReadOnlyError(LDAPExceptionError): ... +class LDAPChangeError(LDAPExceptionError, ValueError): ... +class LDAPServerPoolError(LDAPExceptionError): ... +class LDAPServerPoolExhaustedError(LDAPExceptionError): ... +class LDAPInvalidPortError(LDAPExceptionError): ... +class LDAPStartTLSError(LDAPExceptionError): ... +class LDAPCertificateError(LDAPExceptionError): ... +class LDAPUserNameNotAllowedError(LDAPExceptionError): ... +class LDAPUserNameIsMandatoryError(LDAPExceptionError): ... +class LDAPPasswordIsMandatoryError(LDAPExceptionError): ... +class LDAPInvalidFilterError(LDAPExceptionError): ... +class LDAPInvalidScopeError(LDAPExceptionError, ValueError): ... +class LDAPInvalidDereferenceAliasesError(LDAPExceptionError, ValueError): ... +class LDAPInvalidValueError(LDAPExceptionError, ValueError): ... +class LDAPControlError(LDAPExceptionError, ValueError): ... +class LDAPExtensionError(LDAPExceptionError, ValueError): ... +class LDAPLDIFError(LDAPExceptionError): ... +class LDAPSchemaError(LDAPExceptionError): ... +class LDAPSASLPrepError(LDAPExceptionError): ... +class LDAPSASLBindInProgressError(LDAPExceptionError): ... +class LDAPMetricsError(LDAPExceptionError): ... +class LDAPObjectClassError(LDAPExceptionError): ... +class LDAPInvalidDnError(LDAPExceptionError): ... +class LDAPResponseTimeoutError(LDAPExceptionError): ... +class LDAPTransactionError(LDAPExceptionError): ... +class LDAPInfoError(LDAPExceptionError): ... +class LDAPCommunicationError(LDAPExceptionError): ... +class LDAPSocketOpenError(LDAPCommunicationError): ... +class LDAPSocketCloseError(LDAPCommunicationError): ... +class LDAPSocketReceiveError(LDAPCommunicationError, socket.error): ... +class LDAPSocketSendError(LDAPCommunicationError, socket.error): ... +class LDAPSessionTerminatedByServerError(LDAPCommunicationError): ... +class LDAPUnknownResponseError(LDAPCommunicationError): ... +class LDAPUnknownRequestError(LDAPCommunicationError): ... +class LDAPReferralError(LDAPCommunicationError): ... +class LDAPConnectionPoolNameIsMandatoryError(LDAPExceptionError): ... +class LDAPConnectionPoolNotStartedError(LDAPExceptionError): ... +class LDAPMaximumRetriesError(LDAPExceptionError): ... + +def communication_exception_factory(exc_to_raise, exc): ... +def start_tls_exception_factory(exc): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/pooling.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/pooling.pyi new file mode 100644 index 000000000..088c73e1f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/pooling.pyi @@ -0,0 +1,42 @@ +from typing import Any + +POOLING_STRATEGIES: Any + +class ServerState: + server: Any + last_checked_time: Any + available: Any + def __init__(self, server, last_checked_time, available) -> None: ... + +class ServerPoolState: + server_states: Any + strategy: Any + server_pool: Any + last_used_server: int + initialize_time: Any + def __init__(self, server_pool) -> None: ... + def refresh(self) -> None: ... + def get_current_server(self): ... + def get_server(self): ... + def find_active_random_server(self): ... + def find_active_server(self, starting): ... + def __len__(self): ... + +class ServerPool: + servers: Any + pool_states: Any + active: Any + exhaust: Any + single: Any + strategy: Any + def __init__( + self, servers: Any | None = ..., pool_strategy=..., active: bool = ..., exhaust: bool = ..., single_state: bool = ... + ) -> None: ... + def __len__(self): ... + def __getitem__(self, item): ... + def __iter__(self): ... + def add(self, servers) -> None: ... + def remove(self, server) -> None: ... + def initialize(self, connection) -> None: ... + def get_server(self, connection): ... + def get_current_server(self, connection): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/rdns.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/rdns.pyi new file mode 100644 index 000000000..e712f803b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/rdns.pyi @@ -0,0 +1,12 @@ +from typing import Any + +class ReverseDnsSetting: + OFF: Any + REQUIRE_RESOLVE_ALL_ADDRESSES: Any + REQUIRE_RESOLVE_IP_ADDRESSES_ONLY: Any + OPTIONAL_RESOLVE_ALL_ADDRESSES: Any + OPTIONAL_RESOLVE_IP_ADDRESSES_ONLY: Any + SUPPORTED_VALUES: Any + +def get_hostname_by_addr(addr, success_required: bool = ...): ... +def is_ip_addr(addr): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/results.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/results.pyi new file mode 100644 index 000000000..a2772bd14 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/results.pyi @@ -0,0 +1,56 @@ +from typing import Any + +RESULT_SUCCESS: int +RESULT_OPERATIONS_ERROR: int +RESULT_PROTOCOL_ERROR: int +RESULT_TIME_LIMIT_EXCEEDED: int +RESULT_SIZE_LIMIT_EXCEEDED: int +RESULT_COMPARE_FALSE: int +RESULT_COMPARE_TRUE: int +RESULT_AUTH_METHOD_NOT_SUPPORTED: int +RESULT_STRONGER_AUTH_REQUIRED: int +RESULT_RESERVED: int +RESULT_REFERRAL: int +RESULT_ADMIN_LIMIT_EXCEEDED: int +RESULT_UNAVAILABLE_CRITICAL_EXTENSION: int +RESULT_CONFIDENTIALITY_REQUIRED: int +RESULT_SASL_BIND_IN_PROGRESS: int +RESULT_NO_SUCH_ATTRIBUTE: int +RESULT_UNDEFINED_ATTRIBUTE_TYPE: int +RESULT_INAPPROPRIATE_MATCHING: int +RESULT_CONSTRAINT_VIOLATION: int +RESULT_ATTRIBUTE_OR_VALUE_EXISTS: int +RESULT_INVALID_ATTRIBUTE_SYNTAX: int +RESULT_NO_SUCH_OBJECT: int +RESULT_ALIAS_PROBLEM: int +RESULT_INVALID_DN_SYNTAX: int +RESULT_ALIAS_DEREFERENCING_PROBLEM: int +RESULT_INAPPROPRIATE_AUTHENTICATION: int +RESULT_INVALID_CREDENTIALS: int +RESULT_INSUFFICIENT_ACCESS_RIGHTS: int +RESULT_BUSY: int +RESULT_UNAVAILABLE: int +RESULT_UNWILLING_TO_PERFORM: int +RESULT_LOOP_DETECTED: int +RESULT_NAMING_VIOLATION: int +RESULT_OBJECT_CLASS_VIOLATION: int +RESULT_NOT_ALLOWED_ON_NON_LEAF: int +RESULT_NOT_ALLOWED_ON_RDN: int +RESULT_ENTRY_ALREADY_EXISTS: int +RESULT_OBJECT_CLASS_MODS_PROHIBITED: int +RESULT_AFFECT_MULTIPLE_DSAS: int +RESULT_OTHER: int +RESULT_LCUP_RESOURCES_EXHAUSTED: int +RESULT_LCUP_SECURITY_VIOLATION: int +RESULT_LCUP_INVALID_DATA: int +RESULT_LCUP_UNSUPPORTED_SCHEME: int +RESULT_LCUP_RELOAD_REQUIRED: int +RESULT_CANCELED: int +RESULT_NO_SUCH_OPERATION: int +RESULT_TOO_LATE: int +RESULT_CANNOT_CANCEL: int +RESULT_ASSERTION_FAILED: int +RESULT_AUTHORIZATION_DENIED: int +RESULT_E_SYNC_REFRESH_REQUIRED: int +RESULT_CODES: Any +DO_NOT_RAISE_EXCEPTIONS: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/server.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/server.pyi new file mode 100644 index 000000000..65890428e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/server.pyi @@ -0,0 +1,64 @@ +from socket import AF_UNIX as AF_UNIX +from typing import Any +from typing_extensions import Literal + +unix_socket_available: bool + +class Server: + ipc: bool + host: Any + port: Any + allowed_referral_hosts: Any + ssl: Any + tls: Any + name: Any + get_info: Any + dit_lock: Any + custom_formatter: Any + custom_validator: Any + current_address: Any + connect_timeout: Any + mode: Any + def __init__( + self, + host: str, + port: int | None = ..., + use_ssl: bool = ..., + allowed_referral_hosts: Any | None = ..., + get_info: Literal["NO_INFO", "DSA", "SCHEMA", "ALL"] = ..., + tls: Any | None = ..., + formatter: Any | None = ..., + connect_timeout: Any | None = ..., + mode: Literal["IP_SYSTEM_DEFAULT", "IP_V4_ONLY", "IP_V6_ONLY", "IP_V4_PREFERRED", "IP_V6_PREFERRED"] = ..., + validator: Any | None = ..., + ) -> None: ... + @property + def address_info(self): ... + def update_availability(self, address, available) -> None: ... + def reset_availability(self) -> None: ... + def check_availability( + self, source_address: Any | None = ..., source_port: Any | None = ..., source_port_list: Any | None = ... + ): ... + @staticmethod + def next_message_id(): ... + def get_info_from_server(self, connection) -> None: ... + def attach_dsa_info(self, dsa_info: Any | None = ...) -> None: ... + def attach_schema_info(self, dsa_schema: Any | None = ...) -> None: ... + @property + def info(self): ... + @property + def schema(self): ... + @staticmethod + def from_definition( + host, + dsa_info, + dsa_schema, + port: Any | None = ..., + use_ssl: bool = ..., + formatter: Any | None = ..., + validator: Any | None = ..., + ): ... + def candidate_addresses(self): ... + def has_control(self, control): ... + def has_extension(self, extension): ... + def has_feature(self, feature): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/timezone.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/timezone.pyi new file mode 100644 index 000000000..c6c52b37c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/timezone.pyi @@ -0,0 +1,11 @@ +from datetime import tzinfo +from typing import Any + +class OffsetTzInfo(tzinfo): + offset: Any + name: Any + def __init__(self, offset, name) -> None: ... + def utcoffset(self, dt): ... + def tzname(self, dt): ... + def dst(self, dt): ... + def __getinitargs__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/tls.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/tls.pyi new file mode 100644 index 000000000..c776f7f88 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/tls.pyi @@ -0,0 +1,36 @@ +from typing import Any + +use_ssl_context: bool + +class Tls: + ssl_options: Any + validate: Any + ca_certs_file: Any + ca_certs_path: Any + ca_certs_data: Any + private_key_password: Any + version: Any + private_key_file: Any + certificate_file: Any + valid_names: Any + ciphers: Any + sni: Any + def __init__( + self, + local_private_key_file: Any | None = ..., + local_certificate_file: Any | None = ..., + validate=..., + version: Any | None = ..., + ssl_options: Any | None = ..., + ca_certs_file: Any | None = ..., + valid_names: Any | None = ..., + ca_certs_path: Any | None = ..., + ca_certs_data: Any | None = ..., + local_private_key_password: Any | None = ..., + ciphers: Any | None = ..., + sni: Any | None = ..., + ) -> None: ... + def wrap_socket(self, connection, do_handshake: bool = ...) -> None: ... + def start_tls(self, connection): ... + +def check_hostname(sock, server_name, additional_names) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/usage.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/usage.pyi new file mode 100644 index 000000000..ccb805bbd --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/core/usage.pyi @@ -0,0 +1,41 @@ +from typing import Any + +class ConnectionUsage: + open_sockets: int + closed_sockets: int + wrapped_sockets: int + bytes_transmitted: int + bytes_received: int + messages_transmitted: int + messages_received: int + operations: int + abandon_operations: int + add_operations: int + bind_operations: int + compare_operations: int + delete_operations: int + extended_operations: int + modify_operations: int + modify_dn_operations: int + search_operations: int + unbind_operations: int + referrals_received: int + referrals_followed: int + referrals_connections: int + restartable_failures: int + restartable_successes: int + servers_from_pool: int + def reset(self) -> None: ... + initial_connection_start_time: Any + open_socket_start_time: Any + connection_stop_time: Any + last_transmitted_time: Any + last_received_time: Any + def __init__(self) -> None: ... + def __iadd__(self, other): ... + def update_transmitted_message(self, message, length) -> None: ... + def update_received_message(self, length) -> None: ... + def start(self, reset: bool = ...) -> None: ... + def stop(self) -> None: ... + @property + def elapsed_time(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/__init__.pyi new file mode 100644 index 000000000..61ca6f486 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/__init__.pyi @@ -0,0 +1,105 @@ +from typing import Any + +class ExtendedOperationContainer: + def __init__(self, connection) -> None: ... + +class StandardExtendedOperations(ExtendedOperationContainer): + def who_am_i(self, controls: Any | None = ...): ... + def modify_password( + self, + user: Any | None = ..., + old_password: Any | None = ..., + new_password: Any | None = ..., + hash_algorithm: Any | None = ..., + salt: Any | None = ..., + controls: Any | None = ..., + ): ... + def paged_search( + self, + search_base, + search_filter, + search_scope=..., + dereference_aliases=..., + attributes: Any | None = ..., + size_limit: int = ..., + time_limit: int = ..., + types_only: bool = ..., + get_operational_attributes: bool = ..., + controls: Any | None = ..., + paged_size: int = ..., + paged_criticality: bool = ..., + generator: bool = ..., + ): ... + def persistent_search( + self, + search_base: str = ..., + search_filter: str = ..., + search_scope=..., + dereference_aliases=..., + attributes=..., + size_limit: int = ..., + time_limit: int = ..., + controls: Any | None = ..., + changes_only: bool = ..., + show_additions: bool = ..., + show_deletions: bool = ..., + show_modifications: bool = ..., + show_dn_modifications: bool = ..., + notifications: bool = ..., + streaming: bool = ..., + callback: Any | None = ..., + ): ... + def funnel_search( + self, + search_base: str = ..., + search_filter: str = ..., + search_scope=..., + dereference_aliases=..., + attributes=..., + size_limit: int = ..., + time_limit: int = ..., + controls: Any | None = ..., + streaming: bool = ..., + callback: Any | None = ..., + ): ... + +class NovellExtendedOperations(ExtendedOperationContainer): + def get_bind_dn(self, controls: Any | None = ...): ... + def get_universal_password(self, user, controls: Any | None = ...): ... + def set_universal_password(self, user, new_password: Any | None = ..., controls: Any | None = ...): ... + def list_replicas(self, server_dn, controls: Any | None = ...): ... + def partition_entry_count(self, partition_dn, controls: Any | None = ...): ... + def replica_info(self, server_dn, partition_dn, controls: Any | None = ...): ... + def start_transaction(self, controls: Any | None = ...): ... + def end_transaction(self, commit: bool = ..., controls: Any | None = ...): ... + def add_members_to_groups(self, members, groups, fix: bool = ..., transaction: bool = ...): ... + def remove_members_from_groups(self, members, groups, fix: bool = ..., transaction: bool = ...): ... + def check_groups_memberships(self, members, groups, fix: bool = ..., transaction: bool = ...): ... + +class MicrosoftExtendedOperations(ExtendedOperationContainer): + def dir_sync( + self, + sync_base, + sync_filter: str = ..., + attributes=..., + cookie: Any | None = ..., + object_security: bool = ..., + ancestors_first: bool = ..., + public_data_only: bool = ..., + incremental_values: bool = ..., + max_length: int = ..., + hex_guid: bool = ..., + ): ... + def modify_password(self, user, new_password, old_password: Any | None = ..., controls: Any | None = ...): ... + def unlock_account(self, user): ... + def add_members_to_groups(self, members, groups, fix: bool = ...): ... + def remove_members_from_groups(self, members, groups, fix: bool = ...): ... + def persistent_search( + self, search_base: str = ..., search_scope=..., attributes=..., streaming: bool = ..., callback: Any | None = ... + ): ... + +class ExtendedOperationsRoot(ExtendedOperationContainer): + standard: Any + novell: Any + microsoft: Any + def __init__(self, connection) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/addMembersToGroups.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/addMembersToGroups.pyi new file mode 100644 index 000000000..486d084f9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/addMembersToGroups.pyi @@ -0,0 +1 @@ +def ad_add_members_to_groups(connection, members_dn, groups_dn, fix: bool = ..., raise_error: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/dirSync.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/dirSync.pyi new file mode 100644 index 000000000..68acbfc5d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/dirSync.pyi @@ -0,0 +1,30 @@ +from typing import Any + +class DirSync: + connection: Any + base: Any + filter: Any + attributes: Any + cookie: Any + object_security: Any + ancestors_first: Any + public_data_only: Any + incremental_values: Any + max_length: Any + hex_guid: Any + more_results: bool + def __init__( + self, + connection, + sync_base, + sync_filter, + attributes, + cookie, + object_security, + ancestors_first, + public_data_only, + incremental_values, + max_length, + hex_guid, + ) -> None: ... + def loop(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/modifyPassword.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/modifyPassword.pyi new file mode 100644 index 000000000..5b3d27a0f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/modifyPassword.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def ad_modify_password(connection, user_dn, new_password, old_password, controls: Any | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/persistentSearch.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/persistentSearch.pyi new file mode 100644 index 000000000..95fca82fc --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/persistentSearch.pyi @@ -0,0 +1,15 @@ +from typing import Any + +class ADPersistentSearch: + connection: Any + message_id: Any + base: Any + scope: Any + attributes: Any + controls: Any + filter: str + def __init__(self, connection, search_base, search_scope, attributes, streaming, callback) -> None: ... + def start(self) -> None: ... + def stop(self, unbind: bool = ...) -> None: ... + def next(self, block: bool = ..., timeout: Any | None = ...): ... + def funnel(self, block: bool = ..., timeout: Any | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/removeMembersFromGroups.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/removeMembersFromGroups.pyi new file mode 100644 index 000000000..915fb9dbb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/removeMembersFromGroups.pyi @@ -0,0 +1 @@ +def ad_remove_members_from_groups(connection, members_dn, groups_dn, fix, raise_error: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/unlockAccount.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/unlockAccount.pyi new file mode 100644 index 000000000..842378089 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/microsoft/unlockAccount.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def ad_unlock_account(connection, user_dn, controls: Any | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/addMembersToGroups.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/addMembersToGroups.pyi new file mode 100644 index 000000000..5ba4cab9b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/addMembersToGroups.pyi @@ -0,0 +1 @@ +def edir_add_members_to_groups(connection, members_dn, groups_dn, fix, transaction): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/checkGroupsMemberships.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/checkGroupsMemberships.pyi new file mode 100644 index 000000000..551636c29 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/checkGroupsMemberships.pyi @@ -0,0 +1 @@ +def edir_check_groups_memberships(connection, members_dn, groups_dn, fix, transaction): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/endTransaction.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/endTransaction.pyi new file mode 100644 index 000000000..f0e8c5896 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/endTransaction.pyi @@ -0,0 +1,14 @@ +from typing import Any + +from ...extend.operation import ExtendedOperation + +class EndTransaction(ExtendedOperation): + request_name: str + response_name: str + request_value: Any + asn1_spec: Any + def config(self) -> None: ... + def __init__(self, connection, commit: bool = ..., controls: Any | None = ...) -> None: ... + def populate_result(self) -> None: ... + response_value: Any + def set_response(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/getBindDn.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/getBindDn.pyi new file mode 100644 index 000000000..4c194ce82 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/getBindDn.pyi @@ -0,0 +1,11 @@ +from typing import Any + +from ...extend.operation import ExtendedOperation + +class GetBindDn(ExtendedOperation): + request_name: str + response_name: str + response_attribute: str + asn1_spec: Any + def config(self) -> None: ... + def populate_result(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/listReplicas.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/listReplicas.pyi new file mode 100644 index 000000000..0c7b6e7a8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/listReplicas.pyi @@ -0,0 +1,13 @@ +from typing import Any + +from ...extend.operation import ExtendedOperation + +class ListReplicas(ExtendedOperation): + request_name: str + response_name: str + request_value: Any + asn1_spec: Any + response_attribute: str + def config(self) -> None: ... + def __init__(self, connection, server_dn, controls: Any | None = ...) -> None: ... + def populate_result(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/nmasGetUniversalPassword.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/nmasGetUniversalPassword.pyi new file mode 100644 index 000000000..59d0f1ca3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/nmasGetUniversalPassword.pyi @@ -0,0 +1,13 @@ +from typing import Any + +from ...extend.operation import ExtendedOperation + +class NmasGetUniversalPassword(ExtendedOperation): + request_name: str + response_name: str + request_value: Any + asn1_spec: Any + response_attribute: str + def config(self) -> None: ... + def __init__(self, connection, user, controls: Any | None = ...) -> None: ... + def populate_result(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/nmasSetUniversalPassword.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/nmasSetUniversalPassword.pyi new file mode 100644 index 000000000..a35b984ba --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/nmasSetUniversalPassword.pyi @@ -0,0 +1,13 @@ +from typing import Any + +from ...extend.operation import ExtendedOperation + +class NmasSetUniversalPassword(ExtendedOperation): + request_name: str + response_name: str + request_value: Any + asn1_spec: Any + response_attribute: str + def config(self) -> None: ... + def __init__(self, connection, user, new_password, controls: Any | None = ...) -> None: ... + def populate_result(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/partition_entry_count.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/partition_entry_count.pyi new file mode 100644 index 000000000..a9127983a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/partition_entry_count.pyi @@ -0,0 +1,12 @@ +from typing import Any + +from ..operation import ExtendedOperation + +class PartitionEntryCount(ExtendedOperation): + request_name: str + response_name: str + request_value: Any + response_attribute: str + def config(self) -> None: ... + def __init__(self, connection, partition_dn, controls: Any | None = ...) -> None: ... + def populate_result(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/removeMembersFromGroups.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/removeMembersFromGroups.pyi new file mode 100644 index 000000000..91a3223c5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/removeMembersFromGroups.pyi @@ -0,0 +1 @@ +def edir_remove_members_from_groups(connection, members_dn, groups_dn, fix, transaction): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/replicaInfo.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/replicaInfo.pyi new file mode 100644 index 000000000..6a4358053 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/replicaInfo.pyi @@ -0,0 +1,12 @@ +from typing import Any + +from ..operation import ExtendedOperation + +class ReplicaInfo(ExtendedOperation): + request_name: str + response_name: str + request_value: Any + response_attribute: str + def config(self) -> None: ... + def __init__(self, connection, server_dn, partition_dn, controls: Any | None = ...) -> None: ... + def populate_result(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/startTransaction.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/startTransaction.pyi new file mode 100644 index 000000000..74dd78c5c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/novell/startTransaction.pyi @@ -0,0 +1,14 @@ +from typing import Any + +from ...extend.operation import ExtendedOperation + +class StartTransaction(ExtendedOperation): + request_name: str + response_name: str + request_value: Any + asn1_spec: Any + def config(self) -> None: ... + def __init__(self, connection, controls: Any | None = ...) -> None: ... + def populate_result(self) -> None: ... + response_value: Any + def set_response(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/operation.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/operation.pyi new file mode 100644 index 000000000..4b14b4b53 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/operation.pyi @@ -0,0 +1,19 @@ +from typing import Any + +class ExtendedOperation: + connection: Any + decoded_response: Any + result: Any + asn1_spec: Any + request_name: Any + response_name: Any + request_value: Any + response_value: Any + response_attribute: Any + controls: Any + def __init__(self, connection, controls: Any | None = ...) -> None: ... + def send(self): ... + def populate_result(self) -> None: ... + def decode_response(self, response: Any | None = ...) -> None: ... + def set_response(self) -> None: ... + def config(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/PagedSearch.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/PagedSearch.pyi new file mode 100644 index 000000000..741f7c5b9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/PagedSearch.pyi @@ -0,0 +1,32 @@ +from typing import Any + +def paged_search_generator( + connection, + search_base, + search_filter, + search_scope=..., + dereference_aliases=..., + attributes: Any | None = ..., + size_limit: int = ..., + time_limit: int = ..., + types_only: bool = ..., + get_operational_attributes: bool = ..., + controls: Any | None = ..., + paged_size: int = ..., + paged_criticality: bool = ..., +) -> None: ... +def paged_search_accumulator( + connection, + search_base, + search_filter, + search_scope=..., + dereference_aliases=..., + attributes: Any | None = ..., + size_limit: int = ..., + time_limit: int = ..., + types_only: bool = ..., + get_operational_attributes: bool = ..., + controls: Any | None = ..., + paged_size: int = ..., + paged_criticality: bool = ..., +): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/PersistentSearch.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/PersistentSearch.pyi new file mode 100644 index 000000000..3af402ec3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/PersistentSearch.pyi @@ -0,0 +1,36 @@ +from typing import Any + +class PersistentSearch: + connection: Any + changes_only: Any + notifications: Any + message_id: Any + base: Any + filter: Any + scope: Any + dereference_aliases: Any + attributes: Any + size_limit: Any + time_limit: Any + controls: Any + def __init__( + self, + connection, + search_base, + search_filter, + search_scope, + dereference_aliases, + attributes, + size_limit, + time_limit, + controls, + changes_only, + events_type, + notifications, + streaming, + callback, + ) -> None: ... + def start(self) -> None: ... + def stop(self, unbind: bool = ...) -> None: ... + def next(self, block: bool = ..., timeout: Any | None = ...): ... + def funnel(self, block: bool = ..., timeout: Any | None = ...) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/modifyPassword.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/modifyPassword.pyi new file mode 100644 index 000000000..5df4b6d1e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/modifyPassword.pyi @@ -0,0 +1,21 @@ +from typing import Any + +from ...extend.operation import ExtendedOperation + +class ModifyPassword(ExtendedOperation): + request_name: str + request_value: Any + asn1_spec: Any + response_attribute: str + def config(self) -> None: ... + def __init__( + self, + connection, + user: Any | None = ..., + old_password: Any | None = ..., + new_password: Any | None = ..., + hash_algorithm: Any | None = ..., + salt: Any | None = ..., + controls: Any | None = ..., + ) -> None: ... + def populate_result(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/whoAmI.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/whoAmI.pyi new file mode 100644 index 000000000..e61b175e9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/extend/standard/whoAmI.pyi @@ -0,0 +1,7 @@ +from ...extend.operation import ExtendedOperation + +class WhoAmI(ExtendedOperation): + request_name: str + response_attribute: str + def config(self) -> None: ... + def populate_result(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/abandon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/abandon.pyi new file mode 100644 index 000000000..2413c214c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/abandon.pyi @@ -0,0 +1,2 @@ +def abandon_operation(msg_id): ... +def abandon_request_to_dict(request): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/add.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/add.pyi new file mode 100644 index 000000000..59d87bae8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/add.pyi @@ -0,0 +1,7 @@ +from typing import Any + +def add_operation( + dn, attributes, auto_encode, schema: Any | None = ..., validator: Any | None = ..., check_names: bool = ... +): ... +def add_request_to_dict(request): ... +def add_response_to_dict(response): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/bind.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/bind.pyi new file mode 100644 index 000000000..5079a87da --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/bind.pyi @@ -0,0 +1,23 @@ +from typing import Any + +def bind_operation( + version, + authentication, + name: str = ..., + password: Any | None = ..., + sasl_mechanism: Any | None = ..., + sasl_credentials: Any | None = ..., + auto_encode: bool = ..., +): ... +def bind_request_to_dict(request): ... +def bind_response_operation( + result_code, + matched_dn: str = ..., + diagnostic_message: str = ..., + referral: Any | None = ..., + server_sasl_credentials: Any | None = ..., +): ... +def bind_response_to_dict(response): ... +def sicily_bind_response_to_dict(response): ... +def bind_response_to_dict_fast(response): ... +def sicily_bind_response_to_dict_fast(response): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/compare.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/compare.pyi new file mode 100644 index 000000000..4b12d3547 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/compare.pyi @@ -0,0 +1,7 @@ +from typing import Any + +def compare_operation( + dn, attribute, value, auto_encode, schema: Any | None = ..., validator: Any | None = ..., check_names: bool = ... +): ... +def compare_request_to_dict(request): ... +def compare_response_to_dict(response): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/delete.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/delete.pyi new file mode 100644 index 000000000..618c8f41c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/delete.pyi @@ -0,0 +1,3 @@ +def delete_operation(dn): ... +def delete_request_to_dict(request): ... +def delete_response_to_dict(response): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/extended.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/extended.pyi new file mode 100644 index 000000000..2cc46be69 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/extended.pyi @@ -0,0 +1,8 @@ +from typing import Any + +def extended_operation(request_name, request_value: Any | None = ..., no_encode: Any | None = ...): ... +def extended_request_to_dict(request): ... +def extended_response_to_dict(response): ... +def intermediate_response_to_dict(response): ... +def extended_response_to_dict_fast(response): ... +def intermediate_response_to_dict_fast(response): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/modify.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/modify.pyi new file mode 100644 index 000000000..8700499b9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/modify.pyi @@ -0,0 +1,9 @@ +from typing import Any + +change_table: Any + +def modify_operation( + dn, changes, auto_encode, schema: Any | None = ..., validator: Any | None = ..., check_names: bool = ... +): ... +def modify_request_to_dict(request): ... +def modify_response_to_dict(response): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/modifyDn.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/modifyDn.pyi new file mode 100644 index 000000000..db754b8fa --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/modifyDn.pyi @@ -0,0 +1,5 @@ +from typing import Any + +def modify_dn_operation(dn, new_relative_dn, delete_old_rdn: bool = ..., new_superior: Any | None = ...): ... +def modify_dn_request_to_dict(request): ... +def modify_dn_response_to_dict(response): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/search.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/search.pyi new file mode 100644 index 000000000..78a728ed4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/search.pyi @@ -0,0 +1,63 @@ +from typing import Any + +ROOT: int +AND: int +OR: int +NOT: int +MATCH_APPROX: int +MATCH_GREATER_OR_EQUAL: int +MATCH_LESS_OR_EQUAL: int +MATCH_EXTENSIBLE: int +MATCH_PRESENT: int +MATCH_SUBSTRING: int +MATCH_EQUAL: int +SEARCH_OPEN: int +SEARCH_OPEN_OR_CLOSE: int +SEARCH_MATCH_OR_CLOSE: int +SEARCH_MATCH_OR_CONTROL: int + +class FilterNode: + tag: Any + parent: Any + assertion: Any + elements: Any + def __init__(self, tag: Any | None = ..., assertion: Any | None = ...) -> None: ... + def append(self, filter_node): ... + +def evaluate_match(match, schema, auto_escape, auto_encode, validator, check_names): ... +def parse_filter(search_filter, schema, auto_escape, auto_encode, validator, check_names): ... +def compile_filter(filter_node): ... +def build_attribute_selection(attribute_list, schema): ... +def search_operation( + search_base, + search_filter, + search_scope, + dereference_aliases, + attributes, + size_limit, + time_limit, + types_only, + auto_escape, + auto_encode, + schema: Any | None = ..., + validator: Any | None = ..., + check_names: bool = ..., +): ... +def decode_vals(vals): ... +def decode_vals_fast(vals): ... +def attributes_to_dict(attribute_list): ... +def attributes_to_dict_fast(attribute_list): ... +def decode_raw_vals(vals): ... +def decode_raw_vals_fast(vals): ... +def raw_attributes_to_dict(attribute_list): ... +def raw_attributes_to_dict_fast(attribute_list): ... +def checked_attributes_to_dict(attribute_list, schema: Any | None = ..., custom_formatter: Any | None = ...): ... +def checked_attributes_to_dict_fast(attribute_list, schema: Any | None = ..., custom_formatter: Any | None = ...): ... +def matching_rule_assertion_to_string(matching_rule_assertion): ... +def filter_to_string(filter_object): ... +def search_request_to_dict(request): ... +def search_result_entry_response_to_dict(response, schema, custom_formatter, check_names): ... +def search_result_done_response_to_dict(response): ... +def search_result_reference_response_to_dict(response): ... +def search_result_entry_response_to_dict_fast(response, schema, custom_formatter, check_names): ... +def search_result_reference_response_to_dict_fast(response): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/unbind.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/unbind.pyi new file mode 100644 index 000000000..0c66a79d6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/operation/unbind.pyi @@ -0,0 +1 @@ +def unbind_operation(): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/controls.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/controls.pyi new file mode 100644 index 000000000..7c67b9f3c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/controls.pyi @@ -0,0 +1 @@ +def build_control(oid, criticality, value, encode_control_value: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/convert.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/convert.pyi new file mode 100644 index 000000000..4bf4baf99 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/convert.pyi @@ -0,0 +1,22 @@ +from typing import Any + +def to_str_or_normalized_unicode(val): ... +def attribute_to_dict(attribute): ... +def attributes_to_dict(attributes): ... +def referrals_to_list(referrals): ... +def search_refs_to_list(search_refs): ... +def search_refs_to_list_fast(search_refs): ... +def sasl_to_dict(sasl): ... +def authentication_choice_to_dict(authentication_choice): ... +def partial_attribute_to_dict(modification): ... +def change_to_dict(change): ... +def changes_to_list(changes): ... +def attributes_to_list(attributes): ... +def ava_to_dict(ava): ... +def substring_to_dict(substring): ... +def prepare_changes_for_request(changes): ... +def build_controls_list(controls): ... +def validate_assertion_value(schema, name, value, auto_escape, auto_encode, validator, check_names): ... +def validate_attribute_value(schema, name, value, auto_encode, validator: Any | None = ..., check_names: bool = ...): ... +def prepare_filter_for_sending(raw_string): ... +def prepare_for_sending(raw_string): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/formatters/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/formatters/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/formatters/formatters.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/formatters/formatters.pyi new file mode 100644 index 000000000..69c4e1aea --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/formatters/formatters.pyi @@ -0,0 +1,16 @@ +from typing import Any + +def format_unicode(raw_value): ... +def format_integer(raw_value): ... +def format_binary(raw_value): ... +def format_uuid(raw_value): ... +def format_uuid_le(raw_value): ... +def format_boolean(raw_value): ... +def format_ad_timestamp(raw_value): ... + +time_format: Any + +def format_time(raw_value): ... +def format_ad_timedelta(raw_value): ... +def format_time_with_0_year(raw_value): ... +def format_sid(raw_value): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/formatters/standard.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/formatters/standard.pyi new file mode 100644 index 000000000..f85dd6485 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/formatters/standard.pyi @@ -0,0 +1,7 @@ +from typing import Any + +standard_formatter: Any + +def find_attribute_helpers(attr_type, name, custom_formatter): ... +def format_attribute_values(schema, name, values, custom_formatter): ... +def find_attribute_validator(schema, name, custom_validator): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/formatters/validators.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/formatters/validators.pyi new file mode 100644 index 000000000..b49eee626 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/formatters/validators.pyi @@ -0,0 +1,16 @@ +def check_backslash(value): ... +def check_type(input_value, value_type): ... +def always_valid(input_value): ... +def validate_generic_single_value(input_value): ... +def validate_zero_and_minus_one_and_positive_int(input_value): ... +def validate_integer(input_value): ... +def validate_bytes(input_value): ... +def validate_boolean(input_value): ... +def validate_time_with_0_year(input_value): ... +def validate_time(input_value): ... +def validate_ad_timestamp(input_value): ... +def validate_ad_timedelta(input_value): ... +def validate_guid(input_value): ... +def validate_uuid(input_value): ... +def validate_uuid_le(input_value): ... +def validate_sid(input_value): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/microsoft.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/microsoft.pyi new file mode 100644 index 000000000..204a718e3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/microsoft.pyi @@ -0,0 +1,27 @@ +from typing import Any + +# Enable when pyasn1 gets stubs: +# from pyasn1.type.univ import Sequence +Sequence = Any + +class SicilyBindResponse(Sequence): + tagSet: Any + componentType: Any + +class DirSyncControlRequestValue(Sequence): + componentType: Any + +class DirSyncControlResponseValue(Sequence): + componentType: Any + +class SdFlags(Sequence): + componentType: Any + +class ExtendedDN(Sequence): + componentType: Any + +def dir_sync_control(criticality, object_security, ancestors_first, public_data_only, incremental_values, max_length, cookie): ... +def extended_dn_control(criticality: bool = ..., hex_format: bool = ...): ... +def show_deleted_control(criticality: bool = ...): ... +def security_descriptor_control(criticality: bool = ..., sdflags: int = ...): ... +def persistent_search_control(criticality: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/novell.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/novell.pyi new file mode 100644 index 000000000..8ced7089e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/novell.pyi @@ -0,0 +1,72 @@ +from typing import Any + +# Enable when pyasn1 gets stubs: +# from pyasn1.type.univ import Integer, OctetString, Sequence, SequenceOf +Integer = Any +OctetString = Any +Sequence = Any +SequenceOf = Any + +NMAS_LDAP_EXT_VERSION: int + +class Identity(OctetString): + encoding: str + +class LDAPDN(OctetString): + tagSet: Any + encoding: str + +class Password(OctetString): + tagSet: Any + encoding: str + +class LDAPOID(OctetString): + tagSet: Any + encoding: str + +class GroupCookie(Integer): + tagSet: Any + +class NmasVer(Integer): + tagSet: Any + +class Error(Integer): + tagSet: Any + +class NmasGetUniversalPasswordRequestValue(Sequence): + componentType: Any + +class NmasGetUniversalPasswordResponseValue(Sequence): + componentType: Any + +class NmasSetUniversalPasswordRequestValue(Sequence): + componentType: Any + +class NmasSetUniversalPasswordResponseValue(Sequence): + componentType: Any + +class ReplicaList(SequenceOf): + componentType: Any + +class ReplicaInfoRequestValue(Sequence): + tagSet: Any + componentType: Any + +class ReplicaInfoResponseValue(Sequence): + tagSet: Any + componentType: Any + +class CreateGroupTypeRequestValue(Sequence): + componentType: Any + +class CreateGroupTypeResponseValue(Sequence): + componentType: Any + +class EndGroupTypeRequestValue(Sequence): + componentType: Any + +class EndGroupTypeResponseValue(Sequence): + componentType: Any + +class GroupingControlValue(Sequence): + componentType: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/oid.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/oid.pyi new file mode 100644 index 000000000..77efddad2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/oid.pyi @@ -0,0 +1,29 @@ +from typing import Any + +OID_CONTROL: str +OID_EXTENSION: str +OID_FEATURE: str +OID_UNSOLICITED_NOTICE: str +OID_ATTRIBUTE_TYPE: str +OID_DIT_CONTENT_RULE: str +OID_LDAP_URL_EXTENSION: str +OID_FAMILY: str +OID_MATCHING_RULE: str +OID_NAME_FORM: str +OID_OBJECT_CLASS: str +OID_ADMINISTRATIVE_ROLE: str +OID_LDAP_SYNTAX: str +CLASS_STRUCTURAL: str +CLASS_ABSTRACT: str +CLASS_AUXILIARY: str +ATTRIBUTE_USER_APPLICATION: str +ATTRIBUTE_DIRECTORY_OPERATION: str +ATTRIBUTE_DISTRIBUTED_OPERATION: str +ATTRIBUTE_DSA_OPERATION: str + +def constant_to_oid_kind(oid_kind): ... +def decode_oids(sequence): ... +def decode_syntax(syntax): ... +def oid_to_string(oid): ... + +Oids: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/persistentSearch.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/persistentSearch.pyi new file mode 100644 index 000000000..933ae390b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/persistentSearch.pyi @@ -0,0 +1,17 @@ +from typing import Any + +# Enable when pyasn1 gets stubs: +# from pyasn1.type.univ import Enumerated, Sequence +Enumerated = Any +Sequence = Any + +class PersistentSearchControl(Sequence): + componentType: Any + +class ChangeType(Enumerated): + namedValues: Any + +class EntryChangeNotificationControl(Sequence): + componentType: Any + +def persistent_search_control(change_types, changes_only: bool = ..., return_ecs: bool = ..., criticality: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc2696.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc2696.pyi new file mode 100644 index 000000000..8cb346f03 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc2696.pyi @@ -0,0 +1,21 @@ +from typing import Any + +# Enable when pyasn1 gets stubs: +# from pyasn1.type.univ import Integer, OctetString, Sequence +Integer = Any +OctetString = Any +Sequence = Any + +MAXINT: Any +rangeInt0ToMaxConstraint: Any + +class Integer0ToMax(Integer): + subtypeSpec: Any + +class Size(Integer0ToMax): ... +class Cookie(OctetString): ... + +class RealSearchControlValue(Sequence): + componentType: Any + +def paged_search_control(criticality: bool = ..., size: int = ..., cookie: Any | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc2849.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc2849.pyi new file mode 100644 index 000000000..b589bc57c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc2849.pyi @@ -0,0 +1,18 @@ +from typing import Any + +conf_ldif_line_length: Any + +def safe_ldif_string(bytes_value): ... +def add_controls(controls, all_base64): ... +def add_attributes(attributes, all_base64): ... +def sort_ldif_lines(lines, sort_order): ... +def search_response_to_ldif(entries, all_base64, sort_order: Any | None = ...): ... +def add_request_to_ldif(entry, all_base64, sort_order: Any | None = ...): ... +def delete_request_to_ldif(entry, all_base64, sort_order: Any | None = ...): ... +def modify_request_to_ldif(entry, all_base64, sort_order: Any | None = ...): ... +def modify_dn_request_to_ldif(entry, all_base64, sort_order: Any | None = ...): ... +def operation_to_ldif(operation_type, entries, all_base64: bool = ..., sort_order: Any | None = ...): ... +def add_ldif_header(ldif_lines): ... +def ldif_sort(line, sort_order): ... +def decode_persistent_search_control(change): ... +def persistent_search_response_to_ldif(change): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc3062.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc3062.pyi new file mode 100644 index 000000000..c508ccbbf --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc3062.pyi @@ -0,0 +1,28 @@ +from typing import Any + +# Enable when pyasn1 gets stubs: +# from pyasn1.type.univ import OctetString, Sequence +OctetString = Any +Sequence = Any + +class UserIdentity(OctetString): + tagSet: Any + encoding: str + +class OldPasswd(OctetString): + tagSet: Any + encoding: str + +class NewPasswd(OctetString): + tagSet: Any + encoding: str + +class GenPasswd(OctetString): + tagSet: Any + encoding: str + +class PasswdModifyRequestValue(Sequence): + componentType: Any + +class PasswdModifyResponseValue(Sequence): + componentType: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc4511.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc4511.pyi new file mode 100644 index 000000000..070910ae3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc4511.pyi @@ -0,0 +1,323 @@ +from typing import Any as _Any + +# Enable when pyasn1 gets stubs: +# from pyasn1.type.univ import Boolean, Choice, Enumerated, Integer, Null, OctetString, Sequence, SequenceOf, SetOf +Boolean = _Any +Choice = _Any +Enumerated = _Any +Integer = _Any +Null = _Any +OctetString = _Any +Sequence = _Any +SequenceOf = _Any +SetOf = _Any + +LDAP_MAX_INT: int +MAXINT: _Any +rangeInt0ToMaxConstraint: _Any +rangeInt1To127Constraint: _Any +size1ToMaxConstraint: _Any +responseValueConstraint: _Any +numericOIDConstraint: _Any +distinguishedNameConstraint: _Any +nameComponentConstraint: _Any +attributeDescriptionConstraint: _Any +uriConstraint: _Any +attributeSelectorConstraint: _Any + +class Integer0ToMax(Integer): + subtypeSpec: _Any + +class LDAPString(OctetString): + encoding: str + +class MessageID(Integer0ToMax): ... +class LDAPOID(OctetString): ... +class LDAPDN(LDAPString): ... +class RelativeLDAPDN(LDAPString): ... +class AttributeDescription(LDAPString): ... + +class AttributeValue(OctetString): + encoding: str + +class AssertionValue(OctetString): + encoding: str + +class AttributeValueAssertion(Sequence): + componentType: _Any + +class MatchingRuleId(LDAPString): ... + +class Vals(SetOf): + componentType: _Any + +class ValsAtLeast1(SetOf): + componentType: _Any + subtypeSpec: _Any + +class PartialAttribute(Sequence): + componentType: _Any + +class Attribute(Sequence): + componentType: _Any + +class AttributeList(SequenceOf): + componentType: _Any + +class Simple(OctetString): + tagSet: _Any + encoding: str + +class Credentials(OctetString): + encoding: str + +class SaslCredentials(Sequence): + tagSet: _Any + componentType: _Any + +class SicilyPackageDiscovery(OctetString): + tagSet: _Any + encoding: str + +class SicilyNegotiate(OctetString): + tagSet: _Any + encoding: str + +class SicilyResponse(OctetString): + tagSet: _Any + encoding: str + +class AuthenticationChoice(Choice): + componentType: _Any + +class Version(Integer): + subtypeSpec: _Any + +class ResultCode(Enumerated): + namedValues: _Any + subTypeSpec: _Any + +class URI(LDAPString): ... + +class Referral(SequenceOf): + tagSet: _Any + componentType: _Any + +class ServerSaslCreds(OctetString): + tagSet: _Any + encoding: str + +class LDAPResult(Sequence): + componentType: _Any + +class Criticality(Boolean): + defaultValue: bool + +class ControlValue(OctetString): + encoding: str + +class Control(Sequence): + componentType: _Any + +class Controls(SequenceOf): + tagSet: _Any + componentType: _Any + +class Scope(Enumerated): + namedValues: _Any + +class DerefAliases(Enumerated): + namedValues: _Any + +class TypesOnly(Boolean): ... +class Selector(LDAPString): ... + +class AttributeSelection(SequenceOf): + componentType: _Any + +class MatchingRule(MatchingRuleId): + tagSet: _Any + +class Type(AttributeDescription): + tagSet: _Any + +class MatchValue(AssertionValue): + tagSet: _Any + +class DnAttributes(Boolean): + tagSet: _Any + defaultValue: _Any + +class MatchingRuleAssertion(Sequence): + componentType: _Any + +class Initial(AssertionValue): + tagSet: _Any + +class Any(AssertionValue): + tagSet: _Any + +class Final(AssertionValue): + tagSet: _Any + +class Substring(Choice): + componentType: _Any + +class Substrings(SequenceOf): + subtypeSpec: _Any + componentType: _Any + +class SubstringFilter(Sequence): + tagSet: _Any + componentType: _Any + +class And(SetOf): + tagSet: _Any + subtypeSpec: _Any + +class Or(SetOf): + tagSet: _Any + subtypeSpec: _Any + +class Not(Choice): ... + +class EqualityMatch(AttributeValueAssertion): + tagSet: _Any + +class GreaterOrEqual(AttributeValueAssertion): + tagSet: _Any + +class LessOrEqual(AttributeValueAssertion): + tagSet: _Any + +class Present(AttributeDescription): + tagSet: _Any + +class ApproxMatch(AttributeValueAssertion): + tagSet: _Any + +class ExtensibleMatch(MatchingRuleAssertion): + tagSet: _Any + +class Filter(Choice): + componentType: _Any + +class PartialAttributeList(SequenceOf): + componentType: _Any + +class Operation(Enumerated): + namedValues: _Any + +class Change(Sequence): + componentType: _Any + +class Changes(SequenceOf): + componentType: _Any + +class DeleteOldRDN(Boolean): ... + +class NewSuperior(LDAPDN): + tagSet: _Any + +class RequestName(LDAPOID): + tagSet: _Any + +class RequestValue(OctetString): + tagSet: _Any + encoding: str + +class ResponseName(LDAPOID): + tagSet: _Any + +class ResponseValue(OctetString): + tagSet: _Any + encoding: str + +class IntermediateResponseName(LDAPOID): + tagSet: _Any + +class IntermediateResponseValue(OctetString): + tagSet: _Any + encoding: str + +class BindRequest(Sequence): + tagSet: _Any + componentType: _Any + +class BindResponse(Sequence): + tagSet: _Any + componentType: _Any + +class UnbindRequest(Null): + tagSet: _Any + +class SearchRequest(Sequence): + tagSet: _Any + componentType: _Any + +class SearchResultReference(SequenceOf): + tagSet: _Any + subtypeSpec: _Any + componentType: _Any + +class SearchResultEntry(Sequence): + tagSet: _Any + componentType: _Any + +class SearchResultDone(LDAPResult): + tagSet: _Any + +class ModifyRequest(Sequence): + tagSet: _Any + componentType: _Any + +class ModifyResponse(LDAPResult): + tagSet: _Any + +class AddRequest(Sequence): + tagSet: _Any + componentType: _Any + +class AddResponse(LDAPResult): + tagSet: _Any + +class DelRequest(LDAPDN): + tagSet: _Any + +class DelResponse(LDAPResult): + tagSet: _Any + +class ModifyDNRequest(Sequence): + tagSet: _Any + componentType: _Any + +class ModifyDNResponse(LDAPResult): + tagSet: _Any + +class CompareRequest(Sequence): + tagSet: _Any + componentType: _Any + +class CompareResponse(LDAPResult): + tagSet: _Any + +class AbandonRequest(MessageID): + tagSet: _Any + +class ExtendedRequest(Sequence): + tagSet: _Any + componentType: _Any + +class ExtendedResponse(Sequence): + tagSet: _Any + componentType: _Any + +class IntermediateResponse(Sequence): + tagSet: _Any + componentType: _Any + +class ProtocolOp(Choice): + componentType: _Any + +class LDAPMessage(Sequence): + componentType: _Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc4512.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc4512.pyi new file mode 100644 index 000000000..816dfeb2d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc4512.pyi @@ -0,0 +1,218 @@ +from typing import Any + +def constant_to_class_kind(value): ... +def constant_to_attribute_usage(value): ... +def attribute_usage_to_constant(value): ... +def quoted_string_to_list(quoted_string): ... +def oids_string_to_list(oid_string): ... +def extension_to_tuple(extension_string): ... +def list_to_string(list_object): ... + +class BaseServerInfo: + raw: Any + def __init__(self, raw_attributes) -> None: ... + @classmethod + def from_json(cls, json_definition, schema: Any | None = ..., custom_formatter: Any | None = ...): ... + @classmethod + def from_file(cls, target, schema: Any | None = ..., custom_formatter: Any | None = ...): ... + def to_file(self, target, indent: int = ..., sort: bool = ...) -> None: ... + def to_json(self, indent: int = ..., sort: bool = ...): ... + +class DsaInfo(BaseServerInfo): + alt_servers: Any + naming_contexts: Any + supported_controls: Any + supported_extensions: Any + supported_features: Any + supported_ldap_versions: Any + supported_sasl_mechanisms: Any + vendor_name: Any + vendor_version: Any + schema_entry: Any + other: Any + def __init__(self, attributes, raw_attributes) -> None: ... + +class SchemaInfo(BaseServerInfo): + schema_entry: Any + create_time_stamp: Any + modify_time_stamp: Any + attribute_types: Any + object_classes: Any + matching_rules: Any + matching_rule_uses: Any + dit_content_rules: Any + dit_structure_rules: Any + name_forms: Any + ldap_syntaxes: Any + other: Any + def __init__(self, schema_entry, attributes, raw_attributes) -> None: ... + def is_valid(self): ... + +class BaseObjectInfo: + oid: Any + name: Any + description: Any + obsolete: Any + extensions: Any + experimental: Any + raw_definition: Any + def __init__( + self, + oid: Any | None = ..., + name: Any | None = ..., + description: Any | None = ..., + obsolete: bool = ..., + extensions: Any | None = ..., + experimental: Any | None = ..., + definition: Any | None = ..., + ) -> None: ... + @property + def oid_info(self): ... + @classmethod + def from_definition(cls, definitions): ... + +class MatchingRuleInfo(BaseObjectInfo): + syntax: Any + def __init__( + self, + oid: Any | None = ..., + name: Any | None = ..., + description: Any | None = ..., + obsolete: bool = ..., + syntax: Any | None = ..., + extensions: Any | None = ..., + experimental: Any | None = ..., + definition: Any | None = ..., + ) -> None: ... + +class MatchingRuleUseInfo(BaseObjectInfo): + apply_to: Any + def __init__( + self, + oid: Any | None = ..., + name: Any | None = ..., + description: Any | None = ..., + obsolete: bool = ..., + apply_to: Any | None = ..., + extensions: Any | None = ..., + experimental: Any | None = ..., + definition: Any | None = ..., + ) -> None: ... + +class ObjectClassInfo(BaseObjectInfo): + superior: Any + kind: Any + must_contain: Any + may_contain: Any + def __init__( + self, + oid: Any | None = ..., + name: Any | None = ..., + description: Any | None = ..., + obsolete: bool = ..., + superior: Any | None = ..., + kind: Any | None = ..., + must_contain: Any | None = ..., + may_contain: Any | None = ..., + extensions: Any | None = ..., + experimental: Any | None = ..., + definition: Any | None = ..., + ) -> None: ... + +class AttributeTypeInfo(BaseObjectInfo): + superior: Any + equality: Any + ordering: Any + substring: Any + syntax: Any + min_length: Any + single_value: Any + collective: Any + no_user_modification: Any + usage: Any + mandatory_in: Any + optional_in: Any + def __init__( + self, + oid: Any | None = ..., + name: Any | None = ..., + description: Any | None = ..., + obsolete: bool = ..., + superior: Any | None = ..., + equality: Any | None = ..., + ordering: Any | None = ..., + substring: Any | None = ..., + syntax: Any | None = ..., + min_length: Any | None = ..., + single_value: bool = ..., + collective: bool = ..., + no_user_modification: bool = ..., + usage: Any | None = ..., + extensions: Any | None = ..., + experimental: Any | None = ..., + definition: Any | None = ..., + ) -> None: ... + +class LdapSyntaxInfo(BaseObjectInfo): + def __init__( + self, + oid: Any | None = ..., + description: Any | None = ..., + extensions: Any | None = ..., + experimental: Any | None = ..., + definition: Any | None = ..., + ) -> None: ... + +class DitContentRuleInfo(BaseObjectInfo): + auxiliary_classes: Any + must_contain: Any + may_contain: Any + not_contains: Any + def __init__( + self, + oid: Any | None = ..., + name: Any | None = ..., + description: Any | None = ..., + obsolete: bool = ..., + auxiliary_classes: Any | None = ..., + must_contain: Any | None = ..., + may_contain: Any | None = ..., + not_contains: Any | None = ..., + extensions: Any | None = ..., + experimental: Any | None = ..., + definition: Any | None = ..., + ) -> None: ... + +class DitStructureRuleInfo(BaseObjectInfo): + superior: Any + name_form: Any + def __init__( + self, + oid: Any | None = ..., + name: Any | None = ..., + description: Any | None = ..., + obsolete: bool = ..., + name_form: Any | None = ..., + superior: Any | None = ..., + extensions: Any | None = ..., + experimental: Any | None = ..., + definition: Any | None = ..., + ) -> None: ... + +class NameFormInfo(BaseObjectInfo): + object_class: Any + must_contain: Any + may_contain: Any + def __init__( + self, + oid: Any | None = ..., + name: Any | None = ..., + description: Any | None = ..., + obsolete: bool = ..., + object_class: Any | None = ..., + must_contain: Any | None = ..., + may_contain: Any | None = ..., + extensions: Any | None = ..., + experimental: Any | None = ..., + definition: Any | None = ..., + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc4527.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc4527.pyi new file mode 100644 index 000000000..eacc393c4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc4527.pyi @@ -0,0 +1,2 @@ +def pre_read_control(attributes, criticality: bool = ...): ... +def post_read_control(attributes, criticality: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/sasl/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/sasl/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/sasl/digestMd5.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/sasl/digestMd5.pyi new file mode 100644 index 000000000..433416f25 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/sasl/digestMd5.pyi @@ -0,0 +1,9 @@ +STATE_KEY: int +STATE_VALUE: int + +def md5_h(value): ... +def md5_kd(k, s): ... +def md5_hex(value): ... +def md5_hmac(k, s): ... +def sasl_digest_md5(connection, controls): ... +def decode_directives(directives_string): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/sasl/external.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/sasl/external.pyi new file mode 100644 index 000000000..8403ee794 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/sasl/external.pyi @@ -0,0 +1 @@ +def sasl_external(connection, controls): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/sasl/kerberos.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/sasl/kerberos.pyi new file mode 100644 index 000000000..7a795b210 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/sasl/kerberos.pyi @@ -0,0 +1,8 @@ +posix_gssapi_unavailable: bool +windows_gssapi_unavailable: bool +NO_SECURITY_LAYER: int +INTEGRITY_PROTECTION: int +CONFIDENTIALITY_PROTECTION: int + +def get_channel_bindings(ssl_socket): ... +def sasl_gssapi(connection, controls): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/sasl/plain.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/sasl/plain.pyi new file mode 100644 index 000000000..5be879c5a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/sasl/plain.pyi @@ -0,0 +1 @@ +def sasl_plain(connection, controls): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/sasl/sasl.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/sasl/sasl.pyi new file mode 100644 index 000000000..564c26ab5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/sasl/sasl.pyi @@ -0,0 +1,5 @@ +def sasl_prep(data): ... +def validate_simple_password(password, accept_empty: bool = ...): ... +def abort_sasl_negotiation(connection, controls): ... +def send_sasl_negotiation(connection, controls, payload): ... +def random_hex_string(size): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/schemas/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/schemas/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/schemas/ad2012R2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/schemas/ad2012R2.pyi new file mode 100644 index 000000000..3f4842936 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/schemas/ad2012R2.pyi @@ -0,0 +1,2 @@ +ad_2012_r2_schema: str +ad_2012_r2_dsa_info: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/schemas/ds389.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/schemas/ds389.pyi new file mode 100644 index 000000000..4d90cdc59 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/schemas/ds389.pyi @@ -0,0 +1,2 @@ +ds389_1_3_3_schema: str +ds389_1_3_3_dsa_info: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/schemas/edir888.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/schemas/edir888.pyi new file mode 100644 index 000000000..5b982a48e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/schemas/edir888.pyi @@ -0,0 +1,2 @@ +edir_8_8_8_schema: str +edir_8_8_8_dsa_info: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/schemas/edir914.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/schemas/edir914.pyi new file mode 100644 index 000000000..d7c9cf64f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/schemas/edir914.pyi @@ -0,0 +1,2 @@ +edir_9_1_4_schema: str +edir_9_1_4_dsa_info: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/schemas/slapd24.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/schemas/slapd24.pyi new file mode 100644 index 000000000..c080d0820 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/schemas/slapd24.pyi @@ -0,0 +1,2 @@ +slapd_2_4_schema: str +slapd_2_4_dsa_info: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/asyncStream.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/asyncStream.pyi new file mode 100644 index 000000000..b0ed1b4fd --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/asyncStream.pyi @@ -0,0 +1,18 @@ +from typing import Any + +from ..strategy.asynchronous import AsyncStrategy + +class AsyncStreamStrategy(AsyncStrategy): + can_stream: bool + line_separator: Any + all_base64: bool + stream: Any + order: Any + persistent_search_message_id: Any + streaming: bool + callback: Any + events: Any + def __init__(self, ldap_connection) -> None: ... + def accumulate_stream(self, message_id, change) -> None: ... + def get_stream(self): ... + def set_stream(self, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/asynchronous.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/asynchronous.pyi new file mode 100644 index 000000000..ecc746f86 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/asynchronous.pyi @@ -0,0 +1,27 @@ +from threading import Thread +from typing import Any + +from ..strategy.base import BaseStrategy + +class AsyncStrategy(BaseStrategy): + class ReceiverSocketThread(Thread): + connection: Any + socket_size: Any + def __init__(self, ldap_connection) -> None: ... + def run(self) -> None: ... + sync: bool + no_real_dsa: bool + pooled: bool + can_stream: bool + receiver: Any + async_lock: Any + event_lock: Any + def __init__(self, ldap_connection) -> None: ... + def open(self, reset_usage: bool = ..., read_server_info: bool = ...) -> None: ... + def close(self) -> None: ... + def set_event_for_message(self, message_id) -> None: ... + def post_send_search(self, message_id): ... + def post_send_single_response(self, message_id): ... + def receiving(self) -> None: ... + def get_stream(self) -> None: ... + def set_stream(self, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/base.pyi new file mode 100644 index 000000000..4c7a07a1a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/base.pyi @@ -0,0 +1,42 @@ +from typing import Any + +unix_socket_available: bool +SESSION_TERMINATED_BY_SERVER: str +TRANSACTION_ERROR: str +RESPONSE_COMPLETE: str + +class BaseStrategy: + connection: Any + sync: Any + no_real_dsa: Any + pooled: Any + can_stream: Any + referral_cache: Any + thread_safe: bool + def __init__(self, ldap_connection) -> None: ... + def open(self, reset_usage: bool = ..., read_server_info: bool = ...) -> None: ... + def close(self) -> None: ... + def send(self, message_type, request, controls: Any | None = ...): ... + def get_response(self, message_id, timeout: Any | None = ..., get_request: bool = ...): ... + @staticmethod + def compute_ldap_message_size(data): ... + def decode_response(self, ldap_message): ... + def decode_response_fast(self, ldap_message): ... + @staticmethod + def decode_control(control): ... + @staticmethod + def decode_control_fast(control, from_server: bool = ...): ... + @staticmethod + def decode_request(message_type, component, controls: Any | None = ...): ... + def valid_referral_list(self, referrals): ... + def do_next_range_search(self, request, response, attr_name): ... + def do_search_on_auto_range(self, request, response): ... + def create_referral_connection(self, referrals): ... + def do_operation_on_referral(self, request, referrals): ... + def sending(self, ldap_message) -> None: ... + def receiving(self) -> None: ... + def post_send_single_response(self, message_id) -> None: ... + def post_send_search(self, message_id) -> None: ... + def get_stream(self) -> None: ... + def set_stream(self, value) -> None: ... + def unbind_referral_cache(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/ldifProducer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/ldifProducer.pyi new file mode 100644 index 000000000..7ac55a30b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/ldifProducer.pyi @@ -0,0 +1,21 @@ +from typing import Any + +from .base import BaseStrategy + +class LdifProducerStrategy(BaseStrategy): + sync: bool + no_real_dsa: bool + pooled: bool + can_stream: bool + line_separator: Any + all_base64: bool + stream: Any + order: Any + def __init__(self, ldap_connection) -> None: ... + def receiving(self) -> None: ... + def send(self, message_type, request, controls: Any | None = ...): ... + def post_send_single_response(self, message_id): ... + def post_send_search(self, message_id) -> None: ... + def accumulate_stream(self, fragment) -> None: ... + def get_stream(self): ... + def set_stream(self, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/mockAsync.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/mockAsync.pyi new file mode 100644 index 000000000..2acd74751 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/mockAsync.pyi @@ -0,0 +1,11 @@ +from typing import Any + +from .asynchronous import AsyncStrategy +from .mockBase import MockBaseStrategy + +class MockAsyncStrategy(MockBaseStrategy, AsyncStrategy): + def __init__(self, ldap_connection) -> None: ... + def post_send_search(self, payload): ... + bound: Any + def post_send_single_response(self, payload): ... + def get_response(self, message_id, timeout: Any | None = ..., get_request: bool = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/mockBase.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/mockBase.pyi new file mode 100644 index 000000000..c4b0c3483 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/mockBase.pyi @@ -0,0 +1,37 @@ +from typing import Any + +SEARCH_CONTROLS: Any +SERVER_ENCODING: str + +def random_cookie(): ... + +class PagedSearchSet: + size: Any + response: Any + cookie: Any + sent: int + done: bool + def __init__(self, response, size, criticality) -> None: ... + def next(self, size: Any | None = ...): ... + +class MockBaseStrategy: + entries: Any + no_real_dsa: bool + bound: Any + custom_validators: Any + operational_attributes: Any + def __init__(self) -> None: ... + def add_entry(self, dn, attributes, validate: bool = ...): ... + def remove_entry(self, dn): ... + def entries_from_json(self, json_entry_file) -> None: ... + def mock_bind(self, request_message, controls): ... + def mock_delete(self, request_message, controls): ... + def mock_add(self, request_message, controls): ... + def mock_compare(self, request_message, controls): ... + def mock_modify_dn(self, request_message, controls): ... + def mock_modify(self, request_message, controls): ... + def mock_search(self, request_message, controls): ... + def mock_extended(self, request_message, controls): ... + def evaluate_filter_node(self, node, candidates): ... + def equal(self, dn, attribute_type, value_to_check): ... + def send(self, message_type, request, controls: Any | None = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/mockSync.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/mockSync.pyi new file mode 100644 index 000000000..dcfd12d89 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/mockSync.pyi @@ -0,0 +1,10 @@ +from typing import Any + +from .mockBase import MockBaseStrategy +from .sync import SyncStrategy + +class MockSyncStrategy(MockBaseStrategy, SyncStrategy): + def __init__(self, ldap_connection) -> None: ... + def post_send_search(self, payload): ... + bound: Any + def post_send_single_response(self, payload): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/restartable.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/restartable.pyi new file mode 100644 index 000000000..d38804ee0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/restartable.pyi @@ -0,0 +1,19 @@ +from typing import Any + +from .sync import SyncStrategy + +class RestartableStrategy(SyncStrategy): + sync: bool + no_real_dsa: bool + pooled: bool + can_stream: bool + restartable_sleep_time: Any + restartable_tries: Any + exception_history: Any + def __init__(self, ldap_connection) -> None: ... + def open(self, reset_usage: bool = ..., read_server_info: bool = ...) -> None: ... + def send(self, message_type, request, controls: Any | None = ...): ... + def post_send_single_response(self, message_id): ... + def post_send_search(self, message_id): ... + def get_stream(self) -> None: ... + def set_stream(self, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/reusable.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/reusable.pyi new file mode 100644 index 000000000..cc5bfad41 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/reusable.pyi @@ -0,0 +1,71 @@ +from threading import Thread +from typing import Any + +from .base import BaseStrategy + +TERMINATE_REUSABLE: str +BOGUS_BIND: int +BOGUS_UNBIND: int +BOGUS_EXTENDED: int +BOGUS_ABANDON: int + +class ReusableStrategy(BaseStrategy): + pools: Any + def receiving(self) -> None: ... + def get_stream(self) -> None: ... + def set_stream(self, value) -> None: ... + class ConnectionPool: + def __new__(cls, connection): ... + name: Any + master_connection: Any + workers: Any + pool_size: Any + lifetime: Any + keepalive: Any + request_queue: Any + open_pool: bool + bind_pool: bool + tls_pool: bool + counter: int + terminated_usage: Any + terminated: bool + pool_lock: Any + started: bool + def __init__(self, connection) -> None: ... + def get_info_from_server(self) -> None: ... + def rebind_pool(self) -> None: ... + def start_pool(self): ... + def create_pool(self) -> None: ... + def terminate_pool(self) -> None: ... + class PooledConnectionThread(Thread): + daemon: bool + worker: Any + master_connection: Any + def __init__(self, worker, master_connection) -> None: ... + def run(self) -> None: ... + class PooledConnectionWorker: + master_connection: Any + request_queue: Any + running: bool + busy: bool + get_info_from_server: bool + connection: Any + creation_time: Any + task_counter: int + thread: Any + worker_lock: Any + def __init__(self, connection, request_queue) -> None: ... + def new_connection(self) -> None: ... + sync: bool + no_real_dsa: bool + pooled: bool + can_stream: bool + pool: Any + def __init__(self, ldap_connection) -> None: ... + def open(self, reset_usage: bool = ..., read_server_info: bool = ...) -> None: ... + def terminate(self) -> None: ... + def send(self, message_type, request, controls: Any | None = ...): ... + def validate_bind(self, controls): ... + def get_response(self, counter, timeout: Any | None = ..., get_request: bool = ...): ... + def post_send_single_response(self, counter): ... + def post_send_search(self, counter): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/safeRestartable.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/safeRestartable.pyi new file mode 100644 index 000000000..b52aa5a1b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/safeRestartable.pyi @@ -0,0 +1,5 @@ +from .restartable import RestartableStrategy + +class SafeRestartableStrategy(RestartableStrategy): + thread_safe: bool + def __init__(self, ldap_connection) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/safeSync.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/safeSync.pyi new file mode 100644 index 000000000..2b8b51390 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/safeSync.pyi @@ -0,0 +1,5 @@ +from .sync import SyncStrategy + +class SafeSyncStrategy(SyncStrategy): + thread_safe: bool + def __init__(self, ldap_connection) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/sync.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/sync.pyi new file mode 100644 index 000000000..a1a846090 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/strategy/sync.pyi @@ -0,0 +1,19 @@ +from typing import Any + +from ..strategy.base import BaseStrategy + +LDAP_MESSAGE_TEMPLATE: Any + +class SyncStrategy(BaseStrategy): + sync: bool + no_real_dsa: bool + pooled: bool + can_stream: bool + socket_size: Any + def __init__(self, ldap_connection) -> None: ... + def open(self, reset_usage: bool = ..., read_server_info: bool = ...) -> None: ... + def receiving(self): ... + def post_send_single_response(self, message_id): ... + def post_send_search(self, message_id): ... + def set_stream(self, value) -> None: ... + def get_stream(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/asn1.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/asn1.pyi new file mode 100644 index 000000000..859a9b958 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/asn1.pyi @@ -0,0 +1,37 @@ +from typing import Any + +# Enable when pyasn1 gets stubs: +# from pyasn1.codec.ber.encoder import AbstractItemEncoder, BooleanEncoder +AbstractItemEncoder = Any +BooleanEncoder = Any + +CLASSES: Any + +class LDAPBooleanEncoder(AbstractItemEncoder): + supportIndefLenMode: bool + # Requires pyasn1 > 0.3.7 + def encodeValue(self, value, asn1Spec, encodeFun, **options): ... + +customTagMap: Any +customTypeMap: Any + +def compute_ber_size(data): ... +def decode_message_fast(message): ... +def decode_sequence(message, start, stop, context_decoders: Any | None = ...): ... +def decode_integer(message, start, stop, context_decoders: Any | None = ...): ... +def decode_octet_string(message, start, stop, context_decoders: Any | None = ...): ... +def decode_boolean(message, start, stop, context_decoders: Any | None = ...): ... +def decode_bind_response(message, start, stop, context_decoders: Any | None = ...): ... +def decode_extended_response(message, start, stop, context_decoders: Any | None = ...): ... +def decode_intermediate_response(message, start, stop, context_decoders: Any | None = ...): ... +def decode_controls(message, start, stop, context_decoders: Any | None = ...): ... +def ldap_result_to_dict_fast(response): ... +def get_byte(x): ... +def get_bytes(x): ... + +DECODERS: Any +BIND_RESPONSE_CONTEXT: Any +EXTENDED_RESPONSE_CONTEXT: Any +INTERMEDIATE_RESPONSE_CONTEXT: Any +LDAP_MESSAGE_CONTEXT: Any +CONTROLS_CONTEXT: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/ciDict.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/ciDict.pyi new file mode 100644 index 000000000..2564fc656 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/ciDict.pyi @@ -0,0 +1,29 @@ +from collections.abc import MutableMapping +from typing import Any, Generic, TypeVar + +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") + +class CaseInsensitiveDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): + def __init__(self, other: Any | None = ..., **kwargs) -> None: ... + def __contains__(self, item): ... + def __delitem__(self, key) -> None: ... + def __setitem__(self, key, item) -> None: ... + def __getitem__(self, key): ... + def __iter__(self): ... + def __len__(self): ... + def keys(self): ... + def values(self): ... + def items(self): ... + def __eq__(self, other): ... + def copy(self): ... + +class CaseInsensitiveWithAliasDict(CaseInsensitiveDict[_KT, _VT], Generic[_KT, _VT]): + def __init__(self, other: Any | None = ..., **kwargs) -> None: ... + def aliases(self): ... + def __setitem__(self, key, value) -> None: ... + def __delitem__(self, key) -> None: ... + def set_alias(self, key, alias, ignore_duplicates: bool = ...) -> None: ... + def remove_alias(self, alias) -> None: ... + def __getitem__(self, key): ... + def copy(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/config.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/config.pyi new file mode 100644 index 000000000..80971d5fc --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/config.pyi @@ -0,0 +1,6 @@ +from typing import Any + +PARAMETERS: Any + +def get_config_parameter(parameter): ... +def set_config_parameter(parameter, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/conv.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/conv.pyi new file mode 100644 index 000000000..280e2085c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/conv.pyi @@ -0,0 +1,14 @@ +from typing import Any + +def to_unicode(obj: float | bytes | str, encoding: str | None = ..., from_server: bool = ...) -> str: ... +def to_raw(obj, encoding: str = ...): ... +def escape_filter_chars(text: float | bytes | str, encoding: str | None = ...) -> str: ... +def unescape_filter_chars(text, encoding: Any | None = ...): ... +def escape_bytes(bytes_value: str | bytes) -> str: ... +def prepare_for_stream(value): ... +def json_encode_b64(obj): ... +def check_json_dict(json_dict) -> None: ... +def json_hook(obj): ... +def format_json(obj, iso_format: bool = ...): ... +def is_filter_escaped(text): ... +def ldap_escape_to_bytes(text): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/dn.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/dn.pyi new file mode 100644 index 000000000..dab0cdffd --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/dn.pyi @@ -0,0 +1,11 @@ +STATE_ANY: int +STATE_ESCAPE: int +STATE_ESCAPE_HEX: int + +def to_dn( + iterator, decompose: bool = ..., remove_space: bool = ..., space_around_equal: bool = ..., separate_rdn: bool = ... +): ... +def parse_dn(dn, escape: bool = ..., strip: bool = ...): ... +def safe_dn(dn, decompose: bool = ..., reverse: bool = ...): ... +def safe_rdn(dn, decompose: bool = ...): ... +def escape_rdn(rdn: str) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/hashed.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/hashed.pyi new file mode 100644 index 000000000..74734cc63 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/hashed.pyi @@ -0,0 +1,6 @@ +from typing import Any + +algorithms_table: Any +salted_table: Any + +def hashed(algorithm, value, salt: Any | None = ..., raw: bool = ..., encoding: str = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/log.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/log.pyi new file mode 100644 index 000000000..a5c47f7bd --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/log.pyi @@ -0,0 +1,25 @@ +from logging import NullHandler as NullHandler +from typing import Any + +OFF: int +ERROR: int +BASIC: int +PROTOCOL: int +NETWORK: int +EXTENDED: int +DETAIL_LEVELS: Any + +def get_detail_level_name(level_name): ... +def log(detail, message, *args) -> None: ... +def log_enabled(detail): ... +def set_library_log_hide_sensitive_data(hide: bool = ...) -> None: ... +def get_library_log_hide_sensitive_data(): ... +def set_library_log_activation_level(logging_level) -> None: ... +def get_library_log_activation_lavel(): ... +def set_library_log_max_line_length(length) -> None: ... +def get_library_log_max_line_length(): ... +def set_library_log_detail_level(detail) -> None: ... +def get_library_log_detail_level(): ... +def format_ldap_message(message, prefix): ... + +logger: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/ntlm.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/ntlm.pyi new file mode 100644 index 000000000..6e122f3a7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/ntlm.pyi @@ -0,0 +1,117 @@ +from typing import Any + +oem_encoding: Any +NTLM_SIGNATURE: bytes +NTLM_MESSAGE_TYPE_NTLM_NEGOTIATE: int +NTLM_MESSAGE_TYPE_NTLM_CHALLENGE: int +NTLM_MESSAGE_TYPE_NTLM_AUTHENTICATE: int +FLAG_NEGOTIATE_56: int +FLAG_NEGOTIATE_KEY_EXCH: int +FLAG_NEGOTIATE_128: int +FLAG_NEGOTIATE_VERSION: int +FLAG_NEGOTIATE_TARGET_INFO: int +FLAG_REQUEST_NOT_NT_SESSION_KEY: int +FLAG_NEGOTIATE_IDENTIFY: int +FLAG_NEGOTIATE_EXTENDED_SESSIONSECURITY: int +FLAG_TARGET_TYPE_SERVER: int +FLAG_TARGET_TYPE_DOMAIN: int +FLAG_NEGOTIATE_ALWAYS_SIGN: int +FLAG_NEGOTIATE_OEM_WORKSTATION_SUPPLIED: int +FLAG_NEGOTIATE_OEM_DOMAIN_SUPPLIED: int +FLAG_NEGOTIATE_ANONYMOUS: int +FLAG_NEGOTIATE_NTLM: int +FLAG_NEGOTIATE_LM_KEY: int +FLAG_NEGOTIATE_DATAGRAM: int +FLAG_NEGOTIATE_SEAL: int +FLAG_NEGOTIATE_SIGN: int +FLAG_REQUEST_TARGET: int +FLAG_NEGOTIATE_OEM: int +FLAG_NEGOTIATE_UNICODE: int +FLAG_TYPES: Any +AV_END_OF_LIST: int +AV_NETBIOS_COMPUTER_NAME: int +AV_NETBIOS_DOMAIN_NAME: int +AV_DNS_COMPUTER_NAME: int +AV_DNS_DOMAIN_NAME: int +AV_DNS_TREE_NAME: int +AV_FLAGS: int +AV_TIMESTAMP: int +AV_SINGLE_HOST_DATA: int +AV_TARGET_NAME: int +AV_CHANNEL_BINDINGS: int +AV_TYPES: Any +AV_FLAG_CONSTRAINED: int +AV_FLAG_INTEGRITY: int +AV_FLAG_TARGET_SPN_UNTRUSTED: int +AV_FLAG_TYPES: Any + +def pack_windows_version(debug: bool = ...): ... +def unpack_windows_version(version_message): ... + +class NtlmClient: + client_config_flags: int + exported_session_key: Any + negotiated_flags: Any + user_name: Any + user_domain: Any + no_lm_response_ntlm_v1: Any + client_blocked: bool + client_block_exceptions: Any + client_require_128_bit_encryption: Any + max_life_time: Any + client_signing_key: Any + client_sealing_key: Any + sequence_number: Any + server_sealing_key: Any + server_signing_key: Any + integrity: bool + replay_detect: bool + sequence_detect: bool + confidentiality: bool + datagram: bool + identity: bool + client_supplied_target_name: Any + client_channel_binding_unhashed: Any + unverified_target_name: Any + server_challenge: Any + server_target_name: Any + server_target_info: Any + server_version: Any + server_av_netbios_computer_name: Any + server_av_netbios_domain_name: Any + server_av_dns_computer_name: Any + server_av_dns_domain_name: Any + server_av_dns_forest_name: Any + server_av_target_name: Any + server_av_flags: Any + server_av_timestamp: Any + server_av_single_host_data: Any + server_av_channel_bindings: Any + server_av_flag_constrained: Any + server_av_flag_integrity: Any + server_av_flag_target_spn_untrusted: Any + current_encoding: Any + client_challenge: Any + server_target_info_raw: Any + def __init__(self, domain, user_name, password) -> None: ... + def get_client_flag(self, flag): ... + def get_negotiated_flag(self, flag): ... + def get_server_av_flag(self, flag): ... + def set_client_flag(self, flags) -> None: ... + def reset_client_flags(self) -> None: ... + def unset_client_flag(self, flags) -> None: ... + def create_negotiate_message(self): ... + def parse_challenge_message(self, message): ... + def create_authenticate_message(self): ... + @staticmethod + def pack_field(value, offset): ... + @staticmethod + def unpack_field(field_message): ... + @staticmethod + def unpack_av_info(info): ... + @staticmethod + def pack_av_info(avs): ... + @staticmethod + def pack_windows_timestamp(): ... + def compute_nt_response(self): ... + def ntowf_v2(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/port_validators.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/port_validators.pyi new file mode 100644 index 000000000..c120f02b8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/port_validators.pyi @@ -0,0 +1,2 @@ +def check_port(port): ... +def check_port_and_port_list(port, port_list): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/repr.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/repr.pyi new file mode 100644 index 000000000..f2c58e20e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/repr.pyi @@ -0,0 +1,5 @@ +from typing import Any + +repr_encoding: Any + +def to_stdout_encoding(value): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/tls_backport.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/tls_backport.pyi new file mode 100644 index 000000000..c21998013 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/tls_backport.pyi @@ -0,0 +1,3 @@ +class CertificateError(ValueError): ... + +def match_hostname(cert, hostname): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/uri.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/uri.pyi new file mode 100644 index 000000000..45ea8bb76 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/utils/uri.pyi @@ -0,0 +1 @@ +def parse_uri(uri): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/version.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/version.pyi new file mode 100644 index 000000000..50be840c1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/version.pyi @@ -0,0 +1,3 @@ +__url__: str +__description__: str +__status__: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/mypy-extensions/mypy_extensions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/mypy-extensions/mypy_extensions.pyi index fc6de37d0..dd182c485 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/mypy-extensions/mypy_extensions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/mypy-extensions/mypy_extensions.pyi @@ -1,6 +1,6 @@ import abc import sys -from typing import Any, Callable, Generic, ItemsView, KeysView, Mapping, Type, TypeVar, Union, ValuesView +from typing import Any, Callable, Generic, ItemsView, KeysView, Mapping, Type, TypeVar, ValuesView _T = TypeVar("_T") _U = TypeVar("_U") @@ -34,9 +34,8 @@ def VarArg(type: _T = ...) -> _T: ... def KwArg(type: _T = ...) -> _T: ... # Return type that indicates a function does not return. -# This type is equivalent to the None type, but the no-op Union is necessary to -# distinguish the None type from the None value. -NoReturn = Union[None] # Deprecated: Use typing.NoReturn instead. +# Deprecated: Use typing.NoReturn instead. +class NoReturn: ... # This is intended as a class decorator, but mypy rejects abstract classes # when a Type[_T] is expected, so we can't give it the type we want diff --git a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/binary_propagator.pyi b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/binary_propagator.pyi index 59c037626..33f94f4b7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/binary_propagator.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/binary_propagator.pyi @@ -1,6 +1,6 @@ from typing import Any -from ..span import SpanContext +from .context import SpanContext from .propagator import Propagator class BinaryPropagator(Propagator): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/context.pyi b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/context.pyi index b16fb47e1..ef8ed9214 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/context.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/context.pyi @@ -1,3 +1,5 @@ +from _typeshed import Self + import opentracing class SpanContext(opentracing.SpanContext): @@ -6,4 +8,4 @@ class SpanContext(opentracing.SpanContext): def __init__(self, trace_id: int | None = ..., span_id: int | None = ..., baggage: dict[str, str] | None = ...) -> None: ... @property def baggage(self) -> dict[str, str]: ... - def with_baggage_item(self, key: str, value: str) -> SpanContext: ... + def with_baggage_item(self: Self, key: str, value: str) -> Self: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/propagator.pyi b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/propagator.pyi index 8f5cdeaf6..0a2ffb446 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/propagator.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/propagator.pyi @@ -1,6 +1,6 @@ from typing import Any -from ..span import SpanContext +from .context import SpanContext class Propagator: def inject(self, span_context: SpanContext, carrier: dict[Any, Any]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/span.pyi b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/span.pyi index 64d6b1531..da419aa7a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/span.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/span.pyi @@ -1,7 +1,10 @@ +from _typeshed import Self from typing import Any -from ..span import Span, SpanContext +from ..span import Span from ..tracer import Tracer +from .context import SpanContext +from .tracer import MockTracer class MockSpan(Span): operation_name: str | None @@ -20,12 +23,14 @@ class MockSpan(Span): tags: dict[str, Any] | None = ..., start_time: float | None = ..., ) -> None: ... - def set_operation_name(self, operation_name: str) -> Span: ... - def set_tag(self, key: str, value: str | bool | int | float) -> Span: ... - def log_kv(self, key_values: dict[str, Any], timestamp: float | None = ...) -> Span: ... - def finish(self, finish_time: float | None = ...) -> None: ... - def set_baggage_item(self, key: str, value: str) -> Span: ... - def get_baggage_item(self, key: str) -> str | None: ... + @property + def tracer(self) -> MockTracer: ... + @property + def context(self) -> SpanContext: ... + def set_operation_name(self: Self, operation_name: str) -> Self: ... + def set_tag(self: Self, key: str, value: str | bool | int | float) -> Self: ... + def log_kv(self: Self, key_values: dict[str, Any], timestamp: float | None = ...) -> Self: ... + def set_baggage_item(self: Self, key: str, value: str) -> Self: ... class LogData: key_values: dict[str, Any] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/text_propagator.pyi b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/text_propagator.pyi index 946661d2d..d828fe2f9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/text_propagator.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/text_propagator.pyi @@ -1,6 +1,6 @@ from typing import Any -from ..span import SpanContext +from .context import SpanContext from .propagator import Propagator prefix_tracer_state: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/tracer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/tracer.pyi index 8baf0d497..9336c1a05 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/tracer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/mocktracer/tracer.pyi @@ -1,10 +1,26 @@ +from typing import Any + from ..scope_manager import ScopeManager from ..span import Span -from ..tracer import Tracer +from ..tracer import Reference, Tracer +from .context import SpanContext from .propagator import Propagator +from .span import MockSpan class MockTracer(Tracer): def __init__(self, scope_manager: ScopeManager | None = ...) -> None: ... + @property + def active_span(self) -> MockSpan | None: ... def register_propagator(self, format: str, propagator: Propagator) -> None: ... - def finished_spans(self) -> list[Span]: ... + def finished_spans(self) -> list[MockSpan]: ... def reset(self) -> None: ... + def start_span( # type: ignore[override] + self, + operation_name: str | None = ..., + child_of: Span | SpanContext | None = ..., + references: list[Reference] | None = ..., + tags: dict[Any, Any] | None = ..., + start_time: float | None = ..., + ignore_active_span: bool = ..., + ) -> MockSpan: ... + def extract(self, format: str, carrier: dict[Any, Any]) -> SpanContext: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/span.pyi b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/span.pyi index 769060cfb..847f16bba 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/span.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/opentracing/span.pyi @@ -1,3 +1,4 @@ +from _typeshed import Self from types import TracebackType from typing import Any, Type @@ -14,15 +15,15 @@ class Span: def context(self) -> SpanContext: ... @property def tracer(self) -> Tracer: ... - def set_operation_name(self, operation_name: str) -> Span: ... + def set_operation_name(self: Self, operation_name: str) -> Self: ... def finish(self, finish_time: float | None = ...) -> None: ... - def set_tag(self, key: str, value: str | bool | int | float) -> Span: ... - def log_kv(self, key_values: dict[str, Any], timestamp: float | None = ...) -> Span: ... - def set_baggage_item(self, key: str, value: str) -> Span: ... + def set_tag(self: Self, key: str, value: str | bool | int | float) -> Self: ... + def log_kv(self: Self, key_values: dict[str, Any], timestamp: float | None = ...) -> Self: ... + def set_baggage_item(self: Self, key: str, value: str) -> Self: ... def get_baggage_item(self, key: str) -> str | None: ... - def __enter__(self) -> Span: ... + def __enter__(self: Self) -> Self: ... def __exit__( self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... - def log_event(self, event: Any, payload: Any | None = ...) -> Span: ... - def log(self, **kwargs: Any) -> Span: ... + def log_event(self: Self, event: Any, payload: Any | None = ...) -> Self: ... + def log(self: Self, **kwargs: Any) -> Self: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/channel.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/channel.pyi index 6399e4de9..1870c9e1f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/channel.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/channel.pyi @@ -41,22 +41,22 @@ class Channel(ClosingContextManager): def __init__(self, chanid: int) -> None: ... def __del__(self) -> None: ... def get_pty( - self, term: str = ..., width: int = ..., height: int = ..., width_pixels: int = ..., height_pixels: int = ... + self, term: str | bytes = ..., width: int = ..., height: int = ..., width_pixels: int = ..., height_pixels: int = ... ) -> None: ... def invoke_shell(self) -> None: ... - def exec_command(self, command: str) -> None: ... - def invoke_subsystem(self, subsystem: str) -> None: ... + def exec_command(self, command: str | bytes) -> None: ... + def invoke_subsystem(self, subsystem: str | bytes) -> None: ... def resize_pty(self, width: int = ..., height: int = ..., width_pixels: int = ..., height_pixels: int = ...) -> None: ... - def update_environment(self, environment: Mapping[str, str]) -> None: ... - def set_environment_variable(self, name: str, value: str) -> None: ... + def update_environment(self, environment: Mapping[str | bytes, str | bytes]) -> None: ... + def set_environment_variable(self, name: str | bytes, value: str | bytes) -> None: ... def exit_status_ready(self) -> bool: ... def recv_exit_status(self) -> int: ... def send_exit_status(self, status: int) -> None: ... def request_x11( self, screen_number: int = ..., - auth_protocol: str | None = ..., - auth_cookie: str | None = ..., + auth_protocol: str | bytes | None = ..., + auth_cookie: str | bytes | None = ..., single_connection: bool = ..., handler: Callable[[Channel, tuple[str, int]], None] | None = ..., ) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/hostkeys.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/hostkeys.pyi index e1a109e2d..32f05bfc0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/hostkeys.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/hostkeys.pyi @@ -37,7 +37,7 @@ class InvalidHostKey(Exception): class HostKeyEntry: valid: bool - hostnames: str + hostnames: list[str] key: PKey def __init__(self, hostnames: list[str] | None = ..., key: PKey | None = ...) -> None: ... @classmethod diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/__init__.pyi index 294c90ee5..4838e7614 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/__init__.pyi @@ -1,36 +1,37 @@ import datetime -from typing import Mapping +from typing import ClassVar, Mapping -class BaseTzInfo(datetime.tzinfo): - zone: str = ... +from .exceptions import ( + AmbiguousTimeError as AmbiguousTimeError, + InvalidTimeError as InvalidTimeError, + NonExistentTimeError as NonExistentTimeError, + UnknownTimeZoneError as UnknownTimeZoneError, +) +from .tzinfo import BaseTzInfo as BaseTzInfo, DstTzInfo, StaticTzInfo + +# Actually named UTC and then masked with a singleton with the same name +class _UTCclass(BaseTzInfo): def localize(self, dt: datetime.datetime, is_dst: bool | None = ...) -> datetime.datetime: ... def normalize(self, dt: datetime.datetime) -> datetime.datetime: ... - -class _UTCclass(BaseTzInfo): def tzname(self, dt: datetime.datetime | None) -> str: ... def utcoffset(self, dt: datetime.datetime | None) -> datetime.timedelta: ... def dst(self, dt: datetime.datetime | None) -> datetime.timedelta: ... -class _StaticTzInfo(BaseTzInfo): - def tzname(self, dt: datetime.datetime | None, is_dst: bool | None = ...) -> str: ... - def utcoffset(self, dt: datetime.datetime | None, is_dst: bool | None = ...) -> datetime.timedelta: ... - def dst(self, dt: datetime.datetime | None, is_dst: bool | None = ...) -> datetime.timedelta: ... - -class _DstTzInfo(BaseTzInfo): - def tzname(self, dt: datetime.datetime | None, is_dst: bool | None = ...) -> str: ... - def utcoffset(self, dt: datetime.datetime | None, is_dst: bool | None = ...) -> datetime.timedelta | None: ... - def dst(self, dt: datetime.datetime | None, is_dst: bool | None = ...) -> datetime.timedelta | None: ... - -class UnknownTimeZoneError(KeyError): ... -class InvalidTimeError(Exception): ... -class AmbiguousTimeError(InvalidTimeError): ... -class NonExistentTimeError(InvalidTimeError): ... - utc: _UTCclass UTC: _UTCclass -def timezone(zone: str) -> _UTCclass | _StaticTzInfo | _DstTzInfo: ... -def FixedOffset(offset: int) -> _UTCclass | datetime.tzinfo: ... +def timezone(zone: str) -> _UTCclass | StaticTzInfo | DstTzInfo: ... + +class _FixedOffset(datetime.tzinfo): + zone: ClassVar[None] + def __init__(self, minutes: int) -> None: ... + def utcoffset(self, dt: object) -> datetime.timedelta | None: ... + def dst(self, dt: object) -> datetime.timedelta: ... + def tzname(self, dt: object) -> None: ... + def localize(self, dt: datetime.datetime, is_dst: bool = ...) -> datetime.datetime: ... + def normalize(self, dt: datetime.datetime, is_dst: bool = ...) -> datetime.datetime: ... + +def FixedOffset(offset: int, _tzinfos: dict[int, _FixedOffset] = ...) -> _UTCclass | _FixedOffset: ... all_timezones: list[str] all_timezones_set: set[str] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/exceptions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/exceptions.pyi new file mode 100644 index 000000000..1880e442a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/exceptions.pyi @@ -0,0 +1,7 @@ +__all__ = ["UnknownTimeZoneError", "InvalidTimeError", "AmbiguousTimeError", "NonExistentTimeError"] + +class Error(Exception): ... +class UnknownTimeZoneError(KeyError, Error): ... +class InvalidTimeError(Error): ... +class AmbiguousTimeError(InvalidTimeError): ... +class NonExistentTimeError(InvalidTimeError): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/tzinfo.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/tzinfo.pyi new file mode 100644 index 000000000..d60864ec0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/pytz/pytz/tzinfo.pyi @@ -0,0 +1,35 @@ +import datetime +from abc import abstractmethod +from typing import Any + +class BaseTzInfo(datetime.tzinfo): + zone: str | None # Actually None but should be set on concrete subclasses + # The following abstract methods don't exist in the implementation, but + # are implemented by all sub-classes. + @abstractmethod + def localize(self, dt: datetime.datetime) -> datetime.datetime: ... + @abstractmethod + def normalize(self, dt: datetime.datetime) -> datetime.datetime: ... + @abstractmethod + def tzname(self, dt: datetime.datetime | None) -> str: ... + @abstractmethod + def utcoffset(self, dt: datetime.datetime | None) -> datetime.timedelta | None: ... + @abstractmethod + def dst(self, dt: datetime.datetime | None) -> datetime.timedelta | None: ... + +class StaticTzInfo(BaseTzInfo): + def fromutc(self, dt: datetime.datetime) -> datetime.datetime: ... + def localize(self, dt: datetime.datetime, is_dst: bool = ...) -> datetime.datetime: ... + def normalize(self, dt: datetime.datetime, is_dst: bool = ...) -> datetime.datetime: ... + def tzname(self, dt: datetime.datetime | None, is_dst: bool | None = ...) -> str: ... + def utcoffset(self, dt: datetime.datetime | None, is_dst: bool | None = ...) -> datetime.timedelta: ... + def dst(self, dt: datetime.datetime | None, is_dst: bool | None = ...) -> datetime.timedelta: ... + +class DstTzInfo(BaseTzInfo): + def __init__(self, _inf: Any = ..., _tzinfos: Any = ...) -> None: ... + def fromutc(self, dt: datetime.datetime) -> datetime.datetime: ... + def localize(self, dt: datetime.datetime, is_dst: bool | None = ...) -> datetime.datetime: ... + def normalize(self, dt: datetime.datetime) -> datetime.datetime: ... + def tzname(self, dt: datetime.datetime | None, is_dst: bool | None = ...) -> str: ... + def utcoffset(self, dt: datetime.datetime | None, is_dst: bool | None = ...) -> datetime.timedelta | None: ... + def dst(self, dt: datetime.datetime | None, is_dst: bool | None = ...) -> datetime.timedelta | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/lock.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/lock.pyi index 2eec6c26e..7d774ccd6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/lock.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/lock.pyi @@ -1,6 +1,5 @@ from types import TracebackType -from typing import Any, ClassVar, Type -from typing_extensions import Protocol +from typing import Any, ClassVar, Protocol, Type from redis.client import Redis diff --git a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/webdriver.pyi b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/webdriver.pyi index 95ab425f0..d2918e90b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/webdriver.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/selenium/selenium/webdriver/remote/webdriver.pyi @@ -38,49 +38,49 @@ class WebDriver: @property def mobile(self): ... @property - def name(self): ... + def name(self) -> str: ... def start_client(self) -> None: ... def stop_client(self) -> None: ... w3c: Any def start_session(self, capabilities, browser_profile: Any | None = ...) -> None: ... - def create_web_element(self, element_id): ... + def create_web_element(self, element_id) -> WebElement: ... def execute(self, driver_command, params: Any | None = ...): ... def get(self, url) -> None: ... @property - def title(self): ... - def find_element_by_id(self, id_): ... - def find_elements_by_id(self, id_): ... - def find_element_by_xpath(self, xpath): ... - def find_elements_by_xpath(self, xpath): ... - def find_element_by_link_text(self, link_text): ... - def find_elements_by_link_text(self, text): ... - def find_element_by_partial_link_text(self, link_text): ... - def find_elements_by_partial_link_text(self, link_text): ... - def find_element_by_name(self, name): ... - def find_elements_by_name(self, name): ... - def find_element_by_tag_name(self, name): ... - def find_elements_by_tag_name(self, name): ... - def find_element_by_class_name(self, name): ... - def find_elements_by_class_name(self, name): ... - def find_element_by_css_selector(self, css_selector): ... - def find_elements_by_css_selector(self, css_selector): ... + def title(self) -> str: ... + def find_element_by_id(self, id_) -> WebElement: ... + def find_elements_by_id(self, id_) -> WebElement: ... + def find_element_by_xpath(self, xpath) -> WebElement: ... + def find_elements_by_xpath(self, xpath) -> WebElement: ... + def find_element_by_link_text(self, link_text) -> WebElement: ... + def find_elements_by_link_text(self, text) -> WebElement: ... + def find_element_by_partial_link_text(self, link_text) -> WebElement: ... + def find_elements_by_partial_link_text(self, link_text) -> WebElement: ... + def find_element_by_name(self, name) -> WebElement: ... + def find_elements_by_name(self, name) -> WebElement: ... + def find_element_by_tag_name(self, name) -> WebElement: ... + def find_elements_by_tag_name(self, name) -> WebElement: ... + def find_element_by_class_name(self, name) -> WebElement: ... + def find_elements_by_class_name(self, name) -> WebElement: ... + def find_element_by_css_selector(self, css_selector) -> WebElement: ... + def find_elements_by_css_selector(self, css_selector) -> WebElement: ... def execute_script(self, script, *args): ... def execute_async_script(self, script, *args): ... @property - def current_url(self): ... + def current_url(self) -> str: ... @property - def page_source(self): ... + def page_source(self) -> str: ... def close(self) -> None: ... def quit(self) -> None: ... @property - def current_window_handle(self): ... + def current_window_handle(self) -> str: ... @property - def window_handles(self): ... + def window_handles(self) -> list[str]: ... def maximize_window(self) -> None: ... def fullscreen_window(self) -> None: ... def minimize_window(self) -> None: ... @property - def switch_to(self): ... + def switch_to(self) -> SwitchTo: ... def switch_to_active_element(self): ... def switch_to_window(self, window_name) -> None: ... def switch_to_frame(self, frame_reference) -> None: ... @@ -101,10 +101,10 @@ class WebDriver: def find_elements(self, by=..., value: Any | None = ...): ... @property def desired_capabilities(self): ... - def get_screenshot_as_file(self, filename): ... - def save_screenshot(self, filename): ... - def get_screenshot_as_png(self): ... - def get_screenshot_as_base64(self): ... + def get_screenshot_as_file(self, filename) -> bool: ... + def save_screenshot(self, filename) -> bool: ... + def get_screenshot_as_png(self) -> bytes: ... + def get_screenshot_as_base64(self) -> str: ... def set_window_size(self, width, height, windowHandle: str = ...) -> None: ... def get_window_size(self, windowHandle: str = ...): ... def set_window_position(self, x, y, windowHandle: str = ...): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/simplejson/simplejson/errors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/simplejson/simplejson/errors.pyi new file mode 100644 index 000000000..10cff3f28 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/simplejson/simplejson/errors.pyi @@ -0,0 +1,16 @@ +__all__ = ["JSONDecodeError"] + +def linecol(doc: str, pos: int) -> tuple[int, int]: ... +def errmsg(msg: str, doc: str, pos: int, end: int | None = ...) -> str: ... + +class JSONDecodeError(ValueError): + msg: str + doc: str + pos: int + end: int | None + lineno: int + colno: int + endlineno: int | None + endcolno: int | None + def __init__(self, msg: str, doc: str, pos: int, end: int | None = ...) -> None: ... + def __reduce__(self) -> tuple[JSONDecodeError, tuple[str, str, int, int | None]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/account.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/account.pyi index 8851ecb89..39cb243e9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/account.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/account.pyi @@ -21,3 +21,53 @@ class Account(CreateableAPIResource, DeletableAPIResource, ListableAPIResource): def persons(self, **params): ... def deauthorize(self, **params): ... def serialize(self, previous): ... + @classmethod + def capabilitys_url(cls, id, nested_id=...): ... + @classmethod + def capabilitys_request( + cls, method, url, api_key=..., idempotency_key=..., stripe_version=..., stripe_account=..., **params + ): ... + @classmethod + def retrieve_capability(cls, id, nested_id, **params): ... + @classmethod + def modify_capability(cls, id, nested_id, **params): ... + @classmethod + def list_capabilities(cls, id, **params): ... + @classmethod + def external_accounts_url(cls, id, nested_id=...): ... + @classmethod + def external_accounts_request( + cls, method, url, api_key=..., idempotency_key=..., stripe_version=..., stripe_account=..., **params + ): ... + @classmethod + def create_external_account(cls, id, **params): ... + @classmethod + def retrieve_external_account(cls, id, nested_id, **params): ... + @classmethod + def modify_external_account(cls, id, nested_id, **params): ... + @classmethod + def delete_external_account(cls, id, nested_id, **params): ... + @classmethod + def list_external_accounts(cls, id, **params): ... + @classmethod + def login_links_url(cls, id, nested_id=...): ... + @classmethod + def login_links_request( + cls, method, url, api_key=..., idempotency_key=..., stripe_version=..., stripe_account=..., **params + ): ... + @classmethod + def create_login_link(cls, id, **params): ... + @classmethod + def persons_url(cls, id, nested_id=...): ... + @classmethod + def persons_request(cls, method, url, api_key=..., idempotency_key=..., stripe_version=..., stripe_account=..., **params): ... + @classmethod + def create_person(cls, id, **params): ... + @classmethod + def retrieve_person(cls, id, nested_id, **params): ... + @classmethod + def modify_person(cls, id, nested_id, **params): ... + @classmethod + def delete_person(cls, id, nested_id, **params): ... + @classmethod + def list_persons(cls, id, **params): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/customer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/customer.pyi index c8694d0ff..4010c7a5c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/customer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/customer.pyi @@ -11,3 +11,43 @@ from stripe.api_resources.abstract import ( class Customer(CreateableAPIResource, DeletableAPIResource, ListableAPIResource, UpdateableAPIResource): OBJECT_NAME: str def delete_discount(self, **params) -> None: ... + @classmethod + def balance_transactions_url(cls, id, nested_id=...): ... + @classmethod + def balance_transactions_request( + cls, method, url, api_key=..., idempotency_key=..., stripe_version=..., stripe_account=..., **params + ): ... + @classmethod + def create_balance_transaction(cls, id, **params): ... + @classmethod + def retrieve_balance_transaction(cls, id, nested_id, **params): ... + @classmethod + def modify_balance_transaction(cls, id, nested_id, **params): ... + @classmethod + def list_balance_transactions(cls, id, **params): ... + @classmethod + def sources_url(cls, id, nested_id=...): ... + @classmethod + def sources_request(cls, method, url, api_key=..., idempotency_key=..., stripe_version=..., stripe_account=..., **params): ... + @classmethod + def create_source(cls, id, **params): ... + @classmethod + def retrieve_source(cls, id, nested_id, **params): ... + @classmethod + def modify_source(cls, id, nested_id, **params): ... + @classmethod + def delete_source(cls, id, nested_id, **params): ... + @classmethod + def list_sources(cls, id, **params): ... + @classmethod + def tax_ids_url(cls, id, nested_id=...): ... + @classmethod + def tax_ids_request(cls, method, url, api_key=..., idempotency_key=..., stripe_version=..., stripe_account=..., **params): ... + @classmethod + def create_tax_id(cls, id, **params): ... + @classmethod + def retrieve_tax_id(cls, id, nested_id, **params): ... + @classmethod + def delete_tax_id(cls, id, nested_id, **params): ... + @classmethod + def list_tax_ids(cls, id, **params): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/subscription_item.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/subscription_item.pyi index b107e7eee..df891e925 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/subscription_item.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/api_resources/subscription_item.pyi @@ -9,3 +9,19 @@ from stripe.api_resources.abstract import ( class SubscriptionItem(CreateableAPIResource, DeletableAPIResource, ListableAPIResource, UpdateableAPIResource): OBJECT_NAME: str def usage_record_summaries(self, **params): ... + @classmethod + def usage_records_url(cls, id, nested_id=...): ... + @classmethod + def usage_records_request( + cls, method, url, api_key=..., idempotency_key=..., stripe_version=..., stripe_account=..., **params + ): ... + @classmethod + def create_usage_record(cls, id, **params): ... + @classmethod + def usage_record_summarys_url(cls, id, nested_id=...): ... + @classmethod + def usage_record_summarys_request( + cls, method, url, api_key=..., idempotency_key=..., stripe_version=..., stripe_account=..., **params + ): ... + @classmethod + def list_usage_record_summaries(cls, id, **params): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/util.pyi index 67f93be75..e3590f188 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/stripe/stripe/util.pyi @@ -1,4 +1,4 @@ -from typing import Any +from typing import Any, overload def utf8(value): ... def log_debug(message, **params) -> None: ... @@ -12,3 +12,8 @@ class class_method_variant: method: Any def __call__(self, method): ... def __get__(self, obj, objtype: Any | None = ...): ... + +@overload +def populate_headers(idempotency_key: None) -> None: ... +@overload +def populate_headers(idempotency_key: str) -> dict[str, str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/toposort/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/toposort/METADATA.toml index 6cf9fae44..ccb25250b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/toposort/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/toposort/METADATA.toml @@ -1 +1 @@ -version = "1.6.*" +version = "1.7" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/toposort/toposort.pyi b/packages/pyright-internal/typeshed-fallback/stubs/toposort/toposort.pyi index 9410d8279..ccde29046 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/toposort/toposort.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/toposort/toposort.pyi @@ -1,10 +1,16 @@ -from typing import Any, Iterator, TypeVar +from _typeshed import SupportsItems +from typing import Any, Iterable, Iterator, Protocol, TypeVar +_KT_co = TypeVar("_KT_co", covariant=True) +_VT_co = TypeVar("_VT_co", covariant=True) _T = TypeVar("_T") +class _SupportsItemsAndLen(SupportsItems[_KT_co, _VT_co], Protocol[_KT_co, _VT_co]): + def __len__(self) -> int: ... + class CircularDependencyError(ValueError): data: dict[Any, set[Any]] def __init__(self, data: dict[Any, set[Any]]) -> None: ... -def toposort(data: dict[_T, set[_T]]) -> Iterator[set[_T]]: ... -def toposort_flatten(data: dict[_T, set[_T]], sort: bool = ...) -> list[_T]: ... +def toposort(data: _SupportsItemsAndLen[_T, Iterable[_T]]) -> Iterator[set[_T]]: ... +def toposort_flatten(data: _SupportsItemsAndLen[_T, Iterable[_T]], sort: bool = ...) -> list[_T]: ...