Skip to content

Commit 8fcb3af

Browse files
committed
Automatically update version number in documentation
1 parent f39dffb commit 8fcb3af

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

doc/conf.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
1313

14-
import sys, os
14+
import sys
15+
import os
16+
import re
1517

1618
# from unittest.mock import MagicMock # python3
1719
from mock import Mock as MagicMock # python2
@@ -90,10 +92,12 @@ def __getattr__(cls, name):
9092
# |version| and |release|, also used in various other places throughout the
9193
# built documents.
9294
#
95+
import control
9396
# The short X.Y version.
94-
version = '0.6'
97+
version = re.sub(r'(\d+\.\d+)\.(.*)', r'\1', control.__version__)
9598
# The full version, including alpha/beta/rc tags.
96-
release = '0.6e'
99+
release = control.__version__
100+
print("version %s, release %s" % (version, release))
97101

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

0 commit comments

Comments
 (0)