jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1032812?usp=email )
Change subject: [doc] fix deprecation list
......................................................................
[doc] fix deprecation list
Change-Id: I81459c13284b21687b82f3319c96ce5d4216aae7
Signed-off-by: Xqt <info(a)gno.de>
---
M ROADMAP.rst
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/ROADMAP.rst b/ROADMAP.rst
index 1bfeda5..d1ef503 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -66,7 +66,7 @@
* 7.5.0: :mod:`textlib`.tzoneFixedOffset class will be removed in favour of :class:`time.TZoneFixedOffset`
* 7.4.0: ``FilePage.usingPages()`` was renamed to :meth:`using_pages()<pywikibot.FilePage.using_pages>`
* 7.3.0: Old color escape sequences like ``\03{color}`` is deprecated in favour of new color format like <<color>>
-* 7.3.0: ``linkitrail`` method of :class:`family.Family` is deprecated; use :meth:`APISite.linktrail()
+* 7.3.0: ``linktrail`` method of :class:`family.Family` is deprecated; use :meth:`APISite.linktrail()
<pywikibot.site._apisite.APISite.linktrail>` instead
* 7.2.0: ``tb`` parameter of :func:`exception()<pywikibot.exception>` function was renamed to ``exc_info``
* 7.2.0: XMLDumpOldPageGenerator is deprecated in favour of a ``content`` parameter of
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1032812?usp=email
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: I81459c13284b21687b82f3319c96ce5d4216aae7
Gerrit-Change-Number: 1032812
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
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/+/1033606?usp=email )
Change subject: [doc] fix doc string with duplicate string entries
......................................................................
[doc] fix doc string with duplicate string entries
Change-Id: I511426ed8120796f7c1da97bfad10fa423aeb302
---
M pywikibot/tools/_deprecate.py
1 file changed, 6 insertions(+), 5 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/tools/_deprecate.py b/pywikibot/tools/_deprecate.py
index d8c56d3..9bbc133 100644
--- a/pywikibot/tools/_deprecate.py
+++ b/pywikibot/tools/_deprecate.py
@@ -174,7 +174,7 @@
`since`parameter must be a release number, not a timestamp.
:param instead: suggested replacement for the deprecated object
- :param since: a version string string when the method was deprecated
+ :param since: a version string when the method or function was deprecated
"""
if since and '.' not in since:
raise ValueError(f'{since} is not a valid release number')
@@ -204,7 +204,7 @@
:param depth: depth + 1 will be used as stacklevel for the warnings
:param warning_class: a warning class (category) to be used,
defaults to FutureWarning
- :param since: a version string string when the method was deprecated
+ :param since: a version string when the method or function was deprecated
"""
msg = _build_msg_string(instead, since)
if warning_class is None:
@@ -221,7 +221,7 @@
:keyword str instead: if provided, will be used to specify the
replacement
- :keyword str since: a version string string when the method was
+ :keyword str since: a version string when the method or function was
deprecated
:keyword bool future_warning: if True a FutureWarning will be thrown,
otherwise it provides a DeprecationWarning
@@ -525,7 +525,7 @@
new function.
:param class_name: The name of the class. It's added to the target and
source module (separated by a '.').
- :param since: a version string string when the method was deprecated
+ :param since: a version string when the method or function was deprecated
:param future_warning: if True a FutureWarning will be thrown,
otherwise it provides a DeprecationWarning
:return: A new function which adds a warning prior to each execution.
@@ -602,7 +602,8 @@
object name, and evaluated when the deprecated object is needed.
:param warning_message: The warning to display, with positional
variables: {0} = module, {1} = attribute name, {2} = replacement.
- :param since: a version string string when the method was deprecated
+ :param since: a version string when the method or function was
+ deprecated
:param future_warning: if True a FutureWarning will be thrown,
otherwise it provides a DeprecationWarning
"""
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1033606?usp=email
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: I511426ed8120796f7c1da97bfad10fa423aeb302
Gerrit-Change-Number: 1033606
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
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/+/1033192?usp=email )
Change subject: [fix] show the right docstring with tools.deprecated
......................................................................
[fix] show the right docstring with tools.deprecated
Previously the docstring of the outer wrapper of add_full_name
decorator was shown as the docstring of deprecated function.
Now remove the add_full_name when Sphinx is running.
Use the same technique with allow_asynchronous decorator.
Bug: T365286
Change-Id: I292bb7a3dc7a2804a77ce84dcf228848fc3239a4
---
M pywikibot/page/_decorators.py
M pywikibot/tools/_deprecate.py
2 files changed, 24 insertions(+), 21 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/page/_decorators.py b/pywikibot/page/_decorators.py
index 9108cc8..38c2d1f 100644
--- a/pywikibot/page/_decorators.py
+++ b/pywikibot/page/_decorators.py
@@ -1,6 +1,6 @@
"""Decorators for Page objects."""
#
-# (C) Pywikibot team, 2017-2022
+# (C) Pywikibot team, 2017-2024
#
# Distributed under the terms of the MIT license.
#
@@ -12,20 +12,17 @@
OtherPageSaveError,
PageSaveRelatedError,
)
-from pywikibot.tools import add_full_name, manage_wrapping
+from pywikibot.tools import SPHINX_RUNNING, add_full_name, manage_wrapping
-# decorating this function leads sphinx to hide it
-def _allow_asynchronous(func):
- """
- Decorator to make it possible to run a BasePage method asynchronously.
+def allow_asynchronous(func):
+ """Decorator to make it possible to run a BasePage method asynchronously.
- This is done when the method is called with kwarg asynchronous=True.
- Optionally, you can also provide kwarg callback, which, if provided, is
- a callable that gets the page as the first and a possible exception that
- occurred during saving in the second thread or None as the second argument.
-
- :meta public:
+ This is done when the method is called with kwarg
+ :code:`asynchronous=True`. Optionally, you can also provide kwarg
+ callback, which, if provided, is a callable that gets the page as
+ the first and a possible exception that occurred during saving in
+ the second thread or None as the second argument.
"""
def handle(func, self, *args, **kwargs):
do_async = kwargs.pop('asynchronous', False)
@@ -59,5 +56,6 @@
return wrapper
-#: `_allow_asynchronous` decorated with :func:`tools.add_full_name`
-allow_asynchronous = add_full_name(_allow_asynchronous)
+if not SPHINX_RUNNING:
+ # T365286: decorate allow_asynchronous function with add_full_name
+ allow_asynchronous = add_full_name(allow_asynchronous)
diff --git a/pywikibot/tools/_deprecate.py b/pywikibot/tools/_deprecate.py
index 58409ac..d8c56d3 100644
--- a/pywikibot/tools/_deprecate.py
+++ b/pywikibot/tools/_deprecate.py
@@ -36,6 +36,8 @@
from typing import Any
from warnings import warn
+from pywikibot.tools import SPHINX_RUNNING
+
class _NotImplementedWarning(RuntimeWarning):
@@ -211,20 +213,18 @@
warn(msg.format(name, instead), warning_class, depth + 1)
-@add_full_name
def deprecated(*args, **kwargs):
"""Decorator to output a deprecation warning.
.. versionchanged:: 7.0
`since` keyword must be a release number, not a timestamp.
- :keyword instead: if provided, will be used to specify the replacement
- :type instead: str
- :keyword since: a version string string when the method was deprecated
- :type since: str
- :keyword future_warning: if True a FutureWarning will be thrown,
+ :keyword str instead: if provided, will be used to specify the
+ replacement
+ :keyword str since: a version string string when the method was
+ deprecated
+ :keyword bool future_warning: if True a FutureWarning will be thrown,
otherwise it provides a DeprecationWarning
- :type future_warning: bool
"""
def decorator(obj):
"""Outer wrapper.
@@ -304,6 +304,11 @@
return decorator
+if not SPHINX_RUNNING:
+ # T365286: decorate deprecated function with add_full_name
+ deprecated = add_full_name(deprecated)
+
+
def deprecate_arg(old_arg: str, new_arg: str | bool | None):
"""Decorator to declare old_arg deprecated and replace it with new_arg.
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1033192?usp=email
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: I292bb7a3dc7a2804a77ce84dcf228848fc3239a4
Gerrit-Change-Number: 1033192
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
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/+/1033112?usp=email )
Change subject: [doc] Update ROADMAP.rst and CHANGELOG.rst
......................................................................
[doc] Update ROADMAP.rst and CHANGELOG.rst
Change-Id: I0cf875da1aff1f62797302e827715e35a25da5ce
---
M ROADMAP.rst
M scripts/CHANGELOG.rst
2 files changed, 5 insertions(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/ROADMAP.rst b/ROADMAP.rst
index 7313b90..1bfeda5 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -1,11 +1,14 @@
Current release
---------------
+* Raise :exc:`exceptions.SectionError` if a section does not exists on a page (:phab:`T107141`)
* Retry api request on ServerError (:phab:`T364275`, :phab:`T364393`)
Deprecations
------------
+* 9.2.0: *total* argument in ``-logevents`` pagegenrators option is deprecated;
+ use ``-limit`` instead (:phab:`T128981`)
* 9.0.0: The *content* parameter of :meth:`proofreadpage.IndexPage.page_gen` is deprecated and will be ignored
(:phab:`T358635`)
* 9.0.0: ``userinterfaces.transliteration.transliterator`` was renamed to :class:`Transliterator
diff --git a/scripts/CHANGELOG.rst b/scripts/CHANGELOG.rst
index 334fac1..a7b5e4c 100644
--- a/scripts/CHANGELOG.rst
+++ b/scripts/CHANGELOG.rst
@@ -7,6 +7,8 @@
commons_information
^^^^^^^^^^^^^^^^^^^
+* Do not remove valid description parts of Information template (:phab:`T364640`)
+* Use transclusions of Information template as default generator
* Preload pages to make the script upto 10 times faster
noreferences
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1033112?usp=email
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: I0cf875da1aff1f62797302e827715e35a25da5ce
Gerrit-Change-Number: 1033112
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <dalangi-ctr(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/+/1033102?usp=email )
Change subject: [doc] Update tests documentation
......................................................................
[doc] Update tests documentation
Change-Id: I4596f0f0702c43ad9efcdb0fcf73c75da1c9daca
---
M tests/aspects.py
M tests/setup_tests.py
M tests/thanks_tests.py
M tests/version_tests.py
4 files changed, 15 insertions(+), 20 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/aspects.py b/tests/aspects.py
index 157210c..039542a 100644
--- a/tests/aspects.py
+++ b/tests/aspects.py
@@ -1288,17 +1288,19 @@
"""Test cases use :mod:`pwb` to invoke scripts.
- Test cases which use pwb typically also access a site, and use the network.
- Even during initialisation, scripts may call pywikibot.handle_args, which
- initialises loggers and uses the network to determine if the code is stale.
+ Test cases which use pwb typically also access a site, and use the
+ network. Even during initialisation, scripts may call
+ :func:`pywikibot.handle_args`, which initialises loggers and uses
+ the network to determine if the code is stale.
- The flag 'pwb' is used by the TestCase metaclass to check that a test site
- is set declared in the class properties, or that 'site = False' is added
- to the class properties in the unlikely scenario that the test case
- uses pwb in a way that doesn't use a site.
+ The flag 'pwb' is used by the TestCase metaclass to check that a
+ test site is set declared in the class properties, or that
+ :code:`site = False` is added to the class properties in the
+ unlikely scenario that the test case uses pwb in a way that doesn't
+ use a site.
- If a test class is marked as 'site = False', the metaclass will also check
- that the 'net' flag is explicitly set.
+ If a test class is marked as :code:`site = False , the metaclass
+ will also check that the ``net`` flag is explicitly set.
"""
pwb = True
diff --git a/tests/setup_tests.py b/tests/setup_tests.py
index 174aed5..8263f3a 100755
--- a/tests/setup_tests.py
+++ b/tests/setup_tests.py
@@ -1,8 +1,5 @@
#!/usr/bin/env python3
-"""Test setup.py.
-
-.. versionadded:: 9.0
-"""
+"""Test setup.py."""
#
# (C) Pywikibot team, 2024
#
diff --git a/tests/thanks_tests.py b/tests/thanks_tests.py
index 04b6fc9..19e5ca9 100755
--- a/tests/thanks_tests.py
+++ b/tests/thanks_tests.py
@@ -30,9 +30,8 @@
def test_thank_revision(self):
"""Test thanks for normal revisions.
- .. note:: This test relies on activity in recentchanges, and
- there must make edits made before reruns of this test.
- .. seealso:: :phab:`T137836`.
+ This test relies on activity in recentchanges, and there must
+ make edits made before reruns of this test; see :phab:`T137836`.
"""
site = self.get_site()
data = site.recentchanges(total=20)
diff --git a/tests/version_tests.py b/tests/version_tests.py
index 96a6de1..6da5b5d 100644
--- a/tests/version_tests.py
+++ b/tests/version_tests.py
@@ -1,8 +1,5 @@
#!/usr/bin/env python3
-"""Test cases for the :mod:`version` module.
-
-.. versionadded:: 9.2
-"""
+"""Test cases for the :mod:`version` module."""
#
# (C) Pywikibot team, 2024
#
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1033102?usp=email
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: I4596f0f0702c43ad9efcdb0fcf73c75da1c9daca
Gerrit-Change-Number: 1033102
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged