Skip to content

Commit

Permalink
Fix some readthedocs issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
cr1901 committed Nov 26, 2024
1 parent 8185d3f commit 37f65da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ build:
# rust: "1.70"
# golang: "1.20"
jobs:
post_checkout:
# Reconstruct tags.
- git fetch --unshallow --tags
post_create_environment:
# Install PDM
- pip install -U pdm
Expand All @@ -23,7 +26,7 @@ build:
# * https://github.com/pdm-project/pdm/pull/2736/files#diff-03efc769b870804394632e45d7885272b44c16939517fb31c9d7c614d2ffae57
# * and https://docs.readthedocs.io/en/stable/build-customization.html#install-dependencies-with-poetry
# This replaces requirements.txt specified in: https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH pdm install --dev -G doc
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH pdm install -G doc -G examples

# Build documentation in the "docs/" directory with Sphinx
sphinx:
Expand Down
7 changes: 6 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@
release = sent_ver.public
author = 'William D. Jones'

sys.path.append(os.path.abspath('../src'))
# Won't be picked up otherwise b/c RTD bypasses PDM and uses a different
# working directory?
on_rtd = os.environ.get("READTHEDOCS") == "True"
if on_rtd:
sys.path.append(os.path.abspath('../src'))
sys.path.append(os.path.abspath('..'))

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down

0 comments on commit 37f65da

Please sign in to comment.