2019-09-12 12:29:55 -04:00
|
|
|
[mypy]
|
2019-10-31 11:43:24 -04:00
|
|
|
namespace_packages = True
|
2022-08-15 15:05:57 -04:00
|
|
|
plugins = pydantic.mypy, mypy_zope:plugin, scripts-dev/mypy_synapse_plugin.py
|
2021-03-26 12:49:46 -04:00
|
|
|
follow_imports = normal
|
2019-10-31 11:43:24 -04:00
|
|
|
show_error_codes = True
|
|
|
|
show_traceback = True
|
|
|
|
mypy_path = stubs
|
2020-10-01 08:09:18 -04:00
|
|
|
warn_unreachable = True
|
2021-03-26 12:49:46 -04:00
|
|
|
local_partial_types = True
|
2021-04-05 09:10:18 -04:00
|
|
|
no_implicit_optional = True
|
2023-05-31 07:18:29 -04:00
|
|
|
|
|
|
|
# Strict checks, see mypy --help
|
|
|
|
warn_unused_configs = True
|
|
|
|
# disallow_any_generics = True
|
|
|
|
disallow_subclassing_any = True
|
|
|
|
# disallow_untyped_calls = True
|
2022-05-19 08:49:58 -04:00
|
|
|
disallow_untyped_defs = True
|
2023-05-31 07:18:29 -04:00
|
|
|
disallow_incomplete_defs = True
|
|
|
|
# check_untyped_defs = True
|
|
|
|
# disallow_untyped_decorators = True
|
2022-12-12 16:25:07 -05:00
|
|
|
warn_redundant_casts = True
|
2023-05-31 07:18:29 -04:00
|
|
|
warn_unused_ignores = True
|
|
|
|
# warn_return_any = True
|
|
|
|
# no_implicit_reexport = True
|
|
|
|
strict_equality = True
|
|
|
|
|
2023-05-16 14:27:47 -04:00
|
|
|
# Run mypy type checking with the minimum supported Python version to catch new usage
|
|
|
|
# that isn't backwards-compatible (types, overloads, etc).
|
|
|
|
python_version = 3.8
|
2020-12-17 17:58:00 -05:00
|
|
|
|
2020-08-26 09:59:37 -04:00
|
|
|
files =
|
2022-04-08 06:10:58 -04:00
|
|
|
docker/,
|
2022-03-02 13:00:26 -05:00
|
|
|
scripts-dev/,
|
2021-11-09 11:22:47 -05:00
|
|
|
synapse/,
|
2023-10-04 13:53:04 -04:00
|
|
|
synmark/,
|
2022-09-06 14:01:37 -04:00
|
|
|
tests/,
|
|
|
|
build_rust.py
|
2021-11-09 11:22:47 -05:00
|
|
|
|
2022-04-27 09:03:44 -04:00
|
|
|
[mypy-synapse.metrics._reactor_metrics]
|
2023-11-06 08:31:22 -05:00
|
|
|
# This module pokes at the internals of OS-specific classes, to appease mypy
|
|
|
|
# on different systems we add additional ignores.
|
2022-04-27 09:03:44 -04:00
|
|
|
warn_unused_ignores = False
|
|
|
|
|
2022-05-19 08:49:58 -04:00
|
|
|
[mypy-synapse.util.caches.treecache]
|
|
|
|
disallow_untyped_defs = False
|
2023-05-31 07:18:29 -04:00
|
|
|
disallow_incomplete_defs = False
|
2021-10-08 10:25:16 -04:00
|
|
|
|
2023-08-15 12:07:13 -04:00
|
|
|
[mypy-synapse.util.manhole]
|
|
|
|
# This module imports something from Twisted which has a bad annotation in Twisted trunk,
|
|
|
|
# but is unannotated in Twisted's latest release. We want to type-ignore the problem
|
|
|
|
# in the twisted trunk job, even though it has no effect on normal mypy runs.
|
|
|
|
warn_unused_ignores = False
|
|
|
|
|
|
|
|
|
2021-10-08 09:49:41 -04:00
|
|
|
;; Dependencies without annotations
|
|
|
|
;; Before ignoring a module, check to see if type stubs are available.
|
|
|
|
;; The `typeshed` project maintains stubs here:
|
|
|
|
;; https://github.com/python/typeshed/tree/master/stubs
|
|
|
|
;; and for each package `foo` there's a corresponding `types-foo` package on PyPI,
|
2022-04-20 14:16:49 -04:00
|
|
|
;; which we can pull in as a dev dependency by adding to `pyproject.toml`'s
|
|
|
|
;; `[tool.poetry.dev-dependencies]` list.
|
2020-01-20 12:34:13 -05:00
|
|
|
|
2023-05-31 07:18:29 -04:00
|
|
|
# https://github.com/lepture/authlib/issues/460
|
2021-10-08 09:49:41 -04:00
|
|
|
[mypy-authlib.*]
|
2019-09-12 12:29:55 -04:00
|
|
|
ignore_missing_imports = True
|
|
|
|
|
2021-10-08 09:49:41 -04:00
|
|
|
[mypy-ijson.*]
|
2019-09-12 12:29:55 -04:00
|
|
|
ignore_missing_imports = True
|
|
|
|
|
2023-05-31 07:18:29 -04:00
|
|
|
# https://github.com/msgpack/msgpack-python/issues/448
|
2021-10-08 09:49:41 -04:00
|
|
|
[mypy-msgpack]
|
2019-09-12 12:29:55 -04:00
|
|
|
ignore_missing_imports = True
|
2019-10-10 04:39:35 -04:00
|
|
|
|
2023-05-31 07:18:29 -04:00
|
|
|
# https://github.com/wolever/parameterized/issues/143
|
2021-11-09 14:04:53 -05:00
|
|
|
[mypy-parameterized.*]
|
|
|
|
ignore_missing_imports = True
|
|
|
|
|
2021-10-08 09:49:41 -04:00
|
|
|
[mypy-pymacaroons.*]
|
2020-01-20 12:38:21 -05:00
|
|
|
ignore_missing_imports = True
|
|
|
|
|
2021-10-08 09:49:41 -04:00
|
|
|
[mypy-pympler.*]
|
2020-01-20 12:38:21 -05:00
|
|
|
ignore_missing_imports = True
|
2020-05-08 08:30:40 -04:00
|
|
|
|
2023-10-04 13:53:04 -04:00
|
|
|
[mypy-pyperf.*]
|
|
|
|
ignore_missing_imports = True
|
|
|
|
|
2021-10-08 09:49:41 -04:00
|
|
|
[mypy-rust_python_jaeger_reporter.*]
|
2020-05-08 08:30:40 -04:00
|
|
|
ignore_missing_imports = True
|
2020-06-17 09:13:41 -04:00
|
|
|
|
2021-10-08 09:49:41 -04:00
|
|
|
[mypy-saml2.*]
|
2020-06-17 09:13:41 -04:00
|
|
|
ignore_missing_imports = True
|
2020-08-12 10:05:50 -04:00
|
|
|
|
2022-04-27 09:10:31 -04:00
|
|
|
[mypy-srvlookup.*]
|
|
|
|
ignore_missing_imports = True
|
|
|
|
|
2023-05-31 07:18:29 -04:00
|
|
|
# https://github.com/twisted/treq/pull/366
|
2021-10-08 09:49:41 -04:00
|
|
|
[mypy-treq.*]
|
2021-05-05 11:54:36 -04:00
|
|
|
ignore_missing_imports = True
|