mypy.ini 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  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/sign_json,
  14. setup.py,
  15. synapse/,
  16. tests/
  17. # Note: Better exclusion syntax coming in mypy > 0.910
  18. # https://github.com/python/mypy/pull/11329
  19. #
  20. # For now, set the (?x) flag enable "verbose" regexes
  21. # https://docs.python.org/3/library/re.html#re.X
  22. exclude = (?x)
  23. ^(
  24. |synapse/_scripts/register_new_matrix_user.py
  25. |synapse/_scripts/review_recent_signups.py
  26. |synapse/app/__init__.py
  27. |synapse/app/_base.py
  28. |synapse/app/admin_cmd.py
  29. |synapse/app/appservice.py
  30. |synapse/app/client_reader.py
  31. |synapse/app/event_creator.py
  32. |synapse/app/federation_reader.py
  33. |synapse/app/federation_sender.py
  34. |synapse/app/frontend_proxy.py
  35. |synapse/app/generic_worker.py
  36. |synapse/app/homeserver.py
  37. |synapse/app/media_repository.py
  38. |synapse/app/phone_stats_home.py
  39. |synapse/app/pusher.py
  40. |synapse/app/synchrotron.py
  41. |synapse/app/user_dir.py
  42. |synapse/storage/databases/__init__.py
  43. |synapse/storage/databases/main/__init__.py
  44. |synapse/storage/databases/main/account_data.py
  45. |synapse/storage/databases/main/cache.py
  46. |synapse/storage/databases/main/censor_events.py
  47. |synapse/storage/databases/main/deviceinbox.py
  48. |synapse/storage/databases/main/devices.py
  49. |synapse/storage/databases/main/directory.py
  50. |synapse/storage/databases/main/e2e_room_keys.py
  51. |synapse/storage/databases/main/end_to_end_keys.py
  52. |synapse/storage/databases/main/event_federation.py
  53. |synapse/storage/databases/main/event_push_actions.py
  54. |synapse/storage/databases/main/events_bg_updates.py
  55. |synapse/storage/databases/main/events_forward_extremities.py
  56. |synapse/storage/databases/main/events_worker.py
  57. |synapse/storage/databases/main/filtering.py
  58. |synapse/storage/databases/main/group_server.py
  59. |synapse/storage/databases/main/lock.py
  60. |synapse/storage/databases/main/media_repository.py
  61. |synapse/storage/databases/main/metrics.py
  62. |synapse/storage/databases/main/monthly_active_users.py
  63. |synapse/storage/databases/main/openid.py
  64. |synapse/storage/databases/main/presence.py
  65. |synapse/storage/databases/main/profile.py
  66. |synapse/storage/databases/main/purge_events.py
  67. |synapse/storage/databases/main/push_rule.py
  68. |synapse/storage/databases/main/receipts.py
  69. |synapse/storage/databases/main/rejections.py
  70. |synapse/storage/databases/main/room.py
  71. |synapse/storage/databases/main/room_batch.py
  72. |synapse/storage/databases/main/roommember.py
  73. |synapse/storage/databases/main/search.py
  74. |synapse/storage/databases/main/signatures.py
  75. |synapse/storage/databases/main/state.py
  76. |synapse/storage/databases/main/state_deltas.py
  77. |synapse/storage/databases/main/stats.py
  78. |synapse/storage/databases/main/tags.py
  79. |synapse/storage/databases/main/transactions.py
  80. |synapse/storage/databases/main/user_directory.py
  81. |synapse/storage/databases/main/user_erasure_store.py
  82. |synapse/storage/schema/
  83. |tests/api/test_auth.py
  84. |tests/api/test_ratelimiting.py
  85. |tests/app/test_openid_listener.py
  86. |tests/appservice/test_scheduler.py
  87. |tests/config/test_cache.py
  88. |tests/config/test_tls.py
  89. |tests/crypto/test_keyring.py
  90. |tests/events/test_presence_router.py
  91. |tests/events/test_utils.py
  92. |tests/federation/test_federation_catch_up.py
  93. |tests/federation/test_federation_sender.py
  94. |tests/federation/test_federation_server.py
  95. |tests/federation/transport/test_knocking.py
  96. |tests/federation/transport/test_server.py
  97. |tests/handlers/test_cas.py
  98. |tests/handlers/test_directory.py
  99. |tests/handlers/test_e2e_keys.py
  100. |tests/handlers/test_federation.py
  101. |tests/handlers/test_oidc.py
  102. |tests/handlers/test_presence.py
  103. |tests/handlers/test_profile.py
  104. |tests/handlers/test_saml.py
  105. |tests/handlers/test_typing.py
  106. |tests/http/federation/test_matrix_federation_agent.py
  107. |tests/http/federation/test_srv_resolver.py
  108. |tests/http/test_fedclient.py
  109. |tests/http/test_proxyagent.py
  110. |tests/http/test_servlet.py
  111. |tests/http/test_site.py
  112. |tests/logging/__init__.py
  113. |tests/logging/test_terse_json.py
  114. |tests/module_api/test_api.py
  115. |tests/push/test_email.py
  116. |tests/push/test_http.py
  117. |tests/push/test_presentable_names.py
  118. |tests/push/test_push_rule_evaluator.py
  119. |tests/rest/admin/test_admin.py
  120. |tests/rest/admin/test_device.py
  121. |tests/rest/admin/test_media.py
  122. |tests/rest/admin/test_server_notice.py
  123. |tests/rest/admin/test_user.py
  124. |tests/rest/admin/test_username_available.py
  125. |tests/rest/client/test_account.py
  126. |tests/rest/client/test_events.py
  127. |tests/rest/client/test_filter.py
  128. |tests/rest/client/test_groups.py
  129. |tests/rest/client/test_register.py
  130. |tests/rest/client/test_report_event.py
  131. |tests/rest/client/test_rooms.py
  132. |tests/rest/client/test_third_party_rules.py
  133. |tests/rest/client/test_transactions.py
  134. |tests/rest/client/test_typing.py
  135. |tests/rest/client/utils.py
  136. |tests/rest/key/v2/test_remote_key_resource.py
  137. |tests/rest/media/v1/test_base.py
  138. |tests/rest/media/v1/test_media_storage.py
  139. |tests/rest/media/v1/test_url_preview.py
  140. |tests/scripts/test_new_matrix_user.py
  141. |tests/server.py
  142. |tests/server_notices/test_resource_limits_server_notices.py
  143. |tests/state/test_v2.py
  144. |tests/storage/test_account_data.py
  145. |tests/storage/test_appservice.py
  146. |tests/storage/test_background_update.py
  147. |tests/storage/test_base.py
  148. |tests/storage/test_client_ips.py
  149. |tests/storage/test_database.py
  150. |tests/storage/test_event_federation.py
  151. |tests/storage/test_id_generators.py
  152. |tests/storage/test_roommember.py
  153. |tests/test_metrics.py
  154. |tests/test_phone_home.py
  155. |tests/test_server.py
  156. |tests/test_state.py
  157. |tests/test_terms_auth.py
  158. |tests/test_visibility.py
  159. |tests/unittest.py
  160. |tests/util/caches/test_cached_call.py
  161. |tests/util/caches/test_deferred_cache.py
  162. |tests/util/caches/test_descriptors.py
  163. |tests/util/caches/test_response_cache.py
  164. |tests/util/caches/test_ttlcache.py
  165. |tests/util/test_async_helpers.py
  166. |tests/util/test_batching_queue.py
  167. |tests/util/test_dict_cache.py
  168. |tests/util/test_expiring_cache.py
  169. |tests/util/test_file_consumer.py
  170. |tests/util/test_linearizer.py
  171. |tests/util/test_logcontext.py
  172. |tests/util/test_lrucache.py
  173. |tests/util/test_rwlock.py
  174. |tests/util/test_wheel_timer.py
  175. |tests/utils.py
  176. )$
  177. [mypy-synapse.api.*]
  178. disallow_untyped_defs = True
  179. [mypy-synapse.crypto.*]
  180. disallow_untyped_defs = True
  181. [mypy-synapse.events.*]
  182. disallow_untyped_defs = True
  183. [mypy-synapse.handlers.*]
  184. disallow_untyped_defs = True
  185. [mypy-synapse.push.*]
  186. disallow_untyped_defs = True
  187. [mypy-synapse.rest.*]
  188. disallow_untyped_defs = True
  189. [mypy-synapse.server_notices.*]
  190. disallow_untyped_defs = True
  191. [mypy-synapse.state.*]
  192. disallow_untyped_defs = True
  193. [mypy-synapse.storage.databases.main.client_ips]
  194. disallow_untyped_defs = True
  195. [mypy-synapse.storage.util.*]
  196. disallow_untyped_defs = True
  197. [mypy-synapse.streams.*]
  198. disallow_untyped_defs = True
  199. [mypy-synapse.util.batching_queue]
  200. disallow_untyped_defs = True
  201. [mypy-synapse.util.caches.cached_call]
  202. disallow_untyped_defs = True
  203. [mypy-synapse.util.caches.dictionary_cache]
  204. disallow_untyped_defs = True
  205. [mypy-synapse.util.caches.lrucache]
  206. disallow_untyped_defs = True
  207. [mypy-synapse.util.caches.response_cache]
  208. disallow_untyped_defs = True
  209. [mypy-synapse.util.caches.stream_change_cache]
  210. disallow_untyped_defs = True
  211. [mypy-synapse.util.caches.ttl_cache]
  212. disallow_untyped_defs = True
  213. [mypy-synapse.util.daemonize]
  214. disallow_untyped_defs = True
  215. [mypy-synapse.util.file_consumer]
  216. disallow_untyped_defs = True
  217. [mypy-synapse.util.frozenutils]
  218. disallow_untyped_defs = True
  219. [mypy-synapse.util.hash]
  220. disallow_untyped_defs = True
  221. [mypy-synapse.util.httpresourcetree]
  222. disallow_untyped_defs = True
  223. [mypy-synapse.util.iterutils]
  224. disallow_untyped_defs = True
  225. [mypy-synapse.util.linked_list]
  226. disallow_untyped_defs = True
  227. [mypy-synapse.util.logcontext]
  228. disallow_untyped_defs = True
  229. [mypy-synapse.util.logformatter]
  230. disallow_untyped_defs = True
  231. [mypy-synapse.util.macaroons]
  232. disallow_untyped_defs = True
  233. [mypy-synapse.util.manhole]
  234. disallow_untyped_defs = True
  235. [mypy-synapse.util.module_loader]
  236. disallow_untyped_defs = True
  237. [mypy-synapse.util.msisdn]
  238. disallow_untyped_defs = True
  239. [mypy-synapse.util.patch_inline_callbacks]
  240. disallow_untyped_defs = True
  241. [mypy-synapse.util.ratelimitutils]
  242. disallow_untyped_defs = True
  243. [mypy-synapse.util.retryutils]
  244. disallow_untyped_defs = True
  245. [mypy-synapse.util.rlimit]
  246. disallow_untyped_defs = True
  247. [mypy-synapse.util.stringutils]
  248. disallow_untyped_defs = True
  249. [mypy-synapse.util.templates]
  250. disallow_untyped_defs = True
  251. [mypy-synapse.util.threepids]
  252. disallow_untyped_defs = True
  253. [mypy-synapse.util.wheel_timer]
  254. disallow_untyped_defs = True
  255. [mypy-synapse.util.versionstring]
  256. disallow_untyped_defs = True
  257. [mypy-tests.handlers.test_user_directory]
  258. disallow_untyped_defs = True
  259. [mypy-tests.storage.test_user_directory]
  260. disallow_untyped_defs = True
  261. ;; Dependencies without annotations
  262. ;; Before ignoring a module, check to see if type stubs are available.
  263. ;; The `typeshed` project maintains stubs here:
  264. ;; https://github.com/python/typeshed/tree/master/stubs
  265. ;; and for each package `foo` there's a corresponding `types-foo` package on PyPI,
  266. ;; which we can pull in as a dev dependency by adding to `setup.py`'s
  267. ;; `CONDITIONAL_REQUIREMENTS["mypy"]` list.
  268. [mypy-authlib.*]
  269. ignore_missing_imports = True
  270. [mypy-bcrypt]
  271. ignore_missing_imports = True
  272. [mypy-canonicaljson]
  273. ignore_missing_imports = True
  274. [mypy-constantly]
  275. ignore_missing_imports = True
  276. [mypy-daemonize]
  277. ignore_missing_imports = True
  278. [mypy-h11]
  279. ignore_missing_imports = True
  280. [mypy-hiredis]
  281. ignore_missing_imports = True
  282. [mypy-hyperlink]
  283. ignore_missing_imports = True
  284. [mypy-ijson.*]
  285. ignore_missing_imports = True
  286. [mypy-jaeger_client.*]
  287. ignore_missing_imports = True
  288. [mypy-josepy.*]
  289. ignore_missing_imports = True
  290. [mypy-jwt.*]
  291. ignore_missing_imports = True
  292. [mypy-lxml]
  293. ignore_missing_imports = True
  294. [mypy-msgpack]
  295. ignore_missing_imports = True
  296. [mypy-nacl.*]
  297. ignore_missing_imports = True
  298. [mypy-netaddr]
  299. ignore_missing_imports = True
  300. [mypy-opentracing]
  301. ignore_missing_imports = True
  302. [mypy-parameterized.*]
  303. ignore_missing_imports = True
  304. [mypy-phonenumbers.*]
  305. ignore_missing_imports = True
  306. [mypy-prometheus_client.*]
  307. ignore_missing_imports = True
  308. [mypy-pymacaroons.*]
  309. ignore_missing_imports = True
  310. [mypy-pympler.*]
  311. ignore_missing_imports = True
  312. [mypy-rust_python_jaeger_reporter.*]
  313. ignore_missing_imports = True
  314. [mypy-saml2.*]
  315. ignore_missing_imports = True
  316. [mypy-sentry_sdk]
  317. ignore_missing_imports = True
  318. [mypy-service_identity.*]
  319. ignore_missing_imports = True
  320. [mypy-signedjson.*]
  321. ignore_missing_imports = True
  322. [mypy-treq.*]
  323. ignore_missing_imports = True
  324. [mypy-twisted.*]
  325. ignore_missing_imports = True
  326. [mypy-zope]
  327. ignore_missing_imports = True