diff --git a/docs/conf.py b/docs/conf.py index 90aed1d..33c4153 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,6 +1,8 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -# + +from subprocess import Popen, PIPE + # This file is execfile()d with the current directory set to its # containing dir. # @@ -52,9 +54,15 @@ author = "Simon Willison" # built documents. # # The short X.Y version. -version = "" -# The full version, including alpha/beta/rc tags. -release = "" +pipe = Popen("git describe --tags --always", stdout=PIPE, shell=True) +git_version = pipe.stdout.read().decode("utf8") + +if git_version: + version = git_version + release = git_version +else: + version = "" + release = "" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.