From 3ce0f25501b3081559e7a19716f37ddafa155ab7 Mon Sep 17 00:00:00 2001 From: Chetan Gohil Date: Thu, 8 Feb 2024 15:49:47 +0000 Subject: [PATCH] Fixed readthedocs build. --- .readthedocs.yaml | 2 +- doc/source/conf.py | 26 +++++++++++++++----------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 4a079703..0013e92f 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,7 +9,7 @@ version: 2 build: os: ubuntu-20.04 tools: - python: "3.9" + python: "3.8" # You can also specify other tool versions: # nodejs: "16" # rust: "1.55" diff --git a/doc/source/conf.py b/doc/source/conf.py index fe1db544..904b6578 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -6,14 +6,18 @@ # -- Path setup -------------------------------------------------------------- +import os +import sys +import inspect + +__location__ = os.path.join( + os.getcwd(), os.path.dirname(inspect.getfile(inspect.currentframe())) +) + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -# -# import os -# import sys -# sys.path.insert(0, os.path.abspath('.')) - +sys.path.insert(0, os.path.join(__location__, "../osl")) # -- Project information ----------------------------------------------------- @@ -31,7 +35,7 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - #'sphinx_gallery.gen_gallery', + 'sphinx_gallery.gen_gallery', 'sphinx.ext.autosummary', 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', @@ -69,11 +73,11 @@ # -- Sphinx Options --------------------------------------------------------- -#sphinx_gallery_conf = { -# 'examples_dirs': 'tutorials', # path to your example scripts -# 'gallery_dirs': 'build_tutorials', # path to where to save gallery generated output -# 'filename_pattern': '/osl_tutorial_', -#} +sphinx_gallery_conf = { + 'examples_dirs': 'tutorials', # path to your example scripts + 'gallery_dirs': 'build_tutorials', # path to where to save gallery generated output + 'filename_pattern': '/osl_tutorial_', +} intersphinx_mapping = {'mne': ('https://mne.tools/stable/', None), 'osl': ('https://osl.readthedocs.io/en/improve_docs/', None),