mypy.ini 7.9 KB

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