mypy.ini 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. [mypy-synapse.util.manhole]
  43. # This module imports something from Twisted which has a bad annotation in Twisted trunk,
  44. # but is unannotated in Twisted's latest release. We want to type-ignore the problem
  45. # in the twisted trunk job, even though it has no effect on normal mypy runs.
  46. warn_unused_ignores = False
  47. ;; Dependencies without annotations
  48. ;; Before ignoring a module, check to see if type stubs are available.
  49. ;; The `typeshed` project maintains stubs here:
  50. ;; https://github.com/python/typeshed/tree/master/stubs
  51. ;; and for each package `foo` there's a corresponding `types-foo` package on PyPI,
  52. ;; which we can pull in as a dev dependency by adding to `pyproject.toml`'s
  53. ;; `[tool.poetry.dev-dependencies]` list.
  54. # https://github.com/lepture/authlib/issues/460
  55. [mypy-authlib.*]
  56. ignore_missing_imports = True
  57. [mypy-ijson.*]
  58. ignore_missing_imports = True
  59. # https://github.com/msgpack/msgpack-python/issues/448
  60. [mypy-msgpack]
  61. ignore_missing_imports = True
  62. # https://github.com/wolever/parameterized/issues/143
  63. [mypy-parameterized.*]
  64. ignore_missing_imports = True
  65. [mypy-pymacaroons.*]
  66. ignore_missing_imports = True
  67. [mypy-pympler.*]
  68. ignore_missing_imports = True
  69. [mypy-rust_python_jaeger_reporter.*]
  70. ignore_missing_imports = True
  71. [mypy-saml2.*]
  72. ignore_missing_imports = True
  73. [mypy-service_identity.*]
  74. ignore_missing_imports = True
  75. [mypy-srvlookup.*]
  76. ignore_missing_imports = True
  77. # https://github.com/twisted/treq/pull/366
  78. [mypy-treq.*]
  79. ignore_missing_imports = True
  80. [mypy-incremental.*]
  81. ignore_missing_imports = True
  82. [mypy-setuptools_rust.*]
  83. ignore_missing_imports = True