1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
import nox
@nox.session(reuse_venv=True)
def lint(session: nox.Session) -> None:
session.install("pytest", "hypothesis", "pytz", "black", "mypy", "ruff")
session.run("ruff", "check", "iso8601")
session.run("black", "--check", "--diff", "iso8601")
session.run("mypy", "--strict", "iso8601")
@nox.session(reuse_venv=True)
def check_example(session: nox.Session) -> None:
session.install(".", "mypy")
session.run("mypy", "--strict", "docs/example.py")
session.run("python", "docs/example.py")
@nox.session(reuse_venv=True)
def docs(session: nox.Session) -> None:
session.install(".", "Sphinx")
session.run("sphinx-build", "docs", "docs/_build")
@nox.session(
python=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "pypy3"], reuse_venv=True
)
def test(session: nox.Session) -> None:
session.install(".")
session.install("pytest", "hypothesis", "pytz")
session.run("pytest", "-vv", "--tb=short", "--log-level=INFO")
|