jenkins-bot has submitted this change and it was merged.
Change subject: MediaWikiVersion: handle '-alpha' in version ......................................................................
MediaWikiVersion: handle '-alpha' in version
Bug: T109164 Change-Id: I1e25f26ca69d71bba8d1f1b143f992270b19d5b1 --- M pywikibot/tools/__init__.py M tests/mediawikiversion_tests.py 2 files changed, 2 insertions(+), 1 deletion(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py index aa1ea4a..51c05df 100644 --- a/pywikibot/tools/__init__.py +++ b/pywikibot/tools/__init__.py @@ -447,7 +447,7 @@ self._dev_version = (2, int(version_match.group(4))) elif version_match.group(5): self._dev_version = (3, int(version_match.group(5))) - elif version_match.group(2) == 'alpha': + elif version_match.group(2) in {'alpha', '-alpha'}: self._dev_version = (1, ) else: for handled in ('wmf', 'alpha', 'beta', 'rc'): diff --git a/tests/mediawikiversion_tests.py b/tests/mediawikiversion_tests.py index 9666170..c6c3f60 100644 --- a/tests/mediawikiversion_tests.py +++ b/tests/mediawikiversion_tests.py @@ -65,6 +65,7 @@ self._version_check('1.23', (1, 23), (4, ), '') self._version_check('1.23wmf1', (1, 23), (0, 1), 'wmf1') self._version_check('1.23alpha', (1, 23), (1, ), 'alpha') + self._version_check('1.27.0-alpha', (1, 27, 0), (1, ), '-alpha') self._version_check('1.23beta1', (1, 23), (2, 1), 'beta1') self._version_check('1.23rc1', (1, 23), (3, 1), 'rc1') self._version_check('1.23-rc1', (1, 23), (3, 1), '-rc1')