Files
sqlalchemy/pyproject.toml
T
Mike Bayer ca48f461b2 replace test tags with pytest.mark
replaced the __tags__ class attribute and the
--exclude-tags / --include-tags test runner options
with regular pytest.mark names
so that we can take advantage of mark expressions.
options --nomemory, --notimingintensive, --backend-only,
--exclude-tags, --include-tags remain as legacy but
make use of pytest mark for implemementation.

Added a "mypy" mark for the section of tests that are doing mypy
integration tests.

The __backend__ and __sparse_backend__ class attributes also
use pytest marks for their implementation, which also allows
the marks "backend" and "sparse_backend" to be used explicitly.

Also removed the no longer used "--cdecimal" option as this was
python 2 specific.

in theory, the usage of pytest marks could expand such that
the whole exclusions system would be based on it, but this
does not seem to have any advantage at the moment.

Change-Id: Ideeb57d9d49f0efc7fc0b6b923b31207ab783025
2022-01-25 09:25:40 -05:00

96 lines
2.5 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.pytest.ini_options]
addopts = "--tb native -v -r sfxX --maxfail=250 -p warnings -p logging --strict-markers"
python_files = "test/*test_*.py"
minversion = "6.2"
filterwarnings = [
"ignore::sqlalchemy.exc.SAPendingDeprecationWarning",
"error::sqlalchemy.exc.SADeprecationWarning",
"error::sqlalchemy.exc.SAWarning",
"always::sqlalchemy.exc.SATestSuiteWarning",
"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]
include = [
"lib/sqlalchemy/events.py",
"lib/sqlalchemy/exc.py",
"lib/sqlalchemy/log.py",
"lib/sqlalchemy/inspection.py",
"lib/sqlalchemy/schema.py",
"lib/sqlalchemy/types.py",
"lib/sqlalchemy/util/",
]
[tool.mypy]
mypy_path = "./lib/"
show_error_codes = true
strict = false
incremental = true
# disabled checking
[[tool.mypy.overrides]]
module="sqlalchemy.*"
ignore_errors = true
warn_unused_ignores = false
strict = true
# https://github.com/python/mypy/issues/8754
# we are a pep-561 package, so implicit-rexport should be
# enabled
implicit_reexport = true
# individual packages or even modules should be listed here
# with strictness-specificity set up. there's no way we are going to get
# the whole library 100% strictly typed, so we have to tune this based on
# the type of module or package we are dealing with
# strict checking
[[tool.mypy.overrides]]
module = [
"sqlalchemy.events",
"sqlalchemy.events",
"sqlalchemy.exc",
"sqlalchemy.inspection",
"sqlalchemy.schema",
"sqlalchemy.types",
]
ignore_errors = false
strict = true
# partial checking, internals can be untyped
[[tool.mypy.overrides]]
module="sqlalchemy.util.*"
ignore_errors = false
# util is for internal use so we can get by without everything
# being typed
allow_untyped_defs = true
check_untyped_defs = false
allow_untyped_calls = true