From: Daira Hopwood Date: Thu, 5 Sep 2013 18:04:56 +0000 (+0100) Subject: Mon Dec 5 05:50:49 GMT 2011 Brian Warner X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/uri/flags/(%5B%5E?a=commitdiff_plain;h=6470b3cf841fec9c85c97a7cfa291e3a062b295c;p=tahoe-lafs%2Ftahoe-lafs.git Mon Dec 5 05:50:49 GMT 2011 Brian Warner * setup.py: stop putting pyutil.version_class/etc in _version.py allmydata.__version__ can just be a string, it doesn't need to be an instance of some fancy NormalizedVersion class. Everything inside Tahoe uses str(__version__) anyways. Also add .dev0 when a git tree is dirty. Closes #1466 --- diff --git a/setup.py b/setup.py index ab2f1d27..3d2671b8 100644 --- a/setup.py +++ b/setup.py @@ -256,6 +256,15 @@ class MakeExecutable(Command): raise +DARCS_VERSION_BODY = ''' +# This _version.py is generated from darcs metadata by the tahoe setup.py +# and the "darcsver" package. + +__pkgname__ = "%(pkgname)s" +verstr = "%(pkgversion)s" +__version__ = verstr +''' + GIT_VERSION_BODY = ''' # This _version.py is generated from git metadata by the tahoe setup.py. @@ -263,13 +272,7 @@ __pkgname__ = "%(pkgname)s" real_version = "%(version)s" full_version = "%(full)s" verstr = "%(normalized)s" -try: - from pyutil.version_class import Version as pyutil_Version - __version__ = pyutil_Version(verstr) -except (ImportError, ValueError): - # Maybe there is no pyutil installed. - from distutils.version import LooseVersion as distutils_Version - __version__ = distutils_Version(verstr) +__version__ = verstr ''' def run_command(args, cwd=None, verbose=False): @@ -337,6 +340,7 @@ def versions_from_git(tag_prefix, verbose=False): full = stdout.strip() if version.endswith("-dirty"): full += "-dirty" + normalized_version += ".dev0" return {"version": version, "normalized": normalized_version, "full": full} @@ -364,7 +368,8 @@ class UpdateVersion(Command): from darcsver.darcsvermodule import update (rc, verstr) = update(pkgname=self.distribution.get_name(), verfilename=self.distribution.versionfiles, - revision_number=True) + revision_number=True, + version_body=DARCS_VERSION_BODY) if rc == 0: return verstr