On 27 February 2016 at 00:52, Doug Hellmann <d...@doughellmann.com> wrote:
> 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.

I'll review in detail on gerrit, but we probably want an option to get
a *released* versions of debian and rpm versions too - not just the
current version - thats basically
v= SemanticVersion(orig_v.brief_string())
v.debian_string()
v.rpm_string()

-Rob




-- 
Robert Collins <rbtcoll...@hpe.com>
Distinguished Technologist
HP Converged Cloud

__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to