Skip to content

Commit

Permalink
Fix sphinx docs version parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
KolinGuo committed Apr 16, 2024
1 parent b1b88a2 commit 8de8711
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
project = "mplib"
author = "Minghua Liu, Jiayuan Gu, Kolin Guo, Xinsong Lin"
copyright = f"2021-2024, {author}. All rights reserved."
release = "+git.".join(
re.findall(
"^v(.*)-[0-9]+-g(.*)",
os.popen("git describe --abbrev=8 --tags --match v*").read().strip(),
)[0]
) # tag-commithash
git_describe_ret = os.popen("git describe --abbrev=8 --tags --match v*").read().strip()
if "-" in git_describe_ret: # commit after a tag
release = "+git.".join(
re.findall("^v(.*)-[0-9]+-g(.*)", git_describe_ret)[0]
) # tag-commithash
else:
release = git_describe_ret[1:]
version = release

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

0 comments on commit 8de8711

Please sign in to comment.