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.
 
 
 
 
 
 

123 lines
2.9 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.unittest]
  53. disallow_untyped_defs = False
  54. [mypy-tests.util.caches.test_descriptors]
  55. disallow_untyped_defs = False
  56. ;; Dependencies without annotations
  57. ;; Before ignoring a module, check to see if type stubs are available.
  58. ;; The `typeshed` project maintains stubs here:
  59. ;; https://github.com/python/typeshed/tree/master/stubs
  60. ;; and for each package `foo` there's a corresponding `types-foo` package on PyPI,
  61. ;; which we can pull in as a dev dependency by adding to `pyproject.toml`'s
  62. ;; `[tool.poetry.dev-dependencies]` list.
  63. [mypy-authlib.*]
  64. ignore_missing_imports = True
  65. [mypy-ijson.*]
  66. ignore_missing_imports = True
  67. [mypy-lxml]
  68. ignore_missing_imports = True
  69. [mypy-msgpack]
  70. ignore_missing_imports = True
  71. # Note: WIP stubs available at
  72. # https://github.com/microsoft/python-type-stubs/tree/64934207f523ad6b611e6cfe039d85d7175d7d0d/netaddr
  73. [mypy-netaddr]
  74. ignore_missing_imports = True
  75. [mypy-parameterized.*]
  76. ignore_missing_imports = True
  77. [mypy-pymacaroons.*]
  78. ignore_missing_imports = True
  79. [mypy-pympler.*]
  80. ignore_missing_imports = True
  81. [mypy-rust_python_jaeger_reporter.*]
  82. ignore_missing_imports = True
  83. [mypy-saml2.*]
  84. ignore_missing_imports = True
  85. [mypy-service_identity.*]
  86. ignore_missing_imports = True
  87. [mypy-srvlookup.*]
  88. ignore_missing_imports = True
  89. [mypy-treq.*]
  90. ignore_missing_imports = True
  91. [mypy-incremental.*]
  92. ignore_missing_imports = True
  93. [mypy-setuptools_rust.*]
  94. ignore_missing_imports = True