diff --git a/docs/conf.py b/docs/conf.py index 9320050..80aa19d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -21,29 +21,7 @@ # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.append(os.path.abspath('..')) - -def relative(filename): - here = os.path.dirname('__file__') - return os.path.join(here, filename) - - -def read(filename): - with io.open(relative(filename), encoding='UTF-8') as f: - return f.read() - - -def get_version(): - r = re.compile('''^__version__ = ["'](.+)["']$''') - for line in read('../objgraph.py').splitlines(): - m = r.match(line) - if m: - return m.group(1) - raise AssertionError('Could not determine version number from objgraph.py') - - -def get_short_version(): - return '.'.join(get_version().split('.')[:2]) - +import objgraph # -- General configuration ----------------------------------------------------- @@ -80,9 +58,9 @@ def get_short_version(): # built documents. # # The short X.Y version. -version = get_short_version() +version = objgraph.__version__ # The full version, including alpha/beta/rc tags. -release = get_version() +release = objgraph.__version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.