devicetree: add mypy-based type checking

Extend the steps taken in tox.ini by type checking the 'devicetree'
package. This will make it easier for callers to type-check code that
uses the low level DT module's public APIs, since they can rely on
the type checker a bit more.

It will also help avoid bugs by adding some type checking for future
changes to this module.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
Martí Bolívar 2021-04-23 14:34:47 -07:00 committed by Kumar Gala
commit 2e0d95f3cd

View file

@ -5,7 +5,14 @@ envlist=py3
deps =
setuptools-scm
pytest
mypy
setenv =
TOXTEMPDIR={envtmpdir}
commands =
python -m pytest {posargs:tests}
python -m mypy --config-file={toxinidir}/tox.ini --package=devicetree
[mypy]
mypy_path=src
ignore_missing_imports=True