mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-26 02:44:33 +02:00
Sphinx docs now pull version info from git tag
Based on http://dreamiurg.net/2011/10/03/using-git-to-get-version-information/
This commit is contained in:
parent
9ff905937f
commit
0fcb1e4839
1 changed files with 12 additions and 4 deletions
16
docs/conf.py
16
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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue