mypy.ini 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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-srvlookup.*]
  74. ignore_missing_imports = True
  75. # https://github.com/twisted/treq/pull/366
  76. [mypy-treq.*]
  77. ignore_missing_imports = True