jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1345628?usp=email )
Change subject: release: Publish Pywikibot 11.8
......................................................................
release: Publish Pywikibot 11.8
Change-Id: I7c70034eb71fc86151fe34e796ee5d8aa5776841
---
M AUTHORS.rst
M ROADMAP.rst
M pwb.py
M pywikibot/__metadata__.py
M pywikibot/site/_apisite.py
M tests/utils.py
6 files changed, 35 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/AUTHORS.rst b/AUTHORS.rst
index 00cea07..3dc3fab 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -34,6 +34,7 @@
Antoine Musso
Anton
Aram
+ Aryan Dubey
Avicennasis
Ayush Yadav
diff --git a/ROADMAP.rst b/ROADMAP.rst
index e0d3737..012e334 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -1,6 +1,9 @@
Release 11.8
============
+* Various performance, stability, and code quality improvements.
+* Raise ServerError instead of AssertionError for invalid
:meth:`APISite.userinfo()
+ <pywikibot.site._apisite.APISite.userinfo>` API response. (:phab:`T423061`)
* Load only current revision ID with :attr:`page.BasePage.latest_revision_id`.
* Return non-option defaults with :func:`bot.input_list_choice`.
(:phab:`T305937`)
* Add
:meth:`APISite.geosearch()<pywikibot.site._extensions.GeoDataMixin.geosearch>`
@@ -52,7 +55,6 @@
* Deduplicate intersections with a single input in
:func:`tools.itertools.intersect_generators`.
* Accept path-like filenames and detect suffixes case-insensitively in
:func:`tools.open_archive`.
* Add support for all existing Beta Cluster wikis. (:phab:`T225892`)
-* Various performance, stability, and code quality improvements.
* Support selective page preloading of :meth:`APISite.preloadpages
<pywikibot.site._generators.GeneratorsMixin.preloadpages>` with
:func:`pagegenerators.PreloadingGenerator` and
:func:`pagegenerators.DequePreloadingGenerator`.
diff --git a/pwb.py b/pwb.py
index 21a9bd8..47b31d1 100755
--- a/pwb.py
+++ b/pwb.py
@@ -19,12 +19,24 @@
This version of Pywikibot only supports Python 3.9+.
"""
+DEPRECATED_PYTHON_MESSAGE = """
+
+Python {version} will be dropped soon with Pywikibot 12.
+It is recommended to use Python 3.10 or above.
+See phab:T423572 for further information.
+"""
+
def python_is_supported():
"""Check that Python is supported."""
return sys.version_info[:3] >= (3, 9)
+def python_is_deprecated():
+ """Check that Python is deprecated."""
+ return sys.version_info[:3] < (3, 10)
+
+
if not python_is_supported(): # pragma: no cover
sys.exit(VERSIONS_REQUIRED_MESSAGE.format(version=sys.version))
@@ -36,5 +48,13 @@
runpy.run_path(str(path), run_name='__main__')
+if python_is_deprecated():
+ import warnings
+ msg = DEPRECATED_PYTHON_MESSAGE.format(
+ version=sys.version.split(maxsplit=1)[0])
+ warnings.warn(msg, FutureWarning) # adjust this line no in utils.execute()
+ del warnings
+
+
if __name__ == '__main__':
sys.exit(main())
diff --git a/pywikibot/__metadata__.py b/pywikibot/__metadata__.py
index 5185839..31fb95e 100644
--- a/pywikibot/__metadata__.py
+++ b/pywikibot/__metadata__.py
@@ -12,6 +12,6 @@
from time import strftime
-__version__ = '11.8.0.dev0'
+__version__ = '11.8.0'
__url__ = 'https://www.mediawiki.org/wiki/Manual:Pywikibot'
__copyright__ = f'2003-{strftime("%Y")}, Pywikibot team'
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py
index 446566f..6185563 100644
--- a/pywikibot/site/_apisite.py
+++ b/pywikibot/site/_apisite.py
@@ -655,6 +655,9 @@
.. seealso:: :api:`Userinfo`
.. version-changed:: 8.0
Use API formatversion 2.
+ .. version-changed:: 11.8
+ Raise ServerError instead of AttributeError if response lacks
+ 'query' or 'userinfo' key.
:return: A dict with the following keys and values:
@@ -665,6 +668,7 @@
- rights: list of rights (could be empty)
- messages: True if user has a new message on talk page (bool)
- blockinfo: present if user is blocked (dict)
+ :raises ServerError: response lacks 'query' or 'userinfo' key.
"""
if not hasattr(self, '_userinfo'):
uirequest = self.simple_request(
@@ -678,6 +682,7 @@
raise ServerError("API userinfo response lacks 'query' key")
if 'userinfo' not in uidata['query']:
raise ServerError("API userinfo response lacks 'userinfo' key")
+
self._userinfo = uidata['query']['userinfo']
if self._loginstatus != login.LoginStatus.IN_PROGRESS \
and ('anon' in self._userinfo or not self._userinfo.get('id')):
diff --git a/tests/utils.py b/tests/utils.py
index 532bba9..eda787b 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -26,6 +26,7 @@
from pywikibot.exceptions import APIError
from pywikibot.login import LoginStatus
from pywikibot.site import Namespace
+from pywikibot.tools import PYTHON_VERSION
from pywikibot.tools.collections import EMPTY_DEFAULT
from tests import _pwb_py
@@ -496,6 +497,10 @@
captured stderr, and the :exc:`subprocess.TimeoutExpired`
exception if the process timed out.
"""
+ if PYTHON_VERSION < (3, 10):
+ command.insert(1, '-W ignore::FutureWarning:pwb:55')
+ command.insert(1, '-W ignore::FutureWarning:__main__:55')
+
env = os.environ.copy()
# Prevent output by test package; e.g. 'max_retries reduced from x to y'
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1345628?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I7c70034eb71fc86151fe34e796ee5d8aa5776841
Gerrit-Change-Number: 1345628
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]