diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 2b27452c1..13e19ae19 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -35,6 +35,7 @@ jobs: $SUDO apt-get install git-annex-standalone python -m pip install --upgrade pip setuptools wheel python -m pip install -e .[docs] + python -m pip install git+https://github.com/dls-controls/sphinx-multiversion@only-arg - name: Configure git for datalad run: | git config --global user.email "runner@github.com" diff --git a/docs/conf.py b/docs/conf.py index e7900577d..84ef66e28 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -19,6 +19,13 @@ import sys from pathlib import Path +# Check if sphinx-multiversion is installed +use_multiversion = False +try: + import sphinx_multiversion # noqa: F401 + use_multiversion = True +except ImportError: + pass curdir = Path(__file__).parent sys.path.append((curdir / "sphinxext").as_posix()) @@ -41,12 +48,14 @@ extensions = [ "sphinx.ext.intersphinx", # link to other projects’ documentation "sphinx.ext.mathjax", # math support for HTML outputs in Sphinx "sphinx_gallery.gen_gallery", # HTML gallery of examples - "sphinx_multiversion", # self-hosted versioned documentation "numpydoc", # support for NumPy style docstrings "gh_substitutions", # custom GitHub substitutions "sphinx_copybutton", # copy button for code blocks ] +if use_multiversion: + extensions.append("sphinx_multiversion") + # Add any paths that contain templates here, relative to this directory. templates_path = [ "_templates", diff --git a/pyproject.toml b/pyproject.toml index c5da2f450..d0e2c6190 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,7 +67,6 @@ docs = [ "Sphinx>=5.3.0,<5.4", "sphinx-gallery>=0.11.0,<0.12", "furo>=2022.9.29,<2023.0.0", - "sphinx-multiversion@git+https://github.com/dls-controls/sphinx-multiversion@only-arg#egg=only-arg", "numpydoc>=1.5.0,<1.6", "julearn==0.2.5", "sphinx-copybutton==0.5.1",