jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/368192 )
Change subject: family.py: Get the stable MW version number from mediawiki.org ......................................................................
family.py: Get the stable MW version number from mediawiki.org
Use mediawiki.org's {{Template:MW stable release number}} to retrieve the latest stable MediaWiki version number.
The template is used on https://www.mediawiki.org/wiki/Download and looks to be reliable enough.
Change-Id: I158e4d01ca668d4569a65f54bee719dc2e05d7db --- M pywikibot/family.py 1 file changed, 5 insertions(+), 3 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/pywikibot/family.py b/pywikibot/family.py index 1ff3d7f..fd9ea4e 100644 --- a/pywikibot/family.py +++ b/pywikibot/family.py @@ -29,9 +29,7 @@ from warnings import warn
import pywikibot - from pywikibot import config - from pywikibot.exceptions import UnknownFamily, FamilyMaintenanceWarning from pywikibot.tools import ( deprecated, deprecated_args, issue_deprecation_warning, @@ -1268,7 +1266,11 @@ Use L{pywikibot.tools.MediaWikiVersion} to compare version strings. """ # Here we return the latest mw release for downloading - return '1.28.1' + if not hasattr(self, '_version'): + self._version = \ + pywikibot.Site('mediawiki', 'mediawiki').expand_text( + '{{MW stable release number}}') + return self._version
def force_version(self, code): """