INNER CODE UNIT · Python
mypy
JasperSui/fastapi-injectable · noxfile.py:113
def mypy(session: nox.Session) -> None:
"""Type-check using mypy."""
args = session.posargs or ["src", "test", "docs/conf.py"]
session.install(".")
session.install("mypy", "pytest")
session.run("mypy", *args)
if not session.posargs:
session.run("mypy", f"--python-executable={sys.executable}", "noxfile.py")
@nox.session(python=python_versions)
def tests(session: nox.Session) -> None:
"""Run the test suite."""
session.install(".")
session.install("coverage[toml]", "pytest", "pytest-asyncio", "httpx", "celery", "dramatiq")
# temporalio bundles a native Rust extension, and mypy ships mypyc-compiled wheels;
# neither targets free-threaded Python. Skip both on those interpreters -- the temporal
# tests and test_mypy_plugin each use pytest.importorskip() to skip gracefully.