From 32cfe9c8ace38f4eb632595cd38d94d0fd4cac05 Mon Sep 17 00:00:00 2001 From: Alyssa Travitz Date: Thu, 4 Dec 2025 08:42:09 -0800 Subject: [PATCH] docs: handle common case where ExampleNotebooks already exists and is on a tagged release --- docs/conf.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index bdaf6fe36..295005c3b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,9 +16,9 @@ from inspect import cleandoc from pathlib import Path +import git import nbformat import nbsphinx -from git import Repo from packaging.version import parse sys.path.insert(0, os.path.abspath("../")) @@ -181,10 +181,14 @@ example_notebooks_path = Path("ExampleNotebooks") try: if example_notebooks_path.exists(): - repo = Repo(example_notebooks_path) - repo.remote("origin").pull() + repo = git.Repo(example_notebooks_path) + try: + repo.remote("origin").pull() + except git.exc.GitCommandError: + # cannot pull if on a tag + pass else: - repo = Repo.clone_from( + repo = git.Repo.clone_from( "https://github.com/OpenFreeEnergy/ExampleNotebooks.git", branch="2025.10.2", to_path=example_notebooks_path,