pyproject-typing.toml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # pyproject.toml - Type checker configuration
  2. # Copy these sections to your pyproject.toml
  3. # ============================================================
  4. # mypy Configuration
  5. # ============================================================
  6. [tool.mypy]
  7. # Python version to target
  8. python_version = "3.11"
  9. # Enable strict mode (recommended for new projects)
  10. strict = true
  11. # Additional strictness
  12. warn_return_any = true
  13. warn_unused_ignores = true
  14. warn_unreachable = true
  15. # Error reporting
  16. show_error_codes = true
  17. show_error_context = true
  18. show_column_numbers = true
  19. pretty = true
  20. # Paths
  21. files = ["src", "tests"]
  22. exclude = [
  23. "migrations/",
  24. "venv/",
  25. ".venv/",
  26. "__pycache__/",
  27. "build/",
  28. "dist/",
  29. ]
  30. # Plugin support (uncomment as needed)
  31. # plugins = [
  32. # "pydantic.mypy",
  33. # "sqlalchemy.ext.mypy.plugin",
  34. # ]
  35. # ============================================================
  36. # Per-module overrides
  37. # ============================================================
  38. # Relax strictness for tests
  39. [[tool.mypy.overrides]]
  40. module = "tests.*"
  41. disallow_untyped_defs = false
  42. disallow_untyped_calls = false
  43. # Ignore missing stubs for common libraries
  44. [[tool.mypy.overrides]]
  45. module = [
  46. "requests.*",
  47. "boto3.*",
  48. "botocore.*",
  49. "celery.*",
  50. "redis.*",
  51. ]
  52. ignore_missing_imports = true
  53. # Legacy code - gradually add types
  54. # [[tool.mypy.overrides]]
  55. # module = "legacy.*"
  56. # ignore_errors = true
  57. # ============================================================
  58. # pyright Configuration
  59. # ============================================================
  60. [tool.pyright]
  61. # Python version
  62. pythonVersion = "3.11"
  63. # Paths
  64. include = ["src"]
  65. exclude = [
  66. "**/node_modules",
  67. "**/__pycache__",
  68. "venv",
  69. ".venv",
  70. "build",
  71. "dist",
  72. ]
  73. # Type checking mode: off, basic, standard, strict
  74. typeCheckingMode = "strict"
  75. # Report settings (strict mode enables all by default)
  76. reportMissingTypeStubs = false
  77. reportUnusedImport = "warning"
  78. reportUnusedVariable = "warning"
  79. reportUnusedFunction = "warning"
  80. # Useful additional checks
  81. reportUninitializedInstanceVariable = true
  82. reportIncompatibleMethodOverride = true
  83. reportIncompatibleVariableOverride = true
  84. # ============================================================
  85. # Recommended dev dependencies
  86. # ============================================================
  87. # [project.optional-dependencies]
  88. # dev = [
  89. # "mypy>=1.8.0",
  90. # "pyright>=1.1.350",
  91. # # Common type stubs
  92. # "types-requests",
  93. # "types-redis",
  94. # "types-PyYAML",
  95. # "types-python-dateutil",
  96. # ]