1
0

mypy.ini 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  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/storage/databases/__init__.py
  25. |synapse/storage/databases/main/__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/group_server.py
  30. |synapse/storage/databases/main/metrics.py
  31. |synapse/storage/databases/main/monthly_active_users.py
  32. |synapse/storage/databases/main/presence.py
  33. |synapse/storage/databases/main/purge_events.py
  34. |synapse/storage/databases/main/push_rule.py
  35. |synapse/storage/databases/main/receipts.py
  36. |synapse/storage/databases/main/roommember.py
  37. |synapse/storage/databases/main/search.py
  38. |synapse/storage/databases/main/state.py
  39. |synapse/storage/databases/main/user_directory.py
  40. |synapse/storage/schema/
  41. |tests/api/test_auth.py
  42. |tests/api/test_ratelimiting.py
  43. |tests/app/test_openid_listener.py
  44. |tests/appservice/test_scheduler.py
  45. |tests/config/test_cache.py
  46. |tests/config/test_tls.py
  47. |tests/crypto/test_keyring.py
  48. |tests/events/test_presence_router.py
  49. |tests/events/test_utils.py
  50. |tests/federation/test_federation_catch_up.py
  51. |tests/federation/test_federation_sender.py
  52. |tests/federation/test_federation_server.py
  53. |tests/federation/transport/test_knocking.py
  54. |tests/federation/transport/test_server.py
  55. |tests/handlers/test_cas.py
  56. |tests/handlers/test_directory.py
  57. |tests/handlers/test_e2e_keys.py
  58. |tests/handlers/test_federation.py
  59. |tests/handlers/test_oidc.py
  60. |tests/handlers/test_presence.py
  61. |tests/handlers/test_profile.py
  62. |tests/handlers/test_saml.py
  63. |tests/handlers/test_typing.py
  64. |tests/http/federation/test_matrix_federation_agent.py
  65. |tests/http/federation/test_srv_resolver.py
  66. |tests/http/test_fedclient.py
  67. |tests/http/test_proxyagent.py
  68. |tests/http/test_servlet.py
  69. |tests/http/test_site.py
  70. |tests/logging/__init__.py
  71. |tests/logging/test_terse_json.py
  72. |tests/module_api/test_api.py
  73. |tests/push/test_email.py
  74. |tests/push/test_http.py
  75. |tests/push/test_presentable_names.py
  76. |tests/push/test_push_rule_evaluator.py
  77. |tests/rest/admin/test_admin.py
  78. |tests/rest/admin/test_user.py
  79. |tests/rest/admin/test_username_available.py
  80. |tests/rest/client/test_account.py
  81. |tests/rest/client/test_events.py
  82. |tests/rest/client/test_filter.py
  83. |tests/rest/client/test_groups.py
  84. |tests/rest/client/test_register.py
  85. |tests/rest/client/test_report_event.py
  86. |tests/rest/client/test_rooms.py
  87. |tests/rest/client/test_third_party_rules.py
  88. |tests/rest/client/test_transactions.py
  89. |tests/rest/client/test_typing.py
  90. |tests/rest/client/utils.py
  91. |tests/rest/key/v2/test_remote_key_resource.py
  92. |tests/rest/media/v1/test_base.py
  93. |tests/rest/media/v1/test_media_storage.py
  94. |tests/rest/media/v1/test_url_preview.py
  95. |tests/scripts/test_new_matrix_user.py
  96. |tests/server.py
  97. |tests/server_notices/test_resource_limits_server_notices.py
  98. |tests/state/test_v2.py
  99. |tests/storage/test_background_update.py
  100. |tests/storage/test_base.py
  101. |tests/storage/test_client_ips.py
  102. |tests/storage/test_database.py
  103. |tests/storage/test_event_federation.py
  104. |tests/storage/test_id_generators.py
  105. |tests/storage/test_roommember.py
  106. |tests/test_metrics.py
  107. |tests/test_phone_home.py
  108. |tests/test_server.py
  109. |tests/test_state.py
  110. |tests/test_terms_auth.py
  111. |tests/unittest.py
  112. |tests/util/caches/test_cached_call.py
  113. |tests/util/caches/test_deferred_cache.py
  114. |tests/util/caches/test_descriptors.py
  115. |tests/util/caches/test_response_cache.py
  116. |tests/util/caches/test_ttlcache.py
  117. |tests/util/test_async_helpers.py
  118. |tests/util/test_batching_queue.py
  119. |tests/util/test_dict_cache.py
  120. |tests/util/test_expiring_cache.py
  121. |tests/util/test_file_consumer.py
  122. |tests/util/test_linearizer.py
  123. |tests/util/test_logcontext.py
  124. |tests/util/test_lrucache.py
  125. |tests/util/test_rwlock.py
  126. |tests/util/test_wheel_timer.py
  127. |tests/utils.py
  128. )$
  129. [mypy-synapse.api.*]
  130. disallow_untyped_defs = True
  131. [mypy-synapse.app.*]
  132. disallow_untyped_defs = True
  133. [mypy-synapse.appservice.*]
  134. disallow_untyped_defs = True
  135. [mypy-synapse.config._base]
  136. disallow_untyped_defs = True
  137. [mypy-synapse.crypto.*]
  138. disallow_untyped_defs = True
  139. [mypy-synapse.events.*]
  140. disallow_untyped_defs = True
  141. [mypy-synapse.federation.*]
  142. disallow_untyped_defs = True
  143. [mypy-synapse.federation.transport.client]
  144. disallow_untyped_defs = False
  145. [mypy-synapse.handlers.*]
  146. disallow_untyped_defs = True
  147. [mypy-synapse.http.server]
  148. disallow_untyped_defs = True
  149. [mypy-synapse.logging.context]
  150. disallow_untyped_defs = True
  151. [mypy-synapse.metrics.*]
  152. disallow_untyped_defs = True
  153. [mypy-synapse.module_api.*]
  154. disallow_untyped_defs = True
  155. [mypy-synapse.push.*]
  156. disallow_untyped_defs = True
  157. [mypy-synapse.rest.*]
  158. disallow_untyped_defs = True
  159. [mypy-synapse.server_notices.*]
  160. disallow_untyped_defs = True
  161. [mypy-synapse.state.*]
  162. disallow_untyped_defs = True
  163. [mypy-synapse.storage.databases.main.account_data]
  164. disallow_untyped_defs = True
  165. [mypy-synapse.storage.databases.main.client_ips]
  166. disallow_untyped_defs = True
  167. [mypy-synapse.storage.databases.main.directory]
  168. disallow_untyped_defs = True
  169. [mypy-synapse.storage.databases.main.e2e_room_keys]
  170. disallow_untyped_defs = True
  171. [mypy-synapse.storage.databases.main.end_to_end_keys]
  172. disallow_untyped_defs = True
  173. [mypy-synapse.storage.databases.main.event_push_actions]
  174. disallow_untyped_defs = True
  175. [mypy-synapse.storage.databases.main.events_bg_updates]
  176. disallow_untyped_defs = True
  177. [mypy-synapse.storage.databases.main.events_worker]
  178. disallow_untyped_defs = True
  179. [mypy-synapse.storage.databases.main.room]
  180. disallow_untyped_defs = True
  181. [mypy-synapse.storage.databases.main.room_batch]
  182. disallow_untyped_defs = True
  183. [mypy-synapse.storage.databases.main.profile]
  184. disallow_untyped_defs = True
  185. [mypy-synapse.storage.databases.main.stats]
  186. disallow_untyped_defs = True
  187. [mypy-synapse.storage.databases.main.state_deltas]
  188. disallow_untyped_defs = True
  189. [mypy-synapse.storage.databases.main.transactions]
  190. disallow_untyped_defs = True
  191. [mypy-synapse.storage.databases.main.user_erasure_store]
  192. disallow_untyped_defs = True
  193. [mypy-synapse.storage.util.*]
  194. disallow_untyped_defs = True
  195. [mypy-synapse.streams.*]
  196. disallow_untyped_defs = True
  197. [mypy-synapse.util.*]
  198. disallow_untyped_defs = True
  199. [mypy-synapse.util.caches.treecache]
  200. disallow_untyped_defs = False
  201. [mypy-tests.handlers.test_user_directory]
  202. disallow_untyped_defs = True
  203. [mypy-tests.storage.test_profile]
  204. disallow_untyped_defs = True
  205. [mypy-tests.storage.test_user_directory]
  206. disallow_untyped_defs = True
  207. [mypy-tests.rest.admin.*]
  208. disallow_untyped_defs = True
  209. [mypy-tests.rest.client.test_directory]
  210. disallow_untyped_defs = True
  211. [mypy-tests.federation.transport.test_client]
  212. disallow_untyped_defs = True
  213. ;; Dependencies without annotations
  214. ;; Before ignoring a module, check to see if type stubs are available.
  215. ;; The `typeshed` project maintains stubs here:
  216. ;; https://github.com/python/typeshed/tree/master/stubs
  217. ;; and for each package `foo` there's a corresponding `types-foo` package on PyPI,
  218. ;; which we can pull in as a dev dependency by adding to `setup.py`'s
  219. ;; `CONDITIONAL_REQUIREMENTS["mypy"]` list.
  220. [mypy-authlib.*]
  221. ignore_missing_imports = True
  222. [mypy-bcrypt]
  223. ignore_missing_imports = True
  224. [mypy-canonicaljson]
  225. ignore_missing_imports = True
  226. [mypy-constantly]
  227. ignore_missing_imports = True
  228. [mypy-daemonize]
  229. ignore_missing_imports = True
  230. [mypy-h11]
  231. ignore_missing_imports = True
  232. [mypy-hiredis]
  233. ignore_missing_imports = True
  234. [mypy-hyperlink]
  235. ignore_missing_imports = True
  236. [mypy-ijson.*]
  237. ignore_missing_imports = True
  238. [mypy-jaeger_client.*]
  239. ignore_missing_imports = True
  240. [mypy-josepy.*]
  241. ignore_missing_imports = True
  242. [mypy-jwt.*]
  243. ignore_missing_imports = True
  244. [mypy-lxml]
  245. ignore_missing_imports = True
  246. [mypy-msgpack]
  247. ignore_missing_imports = True
  248. [mypy-nacl.*]
  249. ignore_missing_imports = True
  250. [mypy-netaddr]
  251. ignore_missing_imports = True
  252. [mypy-parameterized.*]
  253. ignore_missing_imports = True
  254. [mypy-phonenumbers.*]
  255. ignore_missing_imports = True
  256. [mypy-prometheus_client.*]
  257. ignore_missing_imports = True
  258. [mypy-pymacaroons.*]
  259. ignore_missing_imports = True
  260. [mypy-pympler.*]
  261. ignore_missing_imports = True
  262. [mypy-rust_python_jaeger_reporter.*]
  263. ignore_missing_imports = True
  264. [mypy-saml2.*]
  265. ignore_missing_imports = True
  266. [mypy-sentry_sdk]
  267. ignore_missing_imports = True
  268. [mypy-service_identity.*]
  269. ignore_missing_imports = True
  270. [mypy-signedjson.*]
  271. ignore_missing_imports = True
  272. [mypy-treq.*]
  273. ignore_missing_imports = True
  274. [mypy-twisted.*]
  275. ignore_missing_imports = True
  276. [mypy-zope]
  277. ignore_missing_imports = True