Skip to content

Commit 4335a9d

Browse files
Merge pull request #49 from hickeyma/ci/add-mypy
Add mypy static checker tool
2 parents 7d1ac87 + 02d0c26 commit 4335a9d

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

pyproject.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,24 @@ from-first=true
123123
# import_heading_localfolder="Local"
124124
known-local-folder=["fms_mo","tests"]
125125
# extend-skip="fms_mo/_version.py"
126+
127+
[tool.mypy]
128+
mypy_path = [""]
129+
packages = ["fms_mo", "tests"]
130+
disable_error_code = []
131+
# TODO: tighten MyPy checks by enabling these checks over time.
132+
check_untyped_defs = false
133+
disallow_incomplete_defs = false
134+
disallow_untyped_defs = false
135+
warn_return_any = true
136+
# honor excludes by not following there through imports
137+
follow_imports = "silent"
138+
exclude = []
139+
140+
[[tool.mypy.overrides]]
141+
# packages without typing annotations, without stubs, or not available.
142+
module = [
143+
"datasets",
144+
"huggingface_hub.*",
145+
]
146+
ignore_missing_imports = true

tox.ini

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,20 @@ commands =
7474
{envpython} -m pyspelling --config {toxinidir}/.spellcheck.yml --spellchecker aspell
7575
allowlist_externals = sh
7676

77+
[testenv:mypy]
78+
description = Python type checking with mypy
79+
basepython = {[testenv:py3]basepython}
80+
deps =
81+
mypy>=1.10.0,<1.14
82+
types-PyYAML
83+
types-requests
84+
types-tqdm
85+
types-psutil
86+
pytest
87+
pydantic<=2.9.2
88+
commands =
89+
mypy {posargs}
90+
7791
[gh]
7892
python =
7993
3.11 = 3.11-{unitcov}

0 commit comments

Comments
 (0)