From acdef8045e93d904b26ef1b9f6f9b5112f4912b1 Mon Sep 17 00:00:00 2001 From: esc Date: Tue, 15 Aug 2023 14:54:55 +0200 Subject: [PATCH 1/5] adding RTD conf file V2 as per request As title --- .readthedocs.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 000000000..d2dc450e4 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,19 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +sphinx: + configuration: docs/source/conf.py + fail_on_warning: true + +python: + install: + - method: pip + path: . From 92fc752576743ef2934a58610ca3984c816ad1df Mon Sep 17 00:00:00 2001 From: esc Date: Mon, 18 Sep 2023 13:07:22 +0200 Subject: [PATCH 2/5] remove old, outdated config file As title --- readthedocs.yml | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 readthedocs.yml diff --git a/readthedocs.yml b/readthedocs.yml deleted file mode 100644 index 0798c1333..000000000 --- a/readthedocs.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Configuration file for readthedocs -# See https://read-the-docs.readthedocs.org/en/latest/yaml-config.html - -conda: - file: docs/environment.yml From 841b01848b352e80a790cbbaa70461d0221f1c09 Mon Sep 17 00:00:00 2001 From: esc Date: Mon, 18 Sep 2023 13:30:45 +0200 Subject: [PATCH 3/5] remove disabling setup.py on RTD As title --- setup.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/setup.py b/setup.py index 75150ea4b..d327e5ce0 100644 --- a/setup.py +++ b/setup.py @@ -42,9 +42,6 @@ def _guard_py_ver(): _guard_py_ver() -if os.environ.get('READTHEDOCS', None) == 'True': - sys.exit("setup.py disabled on readthedocs: called with %s" - % (sys.argv,)) import versioneer From fba05426d5438c2ba0061faeca06bd1e6f9bddde Mon Sep 17 00:00:00 2001 From: esc Date: Mon, 18 Sep 2023 13:36:03 +0200 Subject: [PATCH 4/5] remove old RTD environment file As title --- docs/environment.yml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 docs/environment.yml diff --git a/docs/environment.yml b/docs/environment.yml deleted file mode 100644 index 2529353f0..000000000 --- a/docs/environment.yml +++ /dev/null @@ -1,8 +0,0 @@ -# Conda environment configuration for readthedocs - -name: rtdenv -dependencies: - - python=3.9 - - sphinx - # https://stackoverflow.com/questions/67542699/readthedocs-sphinx-not-rendering-bullet-list-from-rst-fileA - - docutils==0.16 From ee1f5ef123c035deeeafa0249137179b976f79b1 Mon Sep 17 00:00:00 2001 From: esc Date: Mon, 18 Sep 2023 13:41:29 +0200 Subject: [PATCH 5/5] manually set the RTD theme As of configuration file V2 for Read The Docs (RTD) the `sphinx-rtd-theme` is no longer injected automagically by RTD. So we can do away with all the redundant configuration and checking if we are on RTD or not. The is now a single way to build documentation, on RTD or locally. --- docs/source/conf.py | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index ae4ea5253..b76f52c9f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -15,10 +15,9 @@ import sys import os -import shlex from datetime import datetime -on_rtd = os.environ.get('READTHEDOCS') == 'True' +import sphinx_rtd_theme # 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 @@ -58,9 +57,10 @@ copyright = '2015, Continuum Analytics' author = 'Continuum Analytics' -if on_rtd: +if os.environ.get('READTHEDOCS'): # RTD replaces the last update date. So we need to hack it in here. - copyright += '. Last updated on {}'.format(datetime.utcnow().strftime('%b %d, %Y')) + copyright += '. Last updated on {}'.format( + datetime.utcnow().strftime('%b %d, %Y')) # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -121,18 +121,9 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' - -# on_rtd is whether we are on readthedocs.org -on_rtd = os.environ.get('READTHEDOCS', None) == 'True' - -if not on_rtd: - # only import and set the theme if we're building docs locally - # otherwise, readthedocs.org uses their theme by default, so no need to specify it - import sphinx_rtd_theme - html_theme = 'sphinx_rtd_theme' - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +html_theme = 'sphinx_rtd_theme' +html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the