Last modified: 2014-05-11 14:23:02 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T67156, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65156 - Switch to more sensible version comparison
Switch to more sensible version comparison
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
core-(2.0)
All All
: Unprioritized normal
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-10 19:50 UTC by Merlijn van Deen (test)
Modified: 2014-05-11 14:23 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Merlijn van Deen (test) 2014-05-10 19:50:42 UTC
family.versionnumber now uses a regex:

        R = re.compile(r"(\d+).(\d+)")
        M = R.search(self.version(code))

and then returns the following:

return 1000 * int(M.group(1)) + int(M.group(2)) - 1000


so 1.10 is 10, 1.21 is 21, and 2.15 is 1015 (?!).



We should probably either use "from distutils.version import StrictVersion" or parse the version in a (major, minor, sub) tuple.
Comment 1 xqt 2014-05-10 20:06:04 UTC
I propose LooseVersion as LV which enables comparing mw Version like "1.23wmf17" directly e.g.

>>> LV("1.23wmf1") < LV("1.23wmf2") < LV("1.24") < LV("1.24wmf1") < LV("1.24wmf10") < LV("2.1")
True
Comment 2 Gerrit Notification Bot 2014-05-10 20:30:37 UTC
Change 132741 had a related patch set uploaded by Xqt:
(bug 65156) use LooseVersion to compare mw versions

https://gerrit.wikimedia.org/r/132741
Comment 3 Gerrit Notification Bot 2014-05-11 13:37:43 UTC
Change 132741 merged by jenkins-bot:
(bug 65156) use LooseVersion to compare mw versions

https://gerrit.wikimedia.org/r/132741

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links