Skip to content

Commit 4bd2072

Browse files
author
danielle brake
committed
add git commit number to footer of pybertini docs
the documentation now depends on gitpython -- though sphinx will merely fail to generate the version numbers if it is not present. thanks to * Jim Easterbrook's reply in https://groups.google.com/forum/#!topic/sphinx-users/9eBpfT-WEmY and * gitpython-developers/GitPython#255
1 parent 36a61f2 commit 4bd2072

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

python/docs/source/conf.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,23 @@
6969
copyright = '2015-2018, Bertini Team'
7070
author = 'Bertini Team'
7171

72+
7273
# The version info for the project you're documenting, acts as replacement for
7374
# |version| and |release|, also used in various other places throughout the
7475
# built documents.
75-
#
76-
# The short X.Y version.
77-
version = '1.0'
78-
# The full version, including alpha/beta/rc tags.
79-
release = '1.0a1'
76+
try:
77+
import git #package gitpython
78+
repo = git.Repo(search_parent_directories=True)
79+
last_commit = str(repo.head.commit)
80+
version = last_commit[:7]
81+
release = last_commit # full version
82+
except:
83+
last_commit = 'not_from_git'
84+
version = last_commit # The short X.Y version.
85+
release = version # The full version, including alpha/beta/rc tags.
86+
87+
88+
8089

8190
# The language for content autogenerated by Sphinx. Refer to documentation
8291
# for a list of supported languages.

python/python.sublime-project

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
{
55
"path": ".",
66
"file_exclude_patterns": ["serialization_test*",
7-
"Makefile",
87
"Makefile.in",
98
"*.la",
109
"libtool",

0 commit comments

Comments
 (0)