From 36112b3e8026c1559023efbd70d436d3b64c2342 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Fri, 6 Nov 2026 11:17:38 +0000 Subject: [PATCH] ci: build the docs on PRs via Heart's docs-build.yml; drop build-time cloning in conf.py - .github/workflows/docs.yml: thin caller (package: autocti), mirroring PyAutoFit's - docs/conf.py: PyAutoLens-style path setup; no more cloning PyAutoFit/PyAutoArray from the old personal-account URLs at build time (needed pyprojroot, and would shadow the branch-matched deps CI installs) - docs/requirements.txt removed: Read the Docs installs .[docs] (.readthedocs.yaml) and no sibling keeps one; it pinned autonerves==2024.11.6.1 - docs/sphinx_warning_baseline.txt: 15 (local build with arcticpy; re-set from CI if it differs) Closes #125 Co-Authored-By: Claude Opus 5.5 --- .github/workflows/docs.yml | 31 +++++++++++++++++++++++++++++++ docs/conf.py | 32 ++------------------------------ docs/requirements.txt | 10 ---------- docs/sphinx_warning_baseline.txt | 1 + 4 files changed, 34 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/docs.yml delete mode 100644 docs/requirements.txt create mode 100644 docs/sphinx_warning_baseline.txt diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..ec92f0c9 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,31 @@ +name: Docs + +# Docs build check is defined once, centrally, in PyAutoHeart's reusable +# workflow (Heart owns all health/readiness checking). This thin caller +# builds the Sphinx docs on PRs and fails on warning-count regression +# against docs/sphinx_warning_baseline.txt. + +on: + push: + branches: [main] + paths: + - "docs/**" + - "autocti/**" + - "pyproject.toml" + - ".readthedocs.yaml" + - ".github/workflows/docs.yml" + pull_request: + paths: + - "docs/**" + - "autocti/**" + - "pyproject.toml" + - ".readthedocs.yaml" + - ".github/workflows/docs.yml" + workflow_dispatch: + +jobs: + docs: + uses: PyAutoLabs/PyAutoHeart/.github/workflows/docs-build.yml@main + with: + package: autocti + secrets: inherit diff --git a/docs/conf.py b/docs/conf.py index 855586f9..e76444fd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -13,38 +13,10 @@ # documentation root, use os.path.abspath to make it absolute, like shown here. # -from pyprojroot import here - -# /home/docs/checkouts/readthedocs.org/user_builds/pyautocti/checkouts/latest/docs - -clone_path = str(here()) - -import os import sys +from pathlib import Path -sys.path.insert(0, os.path.abspath(".")) - - -def clone_repo(name: str, url: str): - clone = f"git clone {url}/{name}" - os.system(clone) - os.system(f"pip install -r {name}/requirements.txt") - os.system(f"rm -rf {name}/docs") - sys.path.insert( - 0, - os.path.abspath(f"{clone_path}/{name}"), - ) - - -clone_repo(name="PyAutoFit", url="https://github.com/rhayes777") -clone_repo(name="PyAutoArray", url="https://github.com/Jammy2211") - -clone_path = os.path.split(clone_path)[0] - -sys.path.insert( - 0, - os.path.abspath(clone_path), -) +sys.path.insert(0, str(Path(".").resolve())) import autocti diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 59dae3c3..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,10 +0,0 @@ -arcticpy==2.6 -autonerves==2024.11.6.1 -numpydoc>=1.0.0 -pyprojroot==0.2.0 -sphinx -furo -myst-parser -sphinx_copybutton -sphinx_design -sphinx_inline_tabs \ No newline at end of file diff --git a/docs/sphinx_warning_baseline.txt b/docs/sphinx_warning_baseline.txt new file mode 100644 index 00000000..60d3b2f4 --- /dev/null +++ b/docs/sphinx_warning_baseline.txt @@ -0,0 +1 @@ +15