From b19880bbb47d22d68dc1a271402d2c0f94ed054b Mon Sep 17 00:00:00 2001 From: "Jason K. Moore" Date: Sun, 28 Jan 2024 11:11:19 +0100 Subject: [PATCH] Only add the git version if building on github, as it causes a rebuild everytime sphinx build is called. --- conf.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/conf.py b/conf.py index e1124699..b6acc278 100644 --- a/conf.py +++ b/conf.py @@ -24,9 +24,6 @@ copyright = '2022-2024, Jason K. Moore' author = 'Jason K. Moore' version = '0.2.dev0' -commit_id = subprocess.check_output(['git', 'rev-parse', '--short', - 'HEAD']).strip().decode('ascii') -version += '+' + commit_id # -- General configuration --------------------------------------------------- @@ -54,6 +51,11 @@ ONGITHUB = "ONGITHUB" in os.environ +if ONGITHUB: + commit_id = subprocess.check_output(['git', 'rev-parse', '--short', + 'HEAD']).strip().decode('ascii') + version += '+' + commit_id + if not ONGITHUB: # Display TODO notes. todo_include_todos = True