# mypy.ini (repo root)
[mypy]
python_version = 3.11
warn_unused_configs = True
warn_return_any = False
no_implicit_optional = True
disallow_untyped_defs = False
warn_redundant_casts = True
warn_unused_ignores = False
show_error_codes = True
pretty = True
plugins = pydantic.mypy
# Disable warnings for external libraries without stubs
disable_error_code = import-untyped
# Limit what we check by default (faster, clearer)
files = src, test
# Exclude generated or vendored paths if any
exclude = (?x)(
^build/|
^dist/|
^\.venv/|
^\.mypy_cache/
)
# Third-party geospatial libs often lack complete stubs
[mypy-rasterio.*]
ignore_missing_imports = True
[mypy-pyogrio.*]
ignore_missing_imports = True
[mypy-fiona.*]
ignore_missing_imports = True
# Optional: geopandas, shapely frequently need this too
[mypy-geopandas.*]
ignore_missing_imports = True
[mypy-shapely.*]
ignore_missing_imports = True
[mypy-fastmcp.*]
ignore_missing_imports = True
[mypy-numpy.*]
ignore_missing_imports = True
[mypy-pytest.*]
ignore_missing_imports = True
[mypy-typer.*]
ignore_missing_imports = True
# Suppress Pydantic false positives and known issues
[mypy-src.models.*]
disable_error_code = call-arg,valid-type
[mypy-src.shared.reference.*]
disable_error_code = no-redef,attr-defined,dict-item,typeddict-item,arg-type,return-value
[mypy-src.resources.*]
disable_error_code = unused-coroutine,call-arg,attr-defined
[mypy-src.shared.raster.stats]
disable_error_code = arg-type,assignment
[mypy-src.shared.catalog.scanner]
disable_error_code = call-arg
[mypy-src.tools.*]
disable_error_code = call-arg
[mypy-src.shared.metadata.*]
disable_error_code = import-untyped
# Tests can be looser
[mypy-test.*]
disallow_untyped_defs = False
# --- Pydantic plugin options ---
[pydantic-mypy]
init_forbid_extra = True
init_typed = True
warn_required_dynamic_aliases = True