mypy.ini 2.7 KB

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