Created
June 14, 2025 22:44
-
-
Save sarnold/0772041c7ba71dc9fda01affc8cd1429 to your computer and use it in GitHub Desktop.
get last git tag from inside sphinx conf.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import subprocess as sp | |
| from shlex import split | |
| def get_last_tag(): | |
| """ | |
| Get the last tag value from git. | |
| """ | |
| git_tag_str = "git describe --abbrev=0 --tags" | |
| return sp.check_output(split(git_tag_str), text=True).strip() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment