mypy.ini 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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.client]
  36. disallow_untyped_defs = False
  37. [mypy-synapse.http.matrixfederationclient]
  38. disallow_untyped_defs = False
  39. [mypy-synapse.metrics._reactor_metrics]
  40. disallow_untyped_defs = False
  41. # This module imports select.epoll. That exists on Linux, but doesn't on macOS.
  42. # See https://github.com/matrix-org/synapse/pull/11771.
  43. warn_unused_ignores = False
  44. [mypy-synapse.util.caches.treecache]
  45. disallow_untyped_defs = False
  46. [mypy-synapse.storage.database]
  47. disallow_untyped_defs = False
  48. [mypy-tests.util.caches.test_descriptors]
  49. disallow_untyped_defs = False
  50. ;; Dependencies without annotations
  51. ;; Before ignoring a module, check to see if type stubs are available.
  52. ;; The `typeshed` project maintains stubs here:
  53. ;; https://github.com/python/typeshed/tree/master/stubs
  54. ;; and for each package `foo` there's a corresponding `types-foo` package on PyPI,
  55. ;; which we can pull in as a dev dependency by adding to `pyproject.toml`'s
  56. ;; `[tool.poetry.dev-dependencies]` list.
  57. [mypy-authlib.*]
  58. ignore_missing_imports = True
  59. [mypy-ijson.*]
  60. ignore_missing_imports = True
  61. [mypy-lxml]
  62. ignore_missing_imports = True
  63. [mypy-msgpack]
  64. ignore_missing_imports = True
  65. # Note: WIP stubs available at
  66. # https://github.com/microsoft/python-type-stubs/tree/64934207f523ad6b611e6cfe039d85d7175d7d0d/netaddr
  67. [mypy-netaddr]
  68. ignore_missing_imports = True
  69. [mypy-parameterized.*]
  70. ignore_missing_imports = True
  71. [mypy-pymacaroons.*]
  72. ignore_missing_imports = True
  73. [mypy-pympler.*]
  74. ignore_missing_imports = True
  75. [mypy-rust_python_jaeger_reporter.*]
  76. ignore_missing_imports = True
  77. [mypy-saml2.*]
  78. ignore_missing_imports = True
  79. [mypy-service_identity.*]
  80. ignore_missing_imports = True
  81. [mypy-srvlookup.*]
  82. ignore_missing_imports = True
  83. [mypy-treq.*]
  84. ignore_missing_imports = True
  85. [mypy-incremental.*]
  86. ignore_missing_imports = True
  87. [mypy-setuptools_rust.*]
  88. ignore_missing_imports = True