diff --git a/README.md b/README.md index 5a8b014..483efff 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# toml-validator +# TOML validator [![Tests](https://github.com/staticdev/toml-validator/workflows/Tests/badge.svg)](https://github.com/staticdev/toml-validator/actions?workflow=Tests) [![Supported Python Versions](https://img.shields.io/pypi/pyversions/toml-validator.svg)](https://pypi.python.org/pypi/toml-validator) diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..299f182 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,9 @@ +"""Sphinx configuration.""" +from datetime import datetime + + +project = "TOML validator" +author = "Thiago Carvalho D'Ávila" +copyright = f"{datetime.now().year}, {author}" +extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon"] +autodoc_typehints = "description" diff --git a/mypy.ini b/mypy.ini index 640252a..313e479 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,4 +1,4 @@ [mypy] -[mypy-nox.*,tomlkit.*,pytest,pytest_mock,_pytest.*] +[mypy-tomlkit.*,pytest,pytest_mock,_pytest.*] ignore_missing_imports = True diff --git a/noxfile.py b/noxfile.py index a5007c7..9d9a437 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,6 +1,7 @@ """Nox sessions.""" import contextlib import shutil +import sys import tempfile from pathlib import Path from typing import cast @@ -13,7 +14,6 @@ package = "toml_validator" python_versions = ["3.7", "3.8"] nox.options.sessions = "pre-commit", "safety", "mypy", "tests" -locations = "src", "tests", "noxfile.py" class Poetry: @@ -130,9 +130,12 @@ def safety(session: Session) -> None: @nox.session(python=python_versions) def mypy(session: Session) -> None: """Type-check using mypy.""" - args = session.posargs or locations + args = session.posargs or ["src", "tests", "docs/conf.py"] + install_package(session) install(session, "mypy") session.run("mypy", *args) + if not session.posargs: + session.run("mypy", f"--python-executable={sys.executable}", "noxfile.py") @nox.session(python=python_versions)