diff --git a/pyproject.toml b/pyproject.toml index cbc64c86..396b52af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -122,3 +122,24 @@ from-first=true # import_heading_localfolder="Local" known-local-folder=["fms_mo","tests"] # extend-skip="fms_mo/_version.py" + +[tool.mypy] +mypy_path = [""] +packages = ["fms_mo", "tests"] +disable_error_code = [] +# TODO: tighten MyPy checks by enabling these checks over time. +check_untyped_defs = false +disallow_incomplete_defs = false +disallow_untyped_defs = false +warn_return_any = true +# honor excludes by not following there through imports +follow_imports = "silent" +exclude = [] + +[[tool.mypy.overrides]] +# packages without typing annotations, without stubs, or not available. +module = [ + "datasets", + "huggingface_hub.*", +] +ignore_missing_imports = true diff --git a/tox.ini b/tox.ini index 6312515f..027376cf 100644 --- a/tox.ini +++ b/tox.ini @@ -74,6 +74,20 @@ commands = {envpython} -m pyspelling --config {toxinidir}/.spellcheck.yml --spellchecker aspell allowlist_externals = sh +[testenv:mypy] +description = Python type checking with mypy +basepython = {[testenv:py3]basepython} +deps = + mypy>=1.10.0,<1.14 + types-PyYAML + types-requests + types-tqdm + types-psutil + pytest + pydantic<=2.9.2 +commands = + mypy {posargs} + [gh] python = 3.11 = 3.11-{unitcov}