From: Daira Hopwood Date: Fri, 21 Nov 2014 07:56:21 +0000 (+0000) Subject: setup.py: use constant for _version.py filename. X-Git-Tag: allmydata-tahoe-1.10.1a1~105^2~2 X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/file/URI:LIT:krugkidfnzsc4/somewhere?a=commitdiff_plain;h=b43447003e5f85a5ddd89b1fbbdd296135236597;p=tahoe-lafs%2Ftahoe-lafs.git setup.py: use constant for _version.py filename. Signed-off-by: Daira Hopwood --- diff --git a/setup.py b/setup.py index f18b82aa..1d165237 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,8 @@ def read_version_py(infname): if mo: return mo.group(1) -version = read_version_py("src/allmydata/_version.py") +VERSION_PY_FILENAME = 'src/allmydata/_version.py' +version = read_version_py(VERSION_PY_FILENAME) APPNAME='allmydata-tahoe' APPNAMEFILE = os.path.join('src', 'allmydata', '_appname.py') @@ -361,8 +362,7 @@ class UpdateVersion(Command): def try_from_git(self): versions = versions_from_git("allmydata-tahoe-") if versions: - fn = 'src/allmydata/_version.py' - f = open(fn, "wb") + f = open(VERSION_PY_FILENAME, "wb") f.write(GIT_VERSION_BODY % { "pkgname": self.distribution.get_name(), "version": versions["version"], @@ -371,7 +371,8 @@ class UpdateVersion(Command): "branch": versions["branch"], }) f.close() - print("git-version: wrote '%s' into '%s'" % (versions["version"], fn)) + print("git-version: wrote '%s' into '%s'" % (versions["version"], VERSION_PY_FILENAME)) + return versions.get("normalized", None)