From 10f82bd474c5bc91b330beccd883da06b0014a99 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Fri, 5 Aug 2016 11:56:48 -0400 Subject: adjust tools and version information. upstream snapshots are versioned in the format 'X.Y.Z+.g' where X.Y.Z are major, minor, and micro. Distance is number of commits since last annotated tag, and commit is the git commit. bddeb and brpm will now create and use the "upstream version" like above. Things changed here: - tools/make-tarball update cloudinit/version.py to contain the full version support --output support '--long' to always create the long format version string. - bddeb: - use quilt debian source format - use read-version and long version in changelog. - brpm: - change to use read-version and upstream long version in the spec. - flake8 changes - tools/read-version - read version from git or from cloudinit/version. - provide --json output with more nicely formed data. --- cloudinit/version.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'cloudinit') diff --git a/cloudinit/version.py b/cloudinit/version.py index 3d1d1d23..01785eb8 100644 --- a/cloudinit/version.py +++ b/cloudinit/version.py @@ -16,12 +16,17 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from distutils import version as vr +__VERSION__ = "0.7.6" +__EXPORT_VERSION__ = "@@EXPORT_VERSION@@" -def version(): - return vr.StrictVersion("0.7.7") +def version_string(): + if not __EXPORT_VERSION__.startswith("@@"): + return __EXPORT_VERSION__ + return __VERSION__ -def version_string(): - return str(version()) +def full_version_string(): + if __EXPORT_VERSION__.startswith("@@"): + raise ValueError("No full version available") + return __EXPORT_VERSION__ -- cgit v1.2.3