diff options
author | Calum Lind <calumlind+deluge@gmail.com> | 2014-09-20 19:34:25 +0100 |
---|---|---|
committer | Calum Lind <calumlind+deluge@gmail.com> | 2014-09-20 20:44:55 +0100 |
commit | 6b7df9ca082f6ca57d32d0d32d8bbf8efa670124 (patch) | |
tree | 8262cc7caca071349c14cbe626708dddc6182c28 /docs/source/conf.py | |
parent | 5cc5d2e811d88d4742ed3b059aaa0e23f50b41a0 (diff) | |
download | deluge-6b7df9ca082f6ca57d32d0d32d8bbf8efa670124.tar.gz deluge-6b7df9ca082f6ca57d32d0d32d8bbf8efa670124.tar.bz2 deluge-6b7df9ca082f6ca57d32d0d32d8bbf8efa670124.zip |
Add version fallback for sphinx build with readthedocs
Diffstat (limited to 'docs/source/conf.py')
-rw-r--r-- | docs/source/conf.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/docs/source/conf.py b/docs/source/conf.py index c9d26f462..bfbae84cd 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -12,9 +12,15 @@ import os import sys -from ...version import get_version from datetime import date +import pkg_resources + +try: + from ...version import get_version +except ImportError: + get_version = None + # 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. @@ -76,9 +82,12 @@ copyright = '2008-%s, Deluge Team' % current_year # # The short X.Y version. -version = get_version(prefix='deluge-', suffix='.dev0') -# remove the created file by get_version -os.remove('RELEASE-VERSION') +if get_version: + version = get_version(prefix='deluge-', suffix='.dev0') + # remove the created file by get_version + os.remove('RELEASE-VERSION') +else: + version = pkg_resources.require("Deluge")[0].version # The full version, including alpha/beta/rc tags. release = version |