mypy.ini 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. [mypy]
  2. namespace_packages = True
  3. plugins = pydantic.mypy, mypy_zope:plugin, scripts-dev/mypy_synapse_plugin.py
  4. follow_imports = normal
  5. check_untyped_defs = True
  6. show_error_codes = True
  7. show_traceback = True
  8. mypy_path = stubs
  9. warn_unreachable = True
  10. warn_unused_ignores = True
  11. local_partial_types = True
  12. no_implicit_optional = True
  13. disallow_untyped_defs = True
  14. strict_equality = True
  15. warn_redundant_casts = True
  16. files =
  17. docker/,
  18. scripts-dev/,
  19. synapse/,
  20. tests/,
  21. build_rust.py
  22. # Note: Better exclusion syntax coming in mypy > 0.910
  23. # https://github.com/python/mypy/pull/11329
  24. #
  25. # For now, set the (?x) flag enable "verbose" regexes
  26. # https://docs.python.org/3/library/re.html#re.X
  27. exclude = (?x)
  28. ^(
  29. |synapse/storage/databases/__init__.py
  30. |synapse/storage/databases/main/cache.py
  31. |synapse/storage/schema/
  32. )$
  33. [mypy-synapse.federation.transport.client]
  34. disallow_untyped_defs = False
  35. [mypy-synapse.http.matrixfederationclient]
  36. disallow_untyped_defs = False
  37. [mypy-synapse.metrics._reactor_metrics]
  38. disallow_untyped_defs = False
  39. # This module imports select.epoll. That exists on Linux, but doesn't on macOS.
  40. # See https://github.com/matrix-org/synapse/pull/11771.
  41. warn_unused_ignores = False
  42. [mypy-synapse.util.caches.treecache]
  43. disallow_untyped_defs = False
  44. [mypy-tests.util.caches.test_descriptors]
  45. disallow_untyped_defs = False
  46. ;; Dependencies without annotations
  47. ;; Before ignoring a module, check to see if type stubs are available.
  48. ;; The `typeshed` project maintains stubs here:
  49. ;; https://github.com/python/typeshed/tree/master/stubs
  50. ;; and for each package `foo` there's a corresponding `types-foo` package on PyPI,
  51. ;; which we can pull in as a dev dependency by adding to `pyproject.toml`'s
  52. ;; `[tool.poetry.dev-dependencies]` list.
  53. [mypy-authlib.*]
  54. ignore_missing_imports = True
  55. [mypy-ijson.*]
  56. ignore_missing_imports = True
  57. [mypy-lxml]
  58. ignore_missing_imports = True
  59. [mypy-msgpack]
  60. ignore_missing_imports = True
  61. [mypy-parameterized.*]
  62. ignore_missing_imports = True
  63. [mypy-pymacaroons.*]
  64. ignore_missing_imports = True
  65. [mypy-pympler.*]
  66. ignore_missing_imports = True
  67. [mypy-rust_python_jaeger_reporter.*]
  68. ignore_missing_imports = True
  69. [mypy-saml2.*]
  70. ignore_missing_imports = True
  71. [mypy-service_identity.*]
  72. ignore_missing_imports = True
  73. [mypy-srvlookup.*]
  74. ignore_missing_imports = True
  75. [mypy-treq.*]
  76. ignore_missing_imports = True
  77. [mypy-incremental.*]
  78. ignore_missing_imports = True
  79. [mypy-setuptools_rust.*]
  80. ignore_missing_imports = True