From 237915f81de118908f484b1c266051cc1bf58698 Mon Sep 17 00:00:00 2001 From: Josh Mitchell Date: Wed, 13 Nov 2024 11:26:10 +1100 Subject: [PATCH 1/6] Restore fail-on-warn and allow conf.py to import interchange --- .readthedocs.yml | 2 +- docs/conf.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index fb33bd7d..b70831fb 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -10,7 +10,7 @@ build: sphinx: configuration: docs/conf.py - fail_on_warning: false + fail_on_warning: true conda: environment: devtools/conda-envs/docs_env.yaml diff --git a/docs/conf.py b/docs/conf.py index 8c42fbb2..24534281 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,14 +16,13 @@ import os import sys +sys.path.insert(0, os.path.abspath("../")) + try: from openff.interchange import __version__ except ModuleNotFoundError: __version__ = "0.0.0" -sys.path.insert(0, os.path.abspath("../")) - - # -- Project information ----------------------------------------------------- project = "openff-interchange" From 409fbe001d69844d95a28062371a9fa9881b484d Mon Sep 17 00:00:00 2001 From: Josh Mitchell Date: Wed, 13 Nov 2024 12:24:24 +1100 Subject: [PATCH 2/6] Fail to build docs if version not imported --- docs/conf.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 24534281..f243b203 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,10 +18,7 @@ sys.path.insert(0, os.path.abspath("../")) -try: - from openff.interchange import __version__ -except ModuleNotFoundError: - __version__ = "0.0.0" +from openff.interchange import __version__ # -- Project information ----------------------------------------------------- @@ -289,4 +286,13 @@ ] -# -- Extension configuration ------------------------------------------------- +# -- ReadTheDocs configuration ------------------------------------------------- + +if os.environ.get("READTHEDOCS", "") == "True": + # 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 "html_context" not in globals(): + html_context = {} + html_context["READTHEDOCS"] = True From f7681cdeb6f37ed049a5a10862fcc5735ace8937 Mon Sep 17 00:00:00 2001 From: Josh Mitchell Date: Wed, 13 Nov 2024 12:29:15 +1100 Subject: [PATCH 3/6] Ask RTD to install interchange into environment --- .readthedocs.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.readthedocs.yml b/.readthedocs.yml index b70831fb..519b1db8 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -14,3 +14,8 @@ sphinx: conda: environment: devtools/conda-envs/docs_env.yaml + +python: + install: + - method: pip + path: . From 1bbbc52b9c219221dec38b6bb08463a159d074ab Mon Sep 17 00:00:00 2001 From: Josh Mitchell Date: Wed, 13 Nov 2024 12:50:46 +1100 Subject: [PATCH 4/6] Rename Interchange for consistency --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6ebfd2e0..6163e361 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ requires = [ build-backend = "setuptools.build_meta" [project] -name="Interchange" +name="openff-interchange" description = "A project (and object) for storing, manipulating, and converting molecular mechanics data." readme = "README.md" authors = [{name = "Open Force Field Initiative", email = "info@openforcefield.org"}] From a898ea65c4e056e5bc2e876872ee1ed2342da35b Mon Sep 17 00:00:00 2001 From: Josh Mitchell Date: Wed, 13 Nov 2024 12:56:22 +1100 Subject: [PATCH 5/6] Remove unnecessary pythonpath patch from sphinx config --- docs/conf.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index f243b203..b026e5fb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,9 +14,6 @@ # Incase the project was not installed import importlib import os -import sys - -sys.path.insert(0, os.path.abspath("../")) from openff.interchange import __version__ From 6c1936c1e9e36f9cfe0c1fb301fa5a5cedc4715d Mon Sep 17 00:00:00 2001 From: Josh Mitchell Date: Wed, 13 Nov 2024 13:11:00 +1100 Subject: [PATCH 6/6] Add comment describing importance of fail_on_warning to .readthedocs.yml --- .readthedocs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.readthedocs.yml b/.readthedocs.yml index 519b1db8..6f88bb5e 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -10,6 +10,8 @@ build: sphinx: configuration: docs/conf.py + # Interchange's docs should not produce warnings; if they start, + # something is broken (most likely automatic API doc generation) fail_on_warning: true conda: