From b43447003e5f85a5ddd89b1fbbdd296135236597 Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Fri, 21 Nov 2014 07:56:21 +0000 Subject: [PATCH] setup.py: use constant for _version.py filename. Signed-off-by: Daira Hopwood --- setup.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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) -- 2.45.2