]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
setup.py: set distribution.metadata.version from _version.py if we couldn't find...
authorDaira Hopwood <daira@jacaranda.org>
Fri, 21 Nov 2014 05:28:31 +0000 (05:28 +0000)
committerDaira Hopwood <daira@jacaranda.org>
Fri, 21 Nov 2014 05:30:00 +0000 (05:30 +0000)
This simplifies reporting when we don't have the version. Also print the normalized version.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
setup.py

index 31f1289b6a5533e2489e3aa835ea03038dbdee8f..668b441816838ff004c3c65ba869e0c128c415c9 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -351,13 +351,15 @@ class UpdateVersion(Command):
     def finalize_options(self):
         pass
     def run(self):
+        global version
+        verstr = version
         if os.path.isdir(os.path.join(basedir, ".git")):
             verstr = self.try_from_git()
-        else:
-            print("no version-control data found, leaving _version.py alone")
-            return
+
         if verstr:
             self.distribution.metadata.version = verstr
+        else:
+            print("Warning: no version information found. This may cause tests to fail.")
 
     def try_from_git(self):
         versions = versions_from_git("allmydata-tahoe-")
@@ -374,7 +376,7 @@ class UpdateVersion(Command):
             f = open(fn, "wb")
             f.write(GIT_VERSION_PY % version_info)
             f.close()
-            print("git-version: wrote '%s' into '%s'" % (versions["version"], fn))
+            print("Wrote normalized version %r into '%s'" % (versions["normalized"], VERSION_PY_FILENAME))
 
         return versions.get("normalized", None)