blob: 757a53843aca4a03fb2afd8e610815daf5f8c04c [file] [log] [blame]
import nox
nox.options.sessions = ["lint", "tests", "tests_packaging"]
PYTHON_VERISONS = ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
def lint(session: nox.Session) -> None:
Lint the codebase (except for clang-format/tidy).
session.install("pre-commit")"pre-commit", "run", "-a")
def tests(session: nox.Session) -> None:
Run the tests (requires a compiler).
tmpdir = session.create_tmp()
session.install("-r", "tests/requirements.txt")
)"cmake", "--build", tmpdir)"cmake", "--build", tmpdir, "--config=Release", "--target", "check")
def tests_packaging(session: nox.Session) -> None:
Run the packaging tests.
session.install("-r", "tests/requirements.txt", "--prefer-binary")"pytest", "tests/extra_python_package")
def docs(session: nox.Session) -> None:
Build the docs. Pass "serve" to serve.
session.install("-r", "docs/requirements.txt")
if "pdf" in session.posargs:"sphinx-build", "-M", "latexpdf", ".", "_build")
return"sphinx-build", "-M", "html", ".", "_build")
if "serve" in session.posargs:
session.log("Launching docs at http://localhost:8000/ - use Ctrl-C to quit")"python", "-m", "http.server", "8000", "-d", "_build/html")
elif session.posargs:
session.error("Unsupported argument to docs")
def make_changelog(session: nox.Session) -> None:
Inspect the closed issues and make entries for a changelog.
session.install("ghapi", "rich")"python", "tools/")
def build(session: nox.Session) -> None:
Build SDists and wheels.
session.install("build")"python", "-m", "build")"python", "-m", "build", env={"PYBIND11_GLOBAL_SDIST": "1"})