# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
-__all__ = ("mssql", "mysql", "oracle", "postgresql", "sqlite")
+from __future__ import annotations
+from typing import Callable
+from typing import Optional
+from typing import Type
+from typing import TYPE_CHECKING
from .. import util
+if TYPE_CHECKING:
+ from ..engine.interfaces import Dialect
+
+__all__ = ("mssql", "mysql", "oracle", "postgresql", "sqlite")
+
-def _auto_fn(name):
+def _auto_fn(name: str) -> Optional[Callable[[], Type[Dialect]]]:
"""default dialect importer.
plugs into the :class:`.PluginLoader`
module = __import__(
"sqlalchemy.dialects.mysql.mariadb"
).dialects.mysql.mariadb
- return module.loader(driver)
+ return module.loader(driver) # type: ignore
else:
module = __import__("sqlalchemy.dialects.%s" % (dialect,)).dialects
module = getattr(module, dialect)
if hasattr(module, driver):
module = getattr(module, driver)
- return lambda: module.dialect
+ return lambda: module.dialect # type: ignore
else:
return None
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from . import base # noqa
from . import pymssql # noqa
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
"""
.. dialect:: mssql
:name: Microsoft SQL Server
from ...util import update_wrapper
if TYPE_CHECKING:
- from ...sql.compiler import SQLCompiler
from ...sql.dml import DMLState
from ...sql.selectable import TableClause
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from ... import cast
from ... import Column
+# mypy: ignore-errors
+
from ... import types as sqltypes
# technically, all the dialect-specific datatypes that don't have any special
+# mypy: ignore-errors
+
from sqlalchemy import inspect
from sqlalchemy import Integer
from ... import create_engine
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
"""
.. dialect:: mssql+pymssql
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
r"""
.. dialect:: mssql+pyodbc
:name: PyODBC
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from . import aiomysql # noqa
from . import asyncmy # noqa
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
r"""
.. dialect:: mysql+aiomysql
:name: aiomysql
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
r"""
.. dialect:: mysql+asyncmy
:name: asyncmy
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
r"""
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
r"""
.. dialect:: mysql+cymysql
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
import typing
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
import re
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
import typing
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from ... import types as sqltypes
+# mypy: ignore-errors
+
from .base import MariaDBIdentifierPreparer
from .base import MySQLDialect
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
"""
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
r"""
.. dialect:: mysql+mysqlconnector
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
"""
+# mypy: ignore-errors
+
from ... import exc
from ...testing.provision import configure_follower
from ...testing.provision import create_db
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
r"""
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
r"""
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
import re
# https://mariadb.com/kb/en/reserved-words/
# includes: Reserved Words, Oracle Mode (separate set unioned)
# excludes: Exceptions, Function Names
+# mypy: ignore-errors
+
RESERVED_WORDS_MARIADB = {
"accessible",
"add",
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
import datetime
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from . import base # noqa
from . import cx_oracle # noqa
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
r"""
.. dialect:: oracle
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
r"""
.. dialect:: oracle+cx_oracle
+# mypy: ignore-errors
+
from ... import create_engine
from ... import exc
from ...engine import url as sa_url
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from types import ModuleType
from . import asyncpg # noqa
+# mypy: ignore-errors
+
import decimal
from .array import ARRAY as PGARRAY
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from __future__ import annotations
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
r"""
.. dialect:: postgresql+asyncpg
:name: asyncpg
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
r"""
.. dialect:: postgresql
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
import typing
from . import ext
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from itertools import zip_longest
from .array import ARRAY
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
import re
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
import collections.abc as collections_abc
from ... import types as sqltypes
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
r"""
.. dialect:: postgresql+pg8000
:name: pg8000
+# mypy: ignore-errors
+
import time
from ... import exc
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
r"""
.. dialect:: postgresql+psycopg
:name: psycopg (a.k.a. psycopg 3)
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
r"""
.. dialect:: postgresql+psycopg2
:name: psycopg2
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
r"""
.. dialect:: postgresql+psycopg2cffi
:name: psycopg2cffi
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from ... import types as sqltypes
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from . import aiosqlite # noqa
from . import base # noqa
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
r"""
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
r"""
.. dialect:: sqlite
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
import typing
+# mypy: ignore-errors
+
from ... import types as sqltypes
+# mypy: ignore-errors
+
import os
import re
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
"""
.. dialect:: sqlite+pysqlcipher
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
r"""
.. dialect:: sqlite+pysqlite
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
"""Define cursor-specific result set constructs including
:class:`.BaseCursorResult`, :class:`.CursorResult`."""
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
"""Default implementations of per-dialect sqlalchemy.engine classes.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
r"""Define an extension to the :mod:`sqlalchemy.ext.declarative` system
which automatically generates mapped classes and relationships from a database
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
+
"""Baked query extension.
Provides a creational pattern for the :class:`.query.Query` object which
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
r"""Provides an API for creation of custom ClauseElements and compilers.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from .extensions import AbstractConcreteBase
from .extensions import ConcreteBase
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
+
"""Public API functions and helpers for declarative."""
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
"""Horizontal sharding support.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
"""Define attributes on ORM-mapped classes that have "index" attributes for
columns with :class:`_types.Indexable` types.
+# ext/instrumentation.py
+# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
+# <see AUTHORS file>
+#
+# This module is part of SQLAlchemy and is released under
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
"""Extensible class instrumentation.
The :mod:`sqlalchemy.ext.instrumentation` package provides for alternate
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
r"""Provide support for tracking of in-place changes to scalar values,
which are propagated into ORM change events on owning parent objects.
# ext/mypy/plugin.py
-# Copyright (C) 2021 the SQLAlchemy authors and contributors
+# Copyright (C) 2021-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
+# ext/mypy/util.py
+# Copyright (C) 2021-2022 the SQLAlchemy authors and contributors
+# <see AUTHORS file>
+#
+# This module is part of SQLAlchemy and is released under
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
+
from __future__ import annotations
import re
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
"""A custom list that manages index/position information for contained
elements.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
"""Serializer/Deserializer objects for usage with SQLAlchemy query structures,
allowing "contextual" deserialization.
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
-"""Future 2.0 API features.
+"""2.0 API features.
+
+this module is legacy as 2.0 APIs are now standard.
"""
from .engine import Connection as Connection
-from ..engine import Connection # noqa
-from ..engine import create_engine # noqa
-from ..engine import Engine # noqa
+# sql/future/engine.py
+# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
+# <see AUTHORS file>
+#
+# This module is part of SQLAlchemy and is released under
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
+"""2.0 API features.
+
+this module is legacy as 2.0 APIs are now standard.
+
+"""
+
+from ..engine import Connection as Connection
+from ..engine import create_engine as create_engine
+from ..engine import Engine as Engine
+++ /dev/null
-# sql/future/orm/__init__.py
-# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
-# <see AUTHORS file>
-#
-# This module is part of SQLAlchemy and is released under
-# the MIT License: https://www.opensource.org/licenses/mit-license.php
-
-"""Future 2.0 API features for Orm.
-
-"""
from __future__ import annotations
+from typing import Any
+
from . import exc as exc
from . import mapper as mapperlib
from . import strategy_options as strategy_options
from ._orm_constructors import dynamic_loader as dynamic_loader
from ._orm_constructors import join as join
from ._orm_constructors import mapped_column as mapped_column
-from ._orm_constructors import MappedColumn as MappedColumn
from ._orm_constructors import outerjoin as outerjoin
from ._orm_constructors import query_expression as query_expression
from ._orm_constructors import relationship as relationship
from .base import Mapped as Mapped
from .base import NotExtension as NotExtension
from .base import ORMDescriptor as ORMDescriptor
+from .context import FromStatement as FromStatement
from .context import QueryContext as QueryContext
from .decl_api import add_mapped_attribute as add_mapped_attribute
from .decl_api import as_declarative as as_declarative
from .mapper import reconstructor as reconstructor
from .mapper import validates as validates
from .properties import ColumnProperty as ColumnProperty
+from .properties import MappedColumn as MappedColumn
from .query import AliasOption as AliasOption
-from .query import FromStatement as FromStatement
from .query import Query as Query
from .relationships import foreign as foreign
from .relationships import Relationship as Relationship
from .. import util as _sa_util
-def __go(lcls):
+def __go(lcls: Any) -> None:
_sa_util.preloaded.import_prefix("sqlalchemy.orm")
_sa_util.preloaded.import_prefix("sqlalchemy.ext")
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
from __future__ import annotations
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
"""Defines instrumentation for class attributes and their interaction
with instances.
from .state import InstanceState
from ..sql.dml import _DMLColumnElement
from ..sql.elements import ColumnElement
- from ..sql.elements import SQLCoreOperations
_T = TypeVar("_T")
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
"""Routines to handle the string class registry used by declarative.
This system allows specification of classes and expressions used in
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
"""Support for collections of mapped entities.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
from __future__ import annotations
from ._typing import _InternalEntityType
from .mapper import Mapper
from .query import Query
- from ..sql.compiler import _CompilerStackEntry
from ..sql.dml import _DMLTableElement
from ..sql.elements import ColumnElement
from ..sql.selectable import _LabelConventionCallable
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
"""Relationship dependencies.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
"""Dynamic collection API.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from __future__ import annotations
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
"""SQLAlchemy ORM exceptions."""
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
"""Defines SQLAlchemy's system of class instrumentation.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
"""
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
"""private module containing functions used to convert database
rows into object instances and associated state.
from .state import InstanceState
from ..engine.interfaces import _ExecuteOptions
from ..sql import Select
- from ..sql.base import Executable
from ..sql.selectable import ForUpdateArg
_T = TypeVar("_T", bound=Any)
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
"""Logic to map Python classes to and from selectables.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
"""private module containing functions used to emit INSERT, UPDATE
and DELETE statements on behalf of a :class:`_orm.Mapper` and its descending
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+
"""Provides the Session class and related utilities."""
from __future__ import annotations
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
"""sqlalchemy.orm.interfaces.LoaderStrategy
implementations, and related MapperOptions."""
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
"""private module containing functions used for copying data
between instances based on join conditions.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
"""The internals for the unit of work system.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
from __future__ import annotations
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
"""Foundational utilities common to many sql modules.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
from __future__ import annotations
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
"""Base SQL and DDL compiler implementations.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
"""Functions used by compiler.py to determine the parameters rendered
within INSERT and UPDATE statements.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
+
"""
Provides the hierarchy of DDL-defining schema items as well as routines
to invoke them for a create/drop call.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
"""Core SQL expression elements, including :class:`_expression.ClauseElement`,
:class:`_expression.ColumnElement`, and derived classes.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
"""SQL function API, factories, and built-in functions.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
from __future__ import annotations
if TYPE_CHECKING:
from .cache_key import CacheConst
- from .cache_key import NO_CACHE
from .elements import BindParameter
from .elements import ClauseElement
from .roles import SQLRole
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
"""Establish constraint and index naming conventions.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
"""The :class:`_expression.FromClause` class of SQL expression elements,
representing
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
"""SQL specific types.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
from __future__ import annotations
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
"""High level utilities which build upon other modules here.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from unittest import mock
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from __future__ import annotations
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from __future__ import annotations
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
# functions and wrappers to run tests, fixtures, provisioning and
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from __future__ import annotations
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from __future__ import annotations
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from __future__ import annotations
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
-
+# mypy: ignore-errors
import contextlib
import operator
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from __future__ import annotations
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
"""Classes used in pickling tests, need to be at the module level for
unpickling.
+# mypy: ignore-errors
+
"""
Bootstrapper for test framework plugins.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from __future__ import annotations
+# mypy: ignore-errors
+
from __future__ import annotations
import argparse
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
"""Profiling support for unit and performance tests.
+# mypy: ignore-errors
+
from __future__ import annotations
import collections
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
"""Global database feature support policy.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
from __future__ import annotations
+# mypy: ignore-errors
+
from .. import fixtures
from ..assertions import eq_
from ..schema import Column
+# mypy: ignore-errors
+
import random
from . import testing
+# mypy: ignore-errors
+
from .. import fixtures
from ..assertions import eq_
from ..schema import Column
#! coding: utf-8
+# mypy: ignore-errors
+
from . import testing
from .. import assert_raises
+# mypy: ignore-errors
+
from .. import fixtures
from ..assertions import eq_
from ..config import requirements
+# mypy: ignore-errors
+
import operator
import re
+# mypy: ignore-errors
+
import datetime
from .. import engines
+# mypy: ignore-errors
+
from sqlalchemy import bindparam
from sqlalchemy import Column
from sqlalchemy import Integer
+# mypy: ignore-errors
+
import collections.abc as collections_abc
import itertools
+# mypy: ignore-errors
+
from .. import config
from .. import fixtures
from ..assertions import eq_
-# coding: utf-8
+# mypy: ignore-errors
+
import datetime
import decimal
-# coding: utf-8
-"""verrrrry basic unicode column name testing"""
+# mypy: ignore-errors
+
from sqlalchemy import desc
from sqlalchemy import ForeignKey
+# mypy: ignore-errors
+
from .. import fixtures
from ..assertions import eq_
from ..schema import Column
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from __future__ import annotations
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: ignore-errors
+
from __future__ import annotations
import warnings
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
"""Collection classes and helpers."""
from __future__ import annotations
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
+
from __future__ import annotations
import asyncio
+# mypy: allow-untyped-defs, allow-untyped-calls
+
import os
import typing
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
from __future__ import annotations
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
"""Handle Python version/platform incompatibilities."""
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
+
from __future__ import annotations
import asyncio # noqa
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
"""Helpers related to deprecation of functions, methods, classes, other
functionality."""
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
"""Routines to help with the creation, loading and introspection of
modules, classes, hierarchies, attributes, functions, and methods.
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
"""supplies the "preloaded" registry to resolve circular module imports at
runtime.
_FN = TypeVar("_FN", bound=Callable[..., Any])
+
if TYPE_CHECKING:
- from sqlalchemy.engine import default as engine_default
- from sqlalchemy.orm import descriptor_props as orm_descriptor_props
- from sqlalchemy.orm import relationships as orm_relationships
- from sqlalchemy.orm import session as orm_session
- from sqlalchemy.orm import util as orm_util
- from sqlalchemy.sql import dml as sql_dml
- from sqlalchemy.sql import functions as sql_functions
- from sqlalchemy.sql import util as sql_util
+ from sqlalchemy.engine import default as engine_default # noqa
+ from sqlalchemy.orm import relationships as orm_relationships # noqa
+ from sqlalchemy.orm import session as orm_session # noqa
+ from sqlalchemy.orm import util as orm_util # noqa
+ from sqlalchemy.sql import dml as sql_dml # noqa
+ from sqlalchemy.sql import functions as sql_functions # noqa
+ from sqlalchemy.sql import util as sql_util # noqa
class _ModuleRegistry:
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
"""An adaptation of Py2.3/2.4's Queue module which supports reentrant
behavior, using RLock instead of Lock for its mutex object. The
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
+# mypy: allow-untyped-defs, allow-untyped-calls
"""Topological sorting algorithms."""
+# mypy: allow-untyped-defs, allow-untyped-calls
+
from __future__ import annotations
import sys
reportUnusedClass = "none"
reportUnusedFunction = "none"
reportTypedDictNotRequiredAccess = "warning"
-#reportIncompatibleMethodOverride = "error"
[tool.mypy]
mypy_path = "./lib/"
show_error_codes = true
-strict = true
incremental = true
-[[tool.mypy.overrides]]
-
-#####################################################################
-# modules / packages explicitly not checked by Mypy at all right now.
-module = [
- "sqlalchemy.engine.reflection", # interim, should be strict
-
- # TODO for strict:
- "sqlalchemy.ext.automap",
- "sqlalchemy.ext.compiler",
- "sqlalchemy.ext.declarative.*",
- "sqlalchemy.ext.mutable",
- "sqlalchemy.ext.horizontal_shard",
-
- # TODO for non-strict:
- "sqlalchemy.ext.baked",
- "sqlalchemy.ext.instrumentation",
- "sqlalchemy.ext.indexable",
- "sqlalchemy.ext.orderinglist",
- "sqlalchemy.ext.serializer",
-
- # not yet classified:
- "sqlalchemy.orm.*",
- "sqlalchemy.dialects.*",
- "sqlalchemy.cyextension.*",
- "sqlalchemy.future.*",
- "sqlalchemy.testing.*",
-
-]
-
-warn_unused_ignores = false
-ignore_errors = true
-################################################
-# modules explicitly for Mypy strict checking
[[tool.mypy.overrides]]
module = [
- # packages
- "sqlalchemy.connectors.*",
- "sqlalchemy.event.*",
- "sqlalchemy.ext.*",
- "sqlalchemy.sql.*",
- "sqlalchemy.engine.*",
- "sqlalchemy.pool.*",
-
- # uncomment, trying to make sure mypy
- # is at a baseline
- # "sqlalchemy.orm._orm_constructors",
-
- "sqlalchemy.orm.path_registry",
- "sqlalchemy.orm.scoping",
- "sqlalchemy.orm.session",
- "sqlalchemy.orm.state",
-
- # modules
- "sqlalchemy.events",
- "sqlalchemy.exc",
- "sqlalchemy.inspection",
- "sqlalchemy.schema",
- "sqlalchemy.types",
+ "sqlalchemy.*"
]
warn_unused_ignores = false
-ignore_errors = false
strict = true
-################################################
-# modules explicitly for Mypy non-strict checking
[[tool.mypy.overrides]]
+#####################################################################
+# interim list of modules that need some level of type checking to
+# pass
module = [
- "sqlalchemy.engine.cursor",
- "sqlalchemy.engine.default",
-
- "sqlalchemy.sql.base",
- "sqlalchemy.sql.coercions",
- "sqlalchemy.sql.compiler",
- "sqlalchemy.sql.crud",
- "sqlalchemy.sql.ddl", # would be nice as strict
- "sqlalchemy.sql.elements", # would be nice as strict
- "sqlalchemy.sql.functions", # would be nice as strict, requires sqltypes
- "sqlalchemy.sql.lambdas",
- "sqlalchemy.sql.naming",
- "sqlalchemy.sql.selectable", # would be nice as strict
- "sqlalchemy.sql.sqltypes", # would be nice as strict
- "sqlalchemy.sql.traversals",
- "sqlalchemy.sql.util",
-
- "sqlalchemy.orm._orm_constructors",
-
- "sqlalchemy.orm.interfaces",
- "sqlalchemy.orm.mapper",
- "sqlalchemy.orm.util",
-
- "sqlalchemy.util.*",
-]
+ # TODO for ORM, non-strict
+ "sqlalchemy.orm.base",
+ "sqlalchemy.orm.decl_base",
+ "sqlalchemy.orm.descriptor_props",
+ "sqlalchemy.orm.identity",
+ "sqlalchemy.orm.mapped_collection",
+ "sqlalchemy.orm.properties",
+ "sqlalchemy.orm.relationships",
+ "sqlalchemy.orm.strategy_options",
+ "sqlalchemy.orm.state_changes",
+
+ # would ideally be strict
+ "sqlalchemy.orm.decl_api",
+ "sqlalchemy.orm.events",
+ "sqlalchemy.orm.query",
+ "sqlalchemy.engine.reflection",
+]
+
+ignore_errors = true
warn_unused_ignores = false
-ignore_errors = false
-# mostly strict without requiring totally untyped things to be
-# typed
-strict = true
-allow_untyped_defs = true
-allow_untyped_calls = true