From 83888ae9df609b0e552f50c821293314e562a0a5 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Tue, 6 Feb 2024 18:12:41 +0000 Subject: [PATCH] doc/conf.py: prepare() only once per build FIX Avoid preparing the repo every time conf.py is imported by a Sphinx child process. --- doc/conf.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index af76fe703..a2a2ef019 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -99,7 +99,11 @@ def prepare(): ) os.environ.update(json.loads(out)) -prepare() +# Only the top-level import has the "builtins" __name__. This prevents +# re-running prepare() when conf.py is imported by the processes spawned by +# sphinx +if __name__ == 'builtins': + prepare() # -- General configuration ------------------------------------------------ -- GitLab