Skip to content

Commit

Permalink
docs: Use RTD env vars, take #2
Browse files Browse the repository at this point in the history
  • Loading branch information
lentinj committed Jan 21, 2025
1 parent a606a56 commit 38dbd84
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@
author = 'Michaela Mahlberg, Viola Wiegand, Jamie Lentin & Anthony Hennessey'

# The short X.Y version
version = os.environ.get("READTHEDOCS_VERSION", subprocess.check_output("git rev-parse --abbrev-ref HEAD".split()).decode('utf8').strip())
version = os.environ.get("READTHEDOCS_VERSION", None)
if not version:
version = subprocess.check_output("git rev-parse --abbrev-ref HEAD".split()).decode('utf8').strip()
# The full version, including alpha/beta/rc tags
release = os.environ.get("READTHEDOCS_VERSION_NAME", subprocess.check_output("git describe --abbrev=0".split()).decode('utf8').strip())
release = os.environ.get("READTHEDOCS_VERSION_NAME", None)
if not release:
release = subprocess.check_output("git describe --abbrev=0".split()).decode('utf8').strip()


# -- General configuration ---------------------------------------------------
Expand Down

0 comments on commit 38dbd84

Please sign in to comment.