diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/mypy/__init__.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/mypy/__init__.pyi deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/mypy/apply.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/mypy/apply.pyi deleted file mode 100644 index 651f37c031c8..000000000000 --- a/stubs/SQLAlchemy/sqlalchemy/ext/mypy/apply.pyi +++ /dev/null @@ -1,27 +0,0 @@ -from typing import Any -from typing_extensions import TypeAlias - -from . import util - -_AssignmentStmt: TypeAlias = Any # mypy.nodes.AssignmentStmt -_NameExpr: TypeAlias = Any # mypy.nodes.NameExpr -_StrExpr: TypeAlias = Any # mypy.nodes.StrExpr -_SemanticAnalyzerPluginInterface: TypeAlias = Any # mypy.plugin.SemanticAnalyzerPluginInterface -_ProperType: TypeAlias = Any # mypy.types.ProperType - -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/stubs/SQLAlchemy/sqlalchemy/ext/mypy/decl_class.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/mypy/decl_class.pyi deleted file mode 100644 index 9b68ea889205..000000000000 --- a/stubs/SQLAlchemy/sqlalchemy/ext/mypy/decl_class.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from typing import Any -from typing_extensions import TypeAlias - -from . import util - -_SemanticAnalyzerPluginInterface: TypeAlias = Any # mypy.plugin.SemanticAnalyzerPluginInterface - -def scan_declarative_assignments_and_apply_types( - cls, api: _SemanticAnalyzerPluginInterface, is_mixin_scan: bool = ... -) -> list[util.SQLAlchemyAttribute] | None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/mypy/infer.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/mypy/infer.pyi deleted file mode 100644 index 0ffb05b70360..000000000000 --- a/stubs/SQLAlchemy/sqlalchemy/ext/mypy/infer.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from collections.abc import Sequence -from typing import Any -from typing_extensions import TypeAlias - -_AssignmentStmt: TypeAlias = Any # mypy.nodes.AssignmentStmt -_Expression: TypeAlias = Any # mypy.nodes.Expression -_RefExpr: TypeAlias = Any # mypy.nodes.RefExpr -_TypeInfo: TypeAlias = Any # mypy.nodes.TypeInfo -_Var: TypeAlias = Any # mypy.nodes.Var -_SemanticAnalyzerPluginInterface: TypeAlias = Any # mypy.plugin.SemanticAnalyzerPluginInterface -_ProperType: TypeAlias = Any # mypy.types.ProperType - -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/stubs/SQLAlchemy/sqlalchemy/ext/mypy/names.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/mypy/names.pyi deleted file mode 100644 index ab998e2bcd4d..000000000000 --- a/stubs/SQLAlchemy/sqlalchemy/ext/mypy/names.pyi +++ /dev/null @@ -1,38 +0,0 @@ -from typing import Any -from typing_extensions import TypeAlias - -from ...util import symbol - -_ClassDef: TypeAlias = Any # mypy.nodes.ClassDef -_Expression: TypeAlias = Any # mypy.nodes.Expression -_MemberExpr: TypeAlias = Any # mypy.nodes.MemberExpr -_NameExpr: TypeAlias = Any # mypy.nodes.NameExpr -_SymbolNode: TypeAlias = Any # mypy.nodes.SymbolNode -_TypeInfo: TypeAlias = Any # mypy.nodes.TypeInfo -_SemanticAnalyzerPluginInterface: TypeAlias = Any # mypy.plugin.SemanticAnalyzerPluginInterface -_UnboundType: TypeAlias = Any # mypy.types.UnboundType - -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/stubs/SQLAlchemy/sqlalchemy/ext/mypy/plugin.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/mypy/plugin.pyi deleted file mode 100644 index c9e943a1e02d..000000000000 --- a/stubs/SQLAlchemy/sqlalchemy/ext/mypy/plugin.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from collections.abc import Callable -from typing import Any -from typing_extensions import TypeAlias - -_MypyFile: TypeAlias = Any # mypy.nodes.MypyFile -_AttributeContext: TypeAlias = Any # mypy.plugin.AttributeContext -_ClassDefContext: TypeAlias = Any # mypy.plugin.ClassDefContext -_DynamicClassDefContext: TypeAlias = Any # mypy.plugin.DynamicClassDefContext -_Plugin: TypeAlias = Any # mypy.plugin.Plugin -_Type: TypeAlias = Any # mypy.types.Type - -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) -> type[SQLAlchemyPlugin]: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/mypy/util.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/mypy/util.pyi deleted file mode 100644 index 43edf16d8862..000000000000 --- a/stubs/SQLAlchemy/sqlalchemy/ext/mypy/util.pyi +++ /dev/null @@ -1,49 +0,0 @@ -from collections.abc import Iterable, Iterator -from typing import Any, TypeVar, overload -from typing_extensions import TypeAlias - -_CallExpr: TypeAlias = Any # mypy.nodes._CallExpr -_Context: TypeAlias = Any # mypy.nodes._Context -_Expression: TypeAlias = Any # mypy.nodes._Expression -_JsonDict: TypeAlias = Any # mypy.nodes._JsonDict -_NameExpr: TypeAlias = Any # mypy.nodes._NameExpr -_Statement: TypeAlias = Any # mypy.nodes._Statement -_TypeInfo: TypeAlias = Any # mypy.nodes._TypeInfo -_ClassDefContext: TypeAlias = Any # mypy.plugin._ClassDefContext -_DynamicClassDefContext: TypeAlias = Any # mypy.plugin._DynamicClassDefContext -_SemanticAnalyzerPluginInterface: TypeAlias = Any # mypy.plugin._SemanticAnalyzerPluginInterface -_Type: TypeAlias = Any # mypy.types._Type - -_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[type[_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/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi b/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi index 702ef9ea1fa6..f2fea9f5dcc0 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi @@ -1,19 +1,10 @@ import asyncio as asyncio from collections.abc import Callable, Coroutine from typing import Any -from typing_extensions import TypeAlias from .langhelpers import memoized_property -_Greenlet: TypeAlias = 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: ...