diff --git a/noxfile.py b/noxfile.py index 121f4f5757c07d4ee3abfab30ba8beec261778c2..6797b068730746d73cbfbf1b8a6e6c519e0a7540 100644 --- a/noxfile.py +++ b/noxfile.py @@ -25,7 +25,7 @@ def get_cuda_version(session: nox.Session) -> None | tuple[int, ...]: return tuple(int(v) for v in version_string.split(".")) except ValueError: pass - + session.warn("nvcc was found, but I am unable to determine the CUDA version.") return None @@ -51,6 +51,17 @@ def install_cupy( session.install(cupy_package) +def check_external_doc_dependencies(session: nox.Session): + dot_args = ["dot", "--version"] + try: + _ = subprocess.run(dot_args) + except FileNotFoundError: + session.error( + "Unable to build documentation: " + "command `dot` from the `graphviz` package (https://www.graphviz.org/) could not be found." + ) + + def editable_install(session: nox.Session, opts: Sequence[str] = ()): if opts: opts_str = "[" + ",".join(opts) + "]" @@ -105,6 +116,7 @@ def testsuite(session: nox.Session, cupy_version: str | None): @nox.session(python=["3.10"], tags=["docs"]) def docs(session: nox.Session): """Build the documentation pages""" + check_external_doc_dependencies(session) install_cupy(session, "12.3") editable_install(session, ["doc"]) session.chdir("docs")