diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 901eee0ecfeab5a1938b38011b85909ca459e28e..0ab7cf354bb577b4af365d3b7af174052c67fdfe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -311,14 +311,11 @@ tests-and-coverage: build-documentation: - image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full:cupy12.3 + image: i10git.cs.fau.de:5005/pycodegen/pycodegen/nox:ubuntu24.04-cuda12 stage: docs needs: [] - before_script: - - pip install -e .[doc] script: - - cd docs - - make html SPHINXOPTS="-W --keep-going" + - nox --session docs tags: - docker - cuda11 @@ -328,7 +325,7 @@ build-documentation: pages: - image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full + image: alpine:latest stage: deploy needs: ["tests-and-coverage", "build-documentation"] script: diff --git a/noxfile.py b/noxfile.py index 876d7a914cccaf7725d309d872be16c290c4d56b..a4b11019186d58afacd456bec1a81c2af2cffd38 100644 --- a/noxfile.py +++ b/noxfile.py @@ -15,7 +15,7 @@ def get_cuda_version() -> None | tuple[int, ...]: result = subprocess.run(smi_args, capture_output=True) except FileNotFoundError: return None - + smi_output = str(result.stdout).splitlines() cuda_version = smi_output[-1].split(":")[1].strip() return tuple(int(v) for v in cuda_version.split(".")) @@ -45,18 +45,16 @@ def typecheck(session: nox.Session): session.run("mypy", "src/pystencils") -@nox.parametrize( - "cupy_version", - [None, "12", "13"], - ids=["cpu", "cupy12", "cupy13"] -) +@nox.parametrize("cupy_version", [None, "12", "13"], ids=["cpu", "cupy12", "cupy13"]) @nox.session(python="3.10", tags=["test"]) def testsuite(session: nox.Session, cupy_version: str | None): if cupy_version is not None: cuda_version = get_cuda_version() if cuda_version is None or cuda_version[0] < 11: - session.skip("No compatible installation of CUDA found - Need at least CUDA 11") - + session.skip( + "No compatible installation of CUDA found - Need at least CUDA 11" + ) + cuda_major = cuda_version[0] cupy_package = f"cupy-cuda{cuda_major}=={cupy_version}" session.install(cupy_package) @@ -68,12 +66,30 @@ def testsuite(session: nox.Session, cupy_version: str | None): session.run( "pytest", "-v", - "-n", str(num_cores), + "-n", + str(num_cores), "--cov-report=term", "--cov=.", - "-m", "not longrun", - "--html", "test-report/index.html", - "--junitxml=report.xml" + "-m", + "not longrun", + "--html", + "test-report/index.html", + "--junitxml=report.xml", ) session.run("coverage", "html") session.run("coverage", "xml") + + +@nox.session(python=["3.10"], tags=["docs"]) +def docs(session: nox.Session): + """Build the documentation pages""" + editable_install(session, ["doc"]) + session.chdir("docs") + session.run( + "make", + "html", + external=True, + env={ + "SPHINXOPTS": "-W --keep-going" + } + ) diff --git a/pyproject.toml b/pyproject.toml index 4f4cad8e755e45a4555e8cc646da25767675eb84..c0404a7206a10976da990fd721c3b8aa7e4554a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,9 @@ doc = [ 'sphinx_autodoc_typehints', 'pandoc', 'sphinx_design', - 'myst-nb' + 'myst-nb', + 'matplotlib', + 'graphviz', ] testsuite = [ 'pytest',