[openstack-dev] How do I calculate the semantic version prior to a release?

Doug Hellmann doug at doughellmann.com
Fri Feb 26 11:52:03 UTC 2016


Excerpts from Neil Jerram's message of 2016-02-26 11:27:05 +0000:
> On 26/02/16 11:16, Neil Jerram wrote:
> > I understand the semantic versioning algorithm for calculating a new
> > version.  But what do I run, in a git repository, to do that calculation
> > for me, and output:
> >
> > - the new semantic version that would be used if I asked for a formal
> > release to PyPI
> >
> > - the corresponding Debian version
> >
> > - the corresponding RPM version.
> >
> > Thanks,
> >     Neil
> 
> The following seems to work, but is it the best way?
> 
> from pbr import version
> 
> v = version.VersionInfo('networking-calico').semantic_version()
> print v.release_string()
> print v.brief_string()
> print v.debian_string()
> print v.rpm_string()

Those do work. I found that there's also an rpm_version command
available like this:

  python setup.py rpm_version

I don't see a similar command for getting the deb version.

I threw together https://review.openstack.org/#/c/285250/ with some
additions to pbr's "info" command to expose these formats.

Doug



More information about the OpenStack-dev mailing list