From: Christian Kastner <ckk@debian.org>
Date: Tue, 24 Jun 2025 07:17:28 +0200
Subject: Add option to skip theme update

It's possible for the host to not have internet access, so
_update_theme_configs either needs a way to exit early, or it needs to
handle the failed request.

This implements the former in a user-configurable way.
---
 src/rocm_docs/projects.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/rocm_docs/projects.py b/src/rocm_docs/projects.py
index 7aff032..9a0a261 100644
--- a/src/rocm_docs/projects.py
+++ b/src/rocm_docs/projects.py
@@ -342,6 +342,10 @@ def _update_theme_configs(
     app: Sphinx, current_project: _Project | None, current_branch: str
 ) -> None:
     """Update configurations for use in theme.py"""
+    # In case of no internet access
+    if "ROCM_DOCS_SKIP_UPDATE_THEME_CONFIGS" in os.environ:
+        return
+
     if latest_version := os.getenv('latest_version') is None:
        latest_version = requests.get(
         "https://raw.githubusercontent.com/ROCm/rocm-docs-core/data/latest_version.txt"
