summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDomen Kožar <domen@dev.si>2013-02-23 15:14:23 +0100
committerDomen Kožar <domen@dev.si>2013-02-23 15:14:23 +0100
commita1afa902da2b66c6df14a206c34edcfb63b7ac06 (patch)
tree9872f2373344c94907bc98f26cdf1f40eb3c6073 /docs
parenta1e6d544f51acd1080e97a1ddab2e85557b50584 (diff)
downloadwebtest-a1afa902da2b66c6df14a206c34edcfb63b7ac06.tar.gz
figure out webtest version in docs more gently
Diffstat (limited to 'docs')
-rw-r--r--docs/conf.py20
1 files changed, 3 insertions, 17 deletions
diff --git a/docs/conf.py b/docs/conf.py
index b223d48..c15bb90 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -46,11 +46,9 @@ copyright = '2012, Ian Bicking'
# 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.1'
-# The full version, including alpha/beta/rc tags.
-release = '0.1'
+import pkg_resources
+version = pkg_resources.get_distribution(project).version
+release = version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -241,18 +239,6 @@ texinfo_documents = [
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
-from os import path
-pkg_dir = path.abspath(__file__).split('/docs')[0]
-setup = path.join(pkg_dir, 'setup.py')
-if path.isfile(setup):
- for line_ in open(setup):
- if line_.startswith("version"):
- version = line_.split('=')[-1]
- version = version.strip()
- version = version.strip("'\"")
- release = version
- break
-del pkg_dir, setup, path
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd: