Set the version dynamically from the pywinauto\__init__.py module

This commit is contained in:
markm 2010-12-19 17:54:31 +09:00
parent a941bcfa3f
commit 9bf305a472

@ -15,9 +15,23 @@
# serve to show the default.
import sys, os
import re
sys.path.append("..")
sys.path.append(".")
ver_re = re.compile(r'''__version__\s*\=\s*(['"])(.*)\1''')
f = open(os.path.join(
os.path.dirname(__file__), '..', 'pywinauto', '__init__.py'))
init_data = f.read()
f.close()
found = ver_re.search(init_data)
if not found:
raise RuntimeError(
"Could not read version information from __init__.py")
version = release = found.group(2)
# If your extensions are in another directory, add it here. If the directory
# is relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
@ -44,16 +58,16 @@ master_doc = 'contents'
# General information about the project.
project = u'pywinauto'
copyright = u'2009, Mark Mc Mahon'
copyright = u'2010, Mark Mc Mahon'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.3.9'
#version = '0.3.9'
# The full version, including alpha/beta/rc tags.
release = '0.3.9'
#release = '0.3.9'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.