From 305cca66ddda38a4d2a20d93206b0a1de609d2fc Mon Sep 17 00:00:00 2001 From: Roger Yang <80478925+RogerHYang@users.noreply.github.com> Date: Fri, 19 Jan 2024 14:51:07 -0800 Subject: [PATCH] chore: include tests for mypy (#122) --- python/mypy.ini | 6 ++++++ .../tests/openinference/semconv/test_version.py | 2 +- python/tox.ini | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/python/mypy.ini b/python/mypy.ini index 533084ef6..c8ed2018d 100644 --- a/python/mypy.ini +++ b/python/mypy.ini @@ -1,5 +1,11 @@ [mypy] strict = true +explicit_package_bases = true +exclude = (?x)( + ^examples # examples folder + | ^dist # dist folder + | ^sdist # sdist folder + ) [mypy-wrapt] ignore_missing_imports = True diff --git a/python/openinference-semantic-conventions/tests/openinference/semconv/test_version.py b/python/openinference-semantic-conventions/tests/openinference/semconv/test_version.py index 1c7e13aed..85e8f8743 100644 --- a/python/openinference-semantic-conventions/tests/openinference/semconv/test_version.py +++ b/python/openinference-semantic-conventions/tests/openinference/semconv/test_version.py @@ -4,5 +4,5 @@ from openinference.semconv.version import __version__ as semconv_version -def test_version(): +def test_version() -> None: print(semconv_version) diff --git a/python/tox.ini b/python/tox.ini index 4136a7a3d..eb799df8b 100644 --- a/python/tox.ini +++ b/python/tox.ini @@ -20,9 +20,9 @@ commands_pre = commands = ruff: ruff format . --config {toxinidir}/ruff.toml ruff: ruff check . --fix --config {toxinidir}/ruff.toml - mypy: mypy --config-file {toxinidir}/mypy.ini --explicit-package-bases {posargs:src} + mypy: mypy --config-file {toxinidir}/mypy.ini {posargs:.} test: pytest {posargs:tests} ci: ruff format . --diff --config {toxinidir}/ruff.toml ci: ruff check . --no-fix --config {toxinidir}/ruff.toml - ci: mypy --config-file {toxinidir}/mypy.ini --explicit-package-bases src + ci: mypy --config-file {toxinidir}/mypy.ini . ci: pytest tests