Type check against the oldest Python version
Without a configured version, `mypy` and `pyright` check against the Python that runs them. With `MAIN_PYTHON` at 3.14, they would accept `stdlib` APIs and `typing` features new in 3.14. Yet, `requires-python` promises 3.13; so, the type checkers must flag such code. `black` and `ruff` already target 3.13 for the same reason.
This commit is contained in:
parent
b947337bd1
commit
67917ae3f6
1 changed files with 6 additions and 0 deletions
|
|
@ -439,6 +439,9 @@ force_single_line = true
|
||||||
|
|
||||||
cache_dir = ".cache/mypy"
|
cache_dir = ".cache/mypy"
|
||||||
|
|
||||||
|
# Check against the oldest supported Python version, not the one running `mypy`
|
||||||
|
python_version = "3.13"
|
||||||
|
|
||||||
# Check the interior of functions without type annotations
|
# Check the interior of functions without type annotations
|
||||||
check_untyped_defs = true
|
check_untyped_defs = true
|
||||||
|
|
||||||
|
|
@ -528,6 +531,9 @@ ignore_missing_imports = true
|
||||||
[tool.pyright]
|
[tool.pyright]
|
||||||
# Source: https://microsoft.github.io/pyright/#/configuration
|
# Source: https://microsoft.github.io/pyright/#/configuration
|
||||||
|
|
||||||
|
# Check against the oldest supported Python version, not the one running `pyright`
|
||||||
|
pythonVersion = "3.13"
|
||||||
|
|
||||||
# Treat libraries without type annotations as `Any`, like `mypy` does
|
# Treat libraries without type annotations as `Any`, like `mypy` does
|
||||||
useLibraryCodeForTypes = false
|
useLibraryCodeForTypes = false
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue