Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation/conf.py: New RTD config requirements #388

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions documentation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@
from recommonmark.transform import AutoStructify
from recommonmark.parser import CommonMarkParser

# -- Read the Docs --------------------------------------------------------

# Define the canonical URL if you are using a custom domain on Read the Docs
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")

# Tell Jinja2 templates the build is running on Read the Docs
if os.environ.get("READTHEDOCS", "") == "True":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a particular reason to check for the value True rather than just check that a value is set? Usually we don't need such precision as being exactly the value "True" for something that only needs to be truthy

suggestion:

if os.environ.get("READTHEDOCS"): 
    # stuff

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is taken verbatim from RTD's suggested config updates.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(But I agree the suggestion is cleaner)

if "html_context" not in globals():
html_context = {}
html_context["READTHEDOCS"] = True

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ jsonref==0.1
lxml==4.9.1
openpyxl==3.0.10
schema==0.4.0
setuptools==65.5.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may have been auto added, we don't normally bundle the core python libraries setuptools here as it is python version specific. Suggest removing this from the commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was actually added deliberately, as the builds were previously failing due to setuptools not being included in the rtd build environment anymore.

Loading