From 72e2c5b7f5b5c40eb613cb42ec6a69f6e97278d3 Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Fri, 15 Sep 2023 14:56:05 -0400 Subject: [PATCH] do not run nbsphinx if _data exsists, stage removal of _data files between runs --- .readthedocs.yml | 2 ++ docs/conf.py | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 4b04e1fb..4192147e 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -17,6 +17,8 @@ build: pre_build: - sphinx-apidoc -o docs/apidoc --private --module-first xscen - env SKIP_NOTEBOOKS=1 sphinx-build -b linkcheck docs/ _build/linkcheck +# post_build: +# - rm -rf docs/notebooks/_data conda: environment: environment-dev.yml diff --git a/docs/conf.py b/docs/conf.py index dcee2304..d6ad8631 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -79,11 +79,11 @@ if skip_notebooks: warnings.warn("SKIP_NOTEBOOKS is set. Not executing notebooks.") nbsphinx_execute = "never" -elif os.getenv("READTHEDOCS_VERSION_NAME") in ["latest", "stable"] or os.getenv( - "READTHEDOCS_VERSION_TYPE" -) in ["tag"]: - if os.getenv("READTHEDOCS_OUTPUT") in ["pdf"]: - warnings.warn("Generating PDF version. Not executing notebooks.") +elif (os.getenv("READTHEDOCS_VERSION_NAME") in ["latest", "stable"]) or ( + os.getenv("READTHEDOCS_VERSION_TYPE") in ["tag"] +): + if Path(__file__).parent.joinpath("notebooks/_data").exists(): + warnings.warn("Notebook artefacts found. Not executing notebooks.") nbsphinx_execute = "never" # if skip_notebooks or os.getenv("READTHEDOCS_VERSION_TYPE") in [