You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

141 lines
3.3 KiB

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