mypy.ini 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. [mypy]
  2. namespace_packages = True
  3. plugins = 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. files =
  14. docker/,
  15. scripts-dev/,
  16. synapse/,
  17. tests/
  18. # Note: Better exclusion syntax coming in mypy > 0.910
  19. # https://github.com/python/mypy/pull/11329
  20. #
  21. # For now, set the (?x) flag enable "verbose" regexes
  22. # https://docs.python.org/3/library/re.html#re.X
  23. exclude = (?x)
  24. ^(
  25. |synapse/storage/databases/__init__.py
  26. |synapse/storage/databases/main/cache.py
  27. |synapse/storage/databases/main/devices.py
  28. |synapse/storage/databases/main/event_federation.py
  29. |synapse/storage/databases/main/push_rule.py
  30. |synapse/storage/databases/main/roommember.py
  31. |synapse/storage/schema/
  32. |tests/api/test_auth.py
  33. |tests/api/test_ratelimiting.py
  34. |tests/app/test_openid_listener.py
  35. |tests/appservice/test_scheduler.py
  36. |tests/config/test_cache.py
  37. |tests/config/test_tls.py
  38. |tests/crypto/test_keyring.py
  39. |tests/events/test_presence_router.py
  40. |tests/events/test_utils.py
  41. |tests/federation/test_federation_catch_up.py
  42. |tests/federation/test_federation_sender.py
  43. |tests/federation/test_federation_server.py
  44. |tests/federation/transport/test_knocking.py
  45. |tests/federation/transport/test_server.py
  46. |tests/handlers/test_typing.py
  47. |tests/http/federation/test_matrix_federation_agent.py
  48. |tests/http/federation/test_srv_resolver.py
  49. |tests/http/test_fedclient.py
  50. |tests/http/test_proxyagent.py
  51. |tests/http/test_servlet.py
  52. |tests/http/test_site.py
  53. |tests/logging/__init__.py
  54. |tests/logging/test_terse_json.py
  55. |tests/module_api/test_api.py
  56. |tests/push/test_email.py
  57. |tests/push/test_presentable_names.py
  58. |tests/push/test_push_rule_evaluator.py
  59. |tests/rest/client/test_transactions.py
  60. |tests/rest/media/v1/test_media_storage.py
  61. |tests/scripts/test_new_matrix_user.py
  62. |tests/server.py
  63. |tests/server_notices/test_resource_limits_server_notices.py
  64. |tests/state/test_v2.py
  65. |tests/storage/test_base.py
  66. |tests/storage/test_roommember.py
  67. |tests/test_metrics.py
  68. |tests/test_server.py
  69. |tests/test_state.py
  70. |tests/test_terms_auth.py
  71. |tests/util/caches/test_cached_call.py
  72. |tests/util/caches/test_deferred_cache.py
  73. |tests/util/caches/test_descriptors.py
  74. |tests/util/caches/test_response_cache.py
  75. |tests/util/caches/test_ttlcache.py
  76. |tests/util/test_async_helpers.py
  77. |tests/util/test_batching_queue.py
  78. |tests/util/test_dict_cache.py
  79. |tests/util/test_expiring_cache.py
  80. |tests/util/test_file_consumer.py
  81. |tests/util/test_linearizer.py
  82. |tests/util/test_logcontext.py
  83. |tests/util/test_lrucache.py
  84. |tests/util/test_rwlock.py
  85. |tests/util/test_wheel_timer.py
  86. |tests/utils.py
  87. )$
  88. [mypy-synapse._scripts.*]
  89. disallow_untyped_defs = True
  90. [mypy-synapse.api.*]
  91. disallow_untyped_defs = True
  92. [mypy-synapse.app.*]
  93. disallow_untyped_defs = True
  94. [mypy-synapse.appservice.*]
  95. disallow_untyped_defs = True
  96. [mypy-synapse.config.*]
  97. disallow_untyped_defs = True
  98. [mypy-synapse.crypto.*]
  99. disallow_untyped_defs = True
  100. [mypy-synapse.event_auth]
  101. disallow_untyped_defs = True
  102. [mypy-synapse.events.*]
  103. disallow_untyped_defs = True
  104. [mypy-synapse.federation.*]
  105. disallow_untyped_defs = True
  106. [mypy-synapse.federation.transport.client]
  107. disallow_untyped_defs = False
  108. [mypy-synapse.groups.*]
  109. disallow_untyped_defs = True
  110. [mypy-synapse.handlers.*]
  111. disallow_untyped_defs = True
  112. [mypy-synapse.http.federation.*]
  113. disallow_untyped_defs = True
  114. [mypy-synapse.http.connectproxyclient]
  115. disallow_untyped_defs = True
  116. [mypy-synapse.http.proxyagent]
  117. disallow_untyped_defs = True
  118. [mypy-synapse.http.request_metrics]
  119. disallow_untyped_defs = True
  120. [mypy-synapse.http.server]
  121. disallow_untyped_defs = True
  122. [mypy-synapse.logging._remote]
  123. disallow_untyped_defs = True
  124. [mypy-synapse.logging.context]
  125. disallow_untyped_defs = True
  126. [mypy-synapse.logging.formatter]
  127. disallow_untyped_defs = True
  128. [mypy-synapse.logging.handlers]
  129. disallow_untyped_defs = True
  130. [mypy-synapse.metrics.*]
  131. disallow_untyped_defs = True
  132. [mypy-synapse.metrics._reactor_metrics]
  133. # This module imports select.epoll. That exists on Linux, but doesn't on macOS.
  134. # See https://github.com/matrix-org/synapse/pull/11771.
  135. warn_unused_ignores = False
  136. [mypy-synapse.module_api.*]
  137. disallow_untyped_defs = True
  138. [mypy-synapse.notifier]
  139. disallow_untyped_defs = True
  140. [mypy-synapse.push.*]
  141. disallow_untyped_defs = True
  142. [mypy-synapse.replication.*]
  143. disallow_untyped_defs = True
  144. [mypy-synapse.rest.*]
  145. disallow_untyped_defs = True
  146. [mypy-synapse.server_notices.*]
  147. disallow_untyped_defs = True
  148. [mypy-synapse.state.*]
  149. disallow_untyped_defs = True
  150. [mypy-synapse.storage.databases.background_updates]
  151. disallow_untyped_defs = True
  152. [mypy-synapse.storage.databases.main.account_data]
  153. disallow_untyped_defs = True
  154. [mypy-synapse.storage.databases.main.client_ips]
  155. disallow_untyped_defs = True
  156. [mypy-synapse.storage.databases.main.directory]
  157. disallow_untyped_defs = True
  158. [mypy-synapse.storage.databases.main.e2e_room_keys]
  159. disallow_untyped_defs = True
  160. [mypy-synapse.storage.databases.main.end_to_end_keys]
  161. disallow_untyped_defs = True
  162. [mypy-synapse.storage.databases.main.event_push_actions]
  163. disallow_untyped_defs = True
  164. [mypy-synapse.storage.databases.main.events_bg_updates]
  165. disallow_untyped_defs = True
  166. [mypy-synapse.storage.databases.main.events_worker]
  167. disallow_untyped_defs = True
  168. [mypy-synapse.storage.databases.main.room]
  169. disallow_untyped_defs = True
  170. [mypy-synapse.storage.databases.main.room_batch]
  171. disallow_untyped_defs = True
  172. [mypy-synapse.storage.databases.main.profile]
  173. disallow_untyped_defs = True
  174. [mypy-synapse.storage.databases.main.stats]
  175. disallow_untyped_defs = True
  176. [mypy-synapse.storage.databases.main.state_deltas]
  177. disallow_untyped_defs = True
  178. [mypy-synapse.storage.databases.main.stream]
  179. disallow_untyped_defs = True
  180. [mypy-synapse.storage.databases.main.transactions]
  181. disallow_untyped_defs = True
  182. [mypy-synapse.storage.databases.main.user_erasure_store]
  183. disallow_untyped_defs = True
  184. [mypy-synapse.storage.engines.*]
  185. disallow_untyped_defs = True
  186. [mypy-synapse.storage.prepare_database]
  187. disallow_untyped_defs = True
  188. [mypy-synapse.storage.persist_events]
  189. disallow_untyped_defs = True
  190. [mypy-synapse.storage.state]
  191. disallow_untyped_defs = True
  192. [mypy-synapse.storage.types]
  193. disallow_untyped_defs = True
  194. [mypy-synapse.storage.util.*]
  195. disallow_untyped_defs = True
  196. [mypy-synapse.streams.*]
  197. disallow_untyped_defs = True
  198. [mypy-synapse.types]
  199. disallow_untyped_defs = True
  200. [mypy-synapse.util.*]
  201. disallow_untyped_defs = True
  202. [mypy-synapse.util.caches.treecache]
  203. disallow_untyped_defs = False
  204. [mypy-tests.handlers.test_user_directory]
  205. disallow_untyped_defs = True
  206. [mypy-tests.storage.test_profile]
  207. disallow_untyped_defs = True
  208. [mypy-tests.storage.test_user_directory]
  209. disallow_untyped_defs = True
  210. [mypy-tests.rest.*]
  211. disallow_untyped_defs = True
  212. [mypy-tests.federation.transport.test_client]
  213. disallow_untyped_defs = True
  214. ;; Dependencies without annotations
  215. ;; Before ignoring a module, check to see if type stubs are available.
  216. ;; The `typeshed` project maintains stubs here:
  217. ;; https://github.com/python/typeshed/tree/master/stubs
  218. ;; and for each package `foo` there's a corresponding `types-foo` package on PyPI,
  219. ;; which we can pull in as a dev dependency by adding to `pyproject.toml`'s
  220. ;; `[tool.poetry.dev-dependencies]` list.
  221. [mypy-authlib.*]
  222. ignore_missing_imports = True
  223. [mypy-canonicaljson]
  224. ignore_missing_imports = True
  225. [mypy-ijson.*]
  226. ignore_missing_imports = True
  227. [mypy-lxml]
  228. ignore_missing_imports = True
  229. [mypy-msgpack]
  230. ignore_missing_imports = True
  231. # Note: WIP stubs available at
  232. # https://github.com/microsoft/python-type-stubs/tree/64934207f523ad6b611e6cfe039d85d7175d7d0d/netaddr
  233. [mypy-netaddr]
  234. ignore_missing_imports = True
  235. [mypy-parameterized.*]
  236. ignore_missing_imports = True
  237. [mypy-pymacaroons.*]
  238. ignore_missing_imports = True
  239. [mypy-pympler.*]
  240. ignore_missing_imports = True
  241. [mypy-rust_python_jaeger_reporter.*]
  242. ignore_missing_imports = True
  243. [mypy-saml2.*]
  244. ignore_missing_imports = True
  245. [mypy-service_identity.*]
  246. ignore_missing_imports = True
  247. [mypy-srvlookup.*]
  248. ignore_missing_imports = True
  249. [mypy-treq.*]
  250. ignore_missing_imports = True
  251. [mypy-incremental.*]
  252. ignore_missing_imports = True