Export version number as a tuple

Bug #497585 reported by Jonathan Lange
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
launchpadlib
Triaged
Low
Unassigned

Bug Description

launchpadlib is a library that other applications are coming to depend on. The API for launchpadlib itself is still in flux, with new APIs being added in each release.

It would be very useful to have a tuple of integers provided by launchpadlib that described the version. This way, depending applications could make intelligent decisions about whether they can work with a particular version of launchpadlib.

Note that this is a fairly standard practice among Python libraries. See bzrlib for an example of this being done well.

Revision history for this message
Leonard Richardson (leonardr) wrote :

Just to be sure: you're talking about the Python API of launchpadlib itself (things like Launchpad.login_with), right? Not launchpadlib's Python interface to the Launchpad web service, which is entirely determined by the documents Launchpad serves.

Revision history for this message
Jonathan Lange (jml) wrote :

Yes, that's right. login_with and launchpadlib.uris being the most interesting things for me personally.

Changed in launchpadlib:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Gary Poster (gary) wrote :

I suspect you don't like these, but they exist.

>>> import launchpadlib
>>> launchpadlib.__version__
'1.6.0'
>>> import pkg_resources
>>> pkg_resources.working_set.find(pkg_resources.Requirement.parse('launchpadlib')).parsed_version
('00000001', '00000006', '*final')

Revision history for this message
Jonathan Lange (jml) wrote :

Thanks Gary. I knew about the __version__ string, but that's a difficult thing to do programmatic comparison on.

I didn't know about pkg_resources though. Maybe it's not the place to ask, but, why aren't those zero-prefix numbers represented as actual ints?

Revision history for this message
Gary Poster (gary) wrote : Re: [Bug 497585] Re: Export version number as a tuple

On Apr 23, 2010, at 12:30 PM, Jonathan Lange wrote:

> Thanks Gary. I knew about the __version__ string, but that's a difficult
> thing to do programmatic comparison on.

Ack.

> I didn't know about pkg_resources though. Maybe it's not the place to
> ask, but, why aren't those zero-prefix numbers represented as actual
> ints?

Ask PJE :-)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.