Move __version__ from string to tuple type.

Bug #1402591 reported by Matteo Nastasi
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake Engine
New
Wishlist
Unassigned

Bug Description

Using a tuple to describe the version a correct comparison will be possible.

Currently a comparison between "1.2.10" and "1.2.2" return wrong result because is using lessicographical ordering.

From ipython:
In [1]: (1, 2, 10) > (1, 2, 2)
Out[1]: True

In [2]: "1.2.10" > "1.2.2"
Out[2]: False

Moreover, we should increase the minor version when running from Git.

Changed in oq-engine:
milestone: none → 1.3.0
description: updated
Revision history for this message
Michele Simionato (michele-simionato) wrote :

Changing this will break the sed scripts we are using. Why don't we just introduce a function converting the version into a tuple?

Something like

def version_tuple(version_str):
    return tuple(map(int, version_str.split('.')))

Changed in oq-engine:
milestone: 1.3.0 → 1.4.0
Changed in oq-engine:
milestone: 1.4.0 → 1.5.0
Changed in oq-engine:
importance: Undecided → Wishlist
Changed in oq-engine:
milestone: 1.5.0 → none
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.