diff --git a/docs/conf.py b/docs/conf.py index 0685cd5..7f81012 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -57,7 +57,16 @@ # built documents. # # The short X.Y version. -from migration_test_repo._version import __version__ as version +import re +filename = os.path.join(os.path.dirname(__file__), "..", "migration_test_repo", "_version.py") +if os.path.isfile(filename): + verstrline = open(filename, "rt").read() + VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" + mo = re.search(VSRE, verstrline, re.M) + if mo: + version = mo.group(1) + else: + version = None # The full version, including alpha/beta/rc tags. release = version