defaults.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. from __future__ import annotations
  2. import os
  3. from typing import Final
  4. PYTHON2_VERSION: Final = (2, 7)
  5. # Earliest fully supported Python 3.x version. Used as the default Python
  6. # version in tests. Mypy wheels should be built starting with this version,
  7. # and CI tests should be run on this version (and later versions).
  8. PYTHON3_VERSION: Final = (3, 8)
  9. # Earliest Python 3.x version supported via --python-version 3.x. To run
  10. # mypy, at least version PYTHON3_VERSION is needed.
  11. PYTHON3_VERSION_MIN: Final = (3, 4)
  12. CACHE_DIR: Final = ".mypy_cache"
  13. CONFIG_FILE: Final = ["mypy.ini", ".mypy.ini"]
  14. PYPROJECT_CONFIG_FILES: Final = ["pyproject.toml"]
  15. SHARED_CONFIG_FILES: Final = ["setup.cfg"]
  16. USER_CONFIG_FILES: Final = ["~/.config/mypy/config", "~/.mypy.ini"]
  17. if os.environ.get("XDG_CONFIG_HOME"):
  18. USER_CONFIG_FILES.insert(0, os.path.join(os.environ["XDG_CONFIG_HOME"], "mypy/config"))
  19. CONFIG_FILES: Final = (
  20. CONFIG_FILE + PYPROJECT_CONFIG_FILES + SHARED_CONFIG_FILES + USER_CONFIG_FILES
  21. )
  22. # This must include all reporters defined in mypy.report. This is defined here
  23. # to make reporter names available without importing mypy.report -- this speeds
  24. # up startup.
  25. REPORTER_NAMES: Final = [
  26. "linecount",
  27. "any-exprs",
  28. "linecoverage",
  29. "memory-xml",
  30. "cobertura-xml",
  31. "xml",
  32. "xslt-html",
  33. "xslt-txt",
  34. "html",
  35. "txt",
  36. "lineprecision",
  37. ]
  38. # Threshold after which we sometimes filter out most errors to avoid very
  39. # verbose output. The default is to show all errors.
  40. MANY_ERRORS_THRESHOLD: Final = -1