Skip to content

Commit

Permalink
Only add the git version if building on github, as it causes a rebuil…
Browse files Browse the repository at this point in the history
…d everytime sphinx build is called.
  • Loading branch information
moorepants committed Jan 28, 2024
1 parent 1a25068 commit b19880b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---------------------------------------------------

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b19880b

Please sign in to comment.