From d0cebc265c1b77fb2a8eb2c2e9db18175d032581 Mon Sep 17 00:00:00 2001 From: Evan Harvey Date: Tue, 16 Apr 2024 13:27:22 -0600 Subject: [PATCH] Fix path on rtd server Fix rtd requirements install --- .readthedocs.yaml | 4 +++- doc/source/conf.py | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 3bf8cd372..9d3234b26 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,7 +9,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.12" + python: "3.10" # You can also specify other tool versions: # nodejs: "19" # rust: "1.64" @@ -29,4 +29,6 @@ sphinx: # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html python: install: + - requirements: requirements.txt - requirements: doc/requirements.txt + diff --git a/doc/source/conf.py b/doc/source/conf.py index 381b97d50..ec357e658 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -11,9 +11,19 @@ # documentation root, use os.path.abspath to make it absolute, like shown here. # from pathlib import Path -import sys +import sys, os -sys.path.append(str(Path.cwd().parent.parent.resolve())) +# Check if we're running on Read the Docs' servers +read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True' + +if read_the_docs_build: + cwd = os.getcwd() + print(cwd) + opencsp_path = cwd + "/../" + "../" + os.listdir(Path(opencsp_path)) + sys.path.append(str(opencsp_path)) +else: + sys.path.append(str(Path.cwd().parent.parent.resolve())) # -- Project information -----------------------------------------------------