jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/959947 )
Change subject: [doc] Center branding text in sidebar
......................................................................
[doc] Center branding text in sidebar
Most recent documentation builds no longer center the text in the
sidebar. Instead, it's aligned to the left. This is probably due
to changes in Sphinx 6.0.0 that broke a variable Furo relies on
to center that text. I was not able to pinpoint the root cause so
I'm proposing custom CSS as a workaround. Tested with Sphinx 7.2.3
and Furo 2023.09.10.
Change-Id: Ib33c97355cfe2b696d72c5520bcd69a2c691bfec
---
M docs/_static/css/pywikibot.css
1 file changed, 21 insertions(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/docs/_static/css/pywikibot.css b/docs/_static/css/pywikibot.css
index b03fa36..80e0450 100644
--- a/docs/_static/css/pywikibot.css
+++ b/docs/_static/css/pywikibot.css
@@ -5,6 +5,11 @@
max-width: 75%;
}
+/** centering sidebar branding text as a workaround **/
+.sidebar-brand {
+ text-align: center;
+}
+
/** brand text in the sidebar smaller than default **/
.sidebar-brand-text {
font-size: 1rem;
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/959947
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ib33c97355cfe2b696d72c5520bcd69a2c691bfec
Gerrit-Change-Number: 959947
Gerrit-PatchSet: 1
Gerrit-Owner: KBach <kbach(a)wikimedia.org>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/959331 )
Change subject: [bugfix] upcast to FilePage for a proper extension only
......................................................................
[bugfix] upcast to FilePage for a proper extension only
- also raise ValueError if no file extension is given
- update pagegenerators_tests TestWantedFactoryGenerator accordingly
and take into account that generator yields a Page instead of a
FilePage.
Bug: T346889
Change-Id: I4f6b52b456655a64bed54780b973d552b7a9eeda
---
M pywikibot/page/_filepage.py
M tests/pagegenerators_tests.py
M pywikibot/data/api/_generators.py
3 files changed, 27 insertions(+), 5 deletions(-)
Approvals:
JJMC89: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/data/api/_generators.py b/pywikibot/data/api/_generators.py
index 3090ef3..e483ef3 100644
--- a/pywikibot/data/api/_generators.py
+++ b/pywikibot/data/api/_generators.py
@@ -11,6 +11,7 @@
# Distributed under the terms of the MIT license.
#
from abc import ABC, abstractmethod
+from contextlib import suppress
from typing import Union
from warnings import warn
@@ -719,7 +720,8 @@
if ns == 2:
p = pywikibot.User(p)
elif ns == 6:
- p = pywikibot.FilePage(p)
+ with suppress(ValueError):
+ p = pywikibot.FilePage(p)
elif ns == 14:
p = pywikibot.Category(p)
update_page(p, pagedata, self.props)
diff --git a/pywikibot/page/_filepage.py b/pywikibot/page/_filepage.py
index 4cb91fe..f9347ad 100644
--- a/pywikibot/page/_filepage.py
+++ b/pywikibot/page/_filepage.py
@@ -55,9 +55,10 @@
super().__init__(source, title, 6)
if self.namespace() != 6:
raise ValueError(f"'{self.title()}' is not in the file namespace!")
- title = self.title(with_section=False)
- extension = title.rpartition('.')[2].lower()
- if extension not in self.site.file_extensions:
+
+ title = self.title(with_ns=False, with_section=False)
+ _, sep, extension = title.rpartition('.')
+ if not sep or extension.lower() not in self.site.file_extensions:
raise ValueError(
f'{title!r} does not have a valid extension '
f'({", ".join(self.site.file_extensions)}).'
diff --git a/tests/pagegenerators_tests.py b/tests/pagegenerators_tests.py
index 607617b..f6b90b6 100755
--- a/tests/pagegenerators_tests.py
+++ b/tests/pagegenerators_tests.py
@@ -1435,7 +1435,11 @@
"""Test wantedfiles generator."""
self.gf.handle_arg('-wantedfiles:5')
for page in self._generator_with_tests():
- self.assertIsInstance(page, pywikibot.FilePage)
+ self.assertIsInstance(page, pywikibot.Page)
+ if not isinstance(page, pywikibot.FilePage):
+ with self.assertRaisesRegex(ValueError,
+ 'does not have a valid extension'):
+ pywikibot.FilePage(page)
def test_wanted_templates(self):
"""Test wantedtemplates generator."""
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/959331
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I4f6b52b456655a64bed54780b973d552b7a9eeda
Gerrit-Change-Number: 959331
Gerrit-PatchSet: 5
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: JJMC89 <JJMC89.Wikimedia(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/959185 )
Change subject: [tests] Speedup script_tests
......................................................................
[tests] Speedup script_tests
Do not collect scripts for 'TestScriptGenerator' it they are in
'_expected_failures' set
Change-Id: Ie42f4ba2e3297657302744de5a7a7694804f10ae
---
M tests/script_tests.py
1 file changed, 15 insertions(+), 1 deletion(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/tests/script_tests.py b/tests/script_tests.py
index d60ce6c..435683e 100755
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -306,13 +306,15 @@
.format(script_name, arguments))
if script_name in dct['_expected_failures']:
+ if name == 'TestScriptGenerator':
+ continue # do not test it
dct[test_name] = unittest.expectedFailure(dct[test_name])
elif script_name in dct['_allowed_failures']:
dct[test_name] = unittest.skip(
'{} is in _allowed_failures set'
.format(script_name))(dct[test_name])
elif script_name in failed_dep_script_set \
- and arguments == '-simulate':
+ and name == 'TestScriptSimulate':
dct[test_name] = unittest.skip(
'{} has dependencies; skipping'
.format(script_name))(dct[test_name])
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/959185
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ie42f4ba2e3297657302744de5a7a7694804f10ae
Gerrit-Change-Number: 959185
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/959244 )
Change subject: [8.4.0.dev3] Update master branch
......................................................................
[8.4.0.dev3] Update master branch
Change-Id: Iad131b3a127594419fb82dd8320d92c785f5352b
---
M ROADMAP.rst
M pywikibot/__metadata__.py
M HISTORY.rst
M pywikibot/site/_apisite.py
4 files changed, 22 insertions(+), 6 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Verified; Looks good to me, approved
diff --git a/HISTORY.rst b/HISTORY.rst
index 3be84a5..30e2456 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -1,12 +1,21 @@
Release history
===============
+8.3.3
+-----
+*20. September 2023*
+
+* Extract code and family from dbname in :meth:`site.APISite.fromDBName()
+ <pywikibot.site._apisite.APISite.fromDBName>` (:phab:`T345036`)
+* L10N and i18n updates
+
+
8.3.2
-----
*29. August 2023*
* Add support for tlywiki (:phab:`T345172`)
-* i18n updates
+* L10N and i18n updates
8.3.1
diff --git a/ROADMAP.rst b/ROADMAP.rst
index 20647e7..9814645 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -6,12 +6,10 @@
method became a staticmethod (:phab:`T306637`)
* raise ValueError when :class:`pywikibot.FilePage` title doesn't have a valid file extension (:phab:`T345786`)
* :attr:`site.APISite.file_extensions <pywikibot.site._apisite.APISite.file_extensions>` property was added (:phab:`T345786`)
-* Extract code and family from dbname in :meth:`site.APISite.fromDBName()
- <pywikibot.site._apisite.APISite.fromDBName>` (:phab:`T345036`)
* ``dropdelay`` and ``releasepid`` attributes of :class:`throttle.Throttle` where deprecated
in favour of `expiry` class attribute
* Add https scheme if missing in url asked by :mod:`pywikibot.scripts.generate_family_file`
-* i18n updates
+* L10N updates and i18n updates
* use inline re.IGNORECASE flag in :func:`textlib.case_escape` function (:phab:`T308265`)
* Convert URL-encoded characters also for links outside main namespace with
:meth:`cosmetic_changes.CosmeticChangesToolkit.cleanUpLinks` (:phab:`T342470`)
diff --git a/pywikibot/__metadata__.py b/pywikibot/__metadata__.py
index dce7f31..99bdf96 100644
--- a/pywikibot/__metadata__.py
+++ b/pywikibot/__metadata__.py
@@ -11,7 +11,7 @@
__name__ = 'pywikibot'
-__version__ = '8.4.0.dev2'
+__version__ = '8.4.0.dev3'
__description__ = 'Python MediaWiki Bot Framework'
__maintainer__ = 'The Pywikibot team'
__maintainer_email__ = 'pywikibot(a)lists.wikimedia.org'
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py
index 99be28c..33d1752 100644
--- a/pywikibot/site/_apisite.py
+++ b/pywikibot/site/_apisite.py
@@ -191,7 +191,7 @@
) -> BaseSite:
"""Create a site from a database name using the sitematrix.
- .. versionchanged:: 8.4
+ .. versionchanged:: 8.3.3
changed from classmethod to staticmethod.
:param dbname: database name
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/959244
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Iad131b3a127594419fb82dd8320d92c785f5352b
Gerrit-Change-Number: 959244
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged