Move __version__ from string to tuple type.
Bug #1402591 reported by
Matteo Nastasi
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 |
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.
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): str.split( '.')))
return tuple(map(int, version_