diff --git a/.gitignore b/.gitignore index d338a6b5..7df9d44b 100755 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,9 @@ ipyvuetify/labextension/ ipyvuetify/nbextension/ js/lib +# Unit test / coverage reports +.nox + # Sphinx documentation docs/_build/ diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..a661804e --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,24 @@ +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# build with latest available ubuntu version +build: + os: ubuntu-20.04 + tools: + python: "3.10" + nodejs: "16" + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/conf.py + +# Optionally set the version of Python and requirements required to build your docs +python: + install: + - method: pip + path: . + extra_requirements: + - doc diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index d4bb2cbb..00000000 --- a/docs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/conf.py b/docs/conf.py index 0f3d70b3..1c6b9c75 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -30,7 +30,7 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ["jupyter_sphinx.execute", "sphinx_rtd_theme"] +extensions = ["jupyter_sphinx", "sphinx_rtd_theme"] # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 2119f510..00000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/noxfile.py b/noxfile.py new file mode 100644 index 00000000..bad5b5a4 --- /dev/null +++ b/noxfile.py @@ -0,0 +1,22 @@ +""" +All the process that can be run using nox. + +The nox run are build in isolated environment that will be stored in .nox. to force the venv update, remove the .nox/xxx folder. +""" + +import nox + + +@nox.session(reuse_venv=True) +def lint(session): + """Apply the pre-commits.""" + session.install("pre-commit") + session.run("pre-commit", "run", "-a", *session.posargs) + + +@nox.session(reuse_venv=True) +def docs(session): + """Build the documentation.""" + session.install("jupyter-packaging", "jupyterlab") + session.install(".[doc]") + session.run("sphinx-build", "-v", "-b", "html", "docs", "docs/_build/html") diff --git a/pyproject.toml b/pyproject.toml index 52b8ebab..6ced8785 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ content-type = "text/markdown" [project.optional-dependencies] dev = ["nox", "pre-commit", "mypy"] test = ["pytest", "pytest-playwright", "jupyterlab<4", "solara[pytest]"] -doc = ["sphinx"] +doc = ["sphinx<7", "jupyter-sphinx", "ipykernel"] [tool.setuptools] include-package-data = true