mypy.ini 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. [mypy]
  2. namespace_packages = True
  3. plugins = pydantic.mypy, mypy_zope:plugin, scripts-dev/mypy_synapse_plugin.py
  4. follow_imports = normal
  5. show_error_codes = True
  6. show_traceback = True
  7. mypy_path = stubs
  8. warn_unreachable = True
  9. local_partial_types = True
  10. no_implicit_optional = True
  11. # Strict checks, see mypy --help
  12. warn_unused_configs = True
  13. # disallow_any_generics = True
  14. disallow_subclassing_any = True
  15. # disallow_untyped_calls = True
  16. disallow_untyped_defs = True
  17. disallow_incomplete_defs = True
  18. # check_untyped_defs = True
  19. # disallow_untyped_decorators = True
  20. warn_redundant_casts = True
  21. warn_unused_ignores = True
  22. # warn_return_any = True
  23. # no_implicit_reexport = True
  24. strict_equality = True
  25. strict_concatenate = True
  26. # Run mypy type checking with the minimum supported Python version to catch new usage
  27. # that isn't backwards-compatible (types, overloads, etc).
  28. python_version = 3.8
  29. files =
  30. docker/,
  31. scripts-dev/,
  32. synapse/,
  33. tests/,
  34. build_rust.py
  35. [mypy-synapse.metrics._reactor_metrics]
  36. # This module imports select.epoll. That exists on Linux, but doesn't on macOS.
  37. # See https://github.com/matrix-org/synapse/pull/11771.
  38. warn_unused_ignores = False
  39. [mypy-synapse.util.caches.treecache]
  40. disallow_untyped_defs = False
  41. disallow_incomplete_defs = False
  42. ;; Dependencies without annotations
  43. ;; Before ignoring a module, check to see if type stubs are available.
  44. ;; The `typeshed` project maintains stubs here:
  45. ;; https://github.com/python/typeshed/tree/master/stubs
  46. ;; and for each package `foo` there's a corresponding `types-foo` package on PyPI,
  47. ;; which we can pull in as a dev dependency by adding to `pyproject.toml`'s
  48. ;; `[tool.poetry.dev-dependencies]` list.
  49. # https://github.com/lepture/authlib/issues/460
  50. [mypy-authlib.*]
  51. ignore_missing_imports = True
  52. [mypy-ijson.*]
  53. ignore_missing_imports = True
  54. # https://github.com/msgpack/msgpack-python/issues/448
  55. [mypy-msgpack]
  56. ignore_missing_imports = True
  57. # https://github.com/wolever/parameterized/issues/143
  58. [mypy-parameterized.*]
  59. ignore_missing_imports = True
  60. [mypy-pymacaroons.*]
  61. ignore_missing_imports = True
  62. [mypy-pympler.*]
  63. ignore_missing_imports = True
  64. [mypy-rust_python_jaeger_reporter.*]
  65. ignore_missing_imports = True
  66. [mypy-saml2.*]
  67. ignore_missing_imports = True
  68. [mypy-service_identity.*]
  69. ignore_missing_imports = True
  70. [mypy-srvlookup.*]
  71. ignore_missing_imports = True
  72. # https://github.com/twisted/treq/pull/366
  73. [mypy-treq.*]
  74. ignore_missing_imports = True
  75. [mypy-incremental.*]
  76. ignore_missing_imports = True
  77. [mypy-setuptools_rust.*]
  78. ignore_missing_imports = True