From c8f2173a04795d5807d909bd548683849c87a854 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Wed, 24 Mar 2010 15:36:28 -0700 Subject: [PATCH] Use a hack to get the version instead of relying on pkg_resources. This allows the docs to be built without having to install deluge. --- docs/source/conf.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 1eb10e220..392cee1a5 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -42,10 +42,17 @@ copyright = '2008-2010, Deluge Team' # The default replacements for |version| and |release|, also used in various # other places throughout the built documents. # + +def find_version(): + f = open("../../setup.py", "r") + for line in f: + if " version = " in line: + return line.strip().replace("\"", "").replace(" ", "").replace(",", "").split("=")[1] + # The short X.Y version. -version = deluge.common.get_version() +version = find_version() # The full version, including alpha/beta/rc tags. -release = deluge.common.get_version() +release = version # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: