mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-05-15 21:27:23 -04:00
a45e2284da
in this patch the asyncio/events.py module, which existed only to raise errors when trying to attach event listeners, is removed, as we were already coding an asyncio-specific workaround in upstream Pool / Session to raise this error, just moved the error out to the target and did the same thing for Engine. We also add an async_sessionmaker class. The initial rationale here is because sessionmaker() is hardcoded to Session subclasses, and there's not a way to get the use case of sessionmaker(class_=AsyncSession) to type correctly without changing the sessionmaker() symbol itself to be a function and not a class, which gets too complicated for what this is. Additionally, _SessionClassMethods has only three methods on it, one of which is not usable with asyncio (close_all()), the others not generally used from the session class. Change-Id: I064a5fa5d91cc8d5bbe9597437536e37b4e801fe
151 lines
3.7 KiB
TOML
151 lines
3.7 KiB
TOML
[build-system]
|
|
build-backend = "setuptools.build_meta"
|
|
requires = [
|
|
"setuptools>=47",
|
|
"wheel>=0.34",
|
|
"cython>=0.29.24; python_implementation == 'CPython'", # Skip cython when using pypy
|
|
]
|
|
|
|
[tool.black]
|
|
line-length = 79
|
|
target-version = ['py37']
|
|
|
|
[tool.zimports]
|
|
black-line-length = 79
|
|
keep-unused-type-checking = true
|
|
|
|
[tool.slotscheck]
|
|
exclude-modules = '^sqlalchemy\.testing'
|
|
|
|
|
|
[tool.pytest.ini_options]
|
|
addopts = "--tb native -v -r sfxX --maxfail=250 -p warnings -p logging --strict-markers"
|
|
norecursedirs = "examples build doc lib"
|
|
python_files = "test_*.py"
|
|
minversion = "6.2"
|
|
filterwarnings = [
|
|
# NOTE: additional SQLAlchemy specific filters in
|
|
# sqlalchemy/testing/warnings.py. SQLAlchemy modules cannot be named
|
|
# here as pytest loads them immediately, which breaks coverage as well
|
|
# as sys.path adjustments in conftest.py
|
|
"error::DeprecationWarning:test",
|
|
"error::DeprecationWarning:sqlalchemy"
|
|
]
|
|
markers = [
|
|
"memory_intensive: memory / CPU intensive suite tests",
|
|
"mypy: mypy integration / plugin tests",
|
|
"timing_intensive: time-oriented tests that are sensitive to race conditions",
|
|
"backend: tests that should run on all backends; typically dialect-sensitive",
|
|
"sparse_backend: tests that should run on multiple backends, not necessarily all",
|
|
]
|
|
|
|
[tool.pyright]
|
|
|
|
|
|
reportPrivateUsage = "none"
|
|
reportUnusedClass = "none"
|
|
reportUnusedFunction = "none"
|
|
reportTypedDictNotRequiredAccess = "warning"
|
|
#reportIncompatibleMethodOverride = "error"
|
|
|
|
[tool.mypy]
|
|
mypy_path = "./lib/"
|
|
show_error_codes = true
|
|
strict = true
|
|
incremental = true
|
|
|
|
[[tool.mypy.overrides]]
|
|
|
|
# ad-hoc ignores
|
|
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
|
|
|
|
# strict checking
|
|
[[tool.mypy.overrides]]
|
|
|
|
module = [
|
|
# packages
|
|
"sqlalchemy.connectors.*",
|
|
"sqlalchemy.event.*",
|
|
"sqlalchemy.ext.*",
|
|
"sqlalchemy.sql.*",
|
|
"sqlalchemy.engine.*",
|
|
"sqlalchemy.pool.*",
|
|
|
|
"sqlalchemy.orm.scoping",
|
|
"sqlalchemy.orm.session",
|
|
"sqlalchemy.orm.state",
|
|
|
|
# modules
|
|
"sqlalchemy.events",
|
|
"sqlalchemy.exc",
|
|
"sqlalchemy.inspection",
|
|
"sqlalchemy.schema",
|
|
"sqlalchemy.types",
|
|
]
|
|
|
|
warn_unused_ignores = false
|
|
ignore_errors = false
|
|
strict = true
|
|
|
|
# partial checking
|
|
[[tool.mypy.overrides]]
|
|
|
|
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.schema", # would be nice as strict
|
|
"sqlalchemy.sql.sqltypes", # would be nice as strict
|
|
"sqlalchemy.sql.traversals",
|
|
"sqlalchemy.sql.util",
|
|
|
|
"sqlalchemy.util.*",
|
|
]
|
|
|
|
|
|
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
|