From 121fc3ea3331e4271ef8c653b5401537ebf09a63 Mon Sep 17 00:00:00 2001 From: Brian Gerwe Date: Wed, 7 Aug 2024 13:39:14 -0700 Subject: [PATCH] add readthedocs template (#299) * add readthedocs template * add packaged requirements to docs building config * update intersphinx_mapping * split documentation requirements into separate file and update doc building config --- .readthedocs.yaml | 35 +++++++++++++++++++++++++++++++++++ docs/requirements.txt | 3 +++ docs/source/conf.py | 2 +- requirements.txt | 2 -- 4 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 .readthedocs.yaml create mode 100644 docs/requirements.txt diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..653b387d --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,35 @@ +# Read the Docs configuration file for Sphinx projects +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the OS, Python version and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.12" + # You can also specify other tool versions: + # nodejs: "20" + # rust: "1.70" + # golang: "1.20" + +# Optional but recommended, declare the Python requirements required +# to build your documentation +# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +python: + install: + - requirements: docs/requirements.txt + +# Build documentation in the "docs/" directory with Sphinx +sphinx: + configuration: docs/source/conf.py + # You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs + # builder: "dirhtml" + # Fail on all warnings to avoid broken references + # fail_on_warning: true + +# Optionally build your docs in additional formats such as PDF and ePub +# formats: +# - pdf +# - epub diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..080c5208 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,3 @@ +numpydoc +nbsphinx +sphinx-rtd-theme diff --git a/docs/source/conf.py b/docs/source/conf.py index e11d6bfd..d92f0f5a 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -193,7 +193,7 @@ # -- Options for intersphinx extension --------------------------------------- # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {'https://docs.python.org/': None} +intersphinx_mapping = {'python': ('https://docs.python.org/', None)} # -- Options for todo extension ---------------------------------------------- diff --git a/requirements.txt b/requirements.txt index 7abe3dfc..ea8a8d3d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,8 +2,6 @@ altair>=3.0 coveralls==3.2.0 matplotlib>=3.5 numpy>=1.14 -numpydoc -nbsphinx pytest>=4.6 pytest-cov scipy>=1.0