mypy.ini 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. # Run mypy type checking with the minimum supported Python version to catch new usage
  17. # that isn't backwards-compatible (types, overloads, etc).
  18. python_version = 3.8
  19. files =
  20. docker/,
  21. scripts-dev/,
  22. synapse/,
  23. tests/,
  24. build_rust.py
  25. [mypy-synapse.metrics._reactor_metrics]
  26. # This module imports select.epoll. That exists on Linux, but doesn't on macOS.
  27. # See https://github.com/matrix-org/synapse/pull/11771.
  28. warn_unused_ignores = False
  29. [mypy-synapse.util.caches.treecache]
  30. disallow_untyped_defs = False
  31. [mypy-tests.util.caches.test_descriptors]
  32. disallow_untyped_defs = False
  33. ;; Dependencies without annotations
  34. ;; Before ignoring a module, check to see if type stubs are available.
  35. ;; The `typeshed` project maintains stubs here:
  36. ;; https://github.com/python/typeshed/tree/master/stubs
  37. ;; and for each package `foo` there's a corresponding `types-foo` package on PyPI,
  38. ;; which we can pull in as a dev dependency by adding to `pyproject.toml`'s
  39. ;; `[tool.poetry.dev-dependencies]` list.
  40. [mypy-authlib.*]
  41. ignore_missing_imports = True
  42. [mypy-ijson.*]
  43. ignore_missing_imports = True
  44. [mypy-lxml]
  45. ignore_missing_imports = True
  46. [mypy-msgpack]
  47. ignore_missing_imports = True
  48. [mypy-parameterized.*]
  49. ignore_missing_imports = True
  50. [mypy-pymacaroons.*]
  51. ignore_missing_imports = True
  52. [mypy-pympler.*]
  53. ignore_missing_imports = True
  54. [mypy-rust_python_jaeger_reporter.*]
  55. ignore_missing_imports = True
  56. [mypy-saml2.*]
  57. ignore_missing_imports = True
  58. [mypy-service_identity.*]
  59. ignore_missing_imports = True
  60. [mypy-srvlookup.*]
  61. ignore_missing_imports = True
  62. [mypy-treq.*]
  63. ignore_missing_imports = True
  64. [mypy-incremental.*]
  65. ignore_missing_imports = True
  66. [mypy-setuptools_rust.*]
  67. ignore_missing_imports = True