jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1103280?usp=email )

Change subject: Merge branch into stable_9.6.1
......................................................................

Merge branch into stable_9.6.1

- update 9.6.0 HISTORY.rst
- update 9.6.1 ROADMAP.rst
- update CHANGELOG.rst
- update metadata and scripts/__init__
- add support for tigwiki
- fix use of importlib.metadata.entry_points for Python < 3.10
- require Pywikibot 9.6.1 with pywikibot-scripts
- update 18n doctest

Change-Id: I8a4279463952a5616c33c7459fc7f660d3cd1038
---
M HISTORY.rst
M ROADMAP.rst
M pywikibot/__init__.py
M pywikibot/families/wikipedia_family.py
M pywikibot/i18n.py
M pywikibot/scripts/wrapper.py
M pywikibot/site/_apisite.py
M scripts/CHANGELOG.rst
M scripts/pyproject.toml
M tests/utils.py
11 files changed, 80 insertions(+), 34 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified




diff --git a/HISTORY.rst b/HISTORY.rst
index 186f92f..4d067ad 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -3,6 +3,7 @@

 9.6.0
 -----
+*03 December 2024*

 * Add support for idwikivoyage (:phab:`T381082`)
 * Add docstrings of :class:`tools.classproperty` methods (:phab:`T380628`)
@@ -51,7 +52,7 @@
 -----
 *05 October 2024*

-* Ignore :exc:`ValueError` durig upcast of 
:class:`FilePage<pywikibot.page.FilePage>` due to invalid file extension
+* Ignore :exc:`ValueError` during upcast of 
:class:`FilePage<pywikibot.page.FilePage>` due to invalid file extension
   (:phab:`T367777`, :phab:`T376452`)
 * Provide an entry point to connect foreign scripts with pwb wapper 
(:phab:`T139143`, :phab:`T139144`)
 * Show a warning message for a deleted or unknown 
:class:`Claim<pywikibot.Claim>` type (:phab:`T374676`)
@@ -117,7 +118,7 @@
 * No longer wait in :meth:`data.api.Request._http_request` for ``ImportError`` 
and ``NameError``
 * Replace ``requests.utils.urlparse`` with ``urllib.parse.urlparse`` in
   :func:`comms.http.get_authentication` (:phab:`T367649`)
-* Show an appropiate message if ``requests_oauthlib`` package is required but 
missing (:phab:`T353387`)
+* Show an appropriate message if ``requests_oauthlib`` package is required but 
missing (:phab:`T353387`)
 * Retry ``DBUnexpectedError`` in :meth:`data.api.Request._internal_api_error` 
(:phab:`T367383`)
 * Duplicated entries found in :mod:`pywikibot` were removed
 * Pass ``None`` instead of an empty string as *expiry* argument in
@@ -166,7 +167,7 @@

 * Circumvent problems with *unique* and *prefix* parameters in 
:meth:`Site.alllinks()
   <pywikibot.site._generators.GeneratorsMixin.alllinks>` (:phab:`T359427`)
-* Detect nighly version file with :func:`version.getversion_nightly` 
(:phab:`T362492`)
+* Detect nightly version file with :func:`version.getversion_nightly` 
(:phab:`T362492`)
 * :mod:`version`.github_svn_rev2hash() was removed; it was no longer 
functional (:phab:`T362484`)
 * SVN support has been dropped; ``.svnprops`` property settings was removed 
(:phab:`T362484`)
 * Skip process that requires login to logout (:phab:`T326614`)
@@ -721,7 +722,7 @@
 * Retry for internal_api_error_DBQueryTimeoutError errors due to 
:phab:`T297708`
 * Handle ParserError within xmlreader.XmlDump.parse() instead of raising an 
exception (:phab:`T306134`)
 * XMLDumpOldPageGenerator is deprecated in favour of a `content` parameter 
(:phab:`T306134`)
-* `use_disambig` BaseBot attribute was added to hande disambig skipping
+* `use_disambig` BaseBot attribute was added to handle disambig skipping
 * Deprecate RedirectPageBot and NoRedirectPageBot in favour of `use_redirects` 
attribute
 * tools.formatter.color_format is deprecated and will be removed
 * A new and easier color format was implemented; colors can be used like:
@@ -753,7 +754,7 @@

 * Add FilePage.file_is_used property to determine whether a file is used on a 
site
 * Add support for guwwiki and shnwikivoyage (:phab:`T303762`, :phab:`T302799`)
-* TextExtracts support was aded (:phab:`T72682`)
+* TextExtracts support was added (:phab:`T72682`)
 * Unused `get_redirect` parameter of Page.getOldVersion() has been dropped
 * Provide BasePage.get_parsed_page() as a public method
 * Provide BuiltinNamespace.canonical_namespaces() with BuiltinNamespace IntEnum
@@ -1019,7 +1020,7 @@
 **Improvements and Bugfixes**

 * Use different logfiles for multiple processes of the same script 
(:phab:`T56685`)
-* throttle.pip will be reused as soon as possbile
+* throttle.pip will be reused as soon as possibile
 * terminal_interface_base.TerminalHandler is subclassed from 
logging.StreamHandler
 * Fix iterating of SizedKeyCollection (:phab:`T282865`)
 * An abstract base user interface module was added
@@ -1223,7 +1224,7 @@
 * Property.getType() method has been removed
 * Family.server_time() method was removed; it is still available from Site 
object (:phab:`T89451`)
 * All HttpRequest parameters except of charset has been dropped 
(:phab:`T265206`)
-* A lot of methods and properties of HttpRequest are deprecated in favour of 
requests.Resonse attributes
+* A lot of methods and properties of HttpRequest are deprecated in favour of 
requests.Response attributes
   (:phab:`T265206`)
 * Method and properties of HttpRequest are delegated to requests.Response 
object (:phab:`T265206`)
 * comms.threadedhttp.HttpRequest.raw was replaced by HttpRequest.content 
property (:phab:`T265206`)
@@ -1310,12 +1311,12 @@
 * Accept only valid names in generate_family_file.py (:phab:`T265328`, 
:phab:`T265353`)
 * New plural.plural_rule() function returns a rule for a given language
 * Replace deprecated urllib.request.URLopener with http.fetch (:phab:`T255575`)
-* OptionHandler/BaseBot options are accessable as OptionHandler.opt attributes 
or keyword item
+* OptionHandler/BaseBot options are accessible as OptionHandler.opt attributes 
or keyword item
   (see also :phab:`T264721`)
 * pywikibot.setAction() function was removed
 * A namedtuple is the result of textlib.extract_sections()
 * Prevent circular imports in config2.py and http.py (:phab:`T264500`)
-* version.get_module_version() is deprecated and gives no meaningfull result
+* version.get_module_version() is deprecated and gives no meaningful result
 * Fix version.get_module_filename() and update log lines (:phab:`T264235`)
 * Re-enable printing log header (:phab:`T264235`)
 * Fix result of :func:`tools.itertools.intersect_generators` (:phab:`T263947`)
@@ -1492,7 +1493,7 @@
 * Raise ServerError also if connection to PetScan timeouts
 * pagegenerators.py no longer supports 'oursql' or 'MySQLdb'. It now solely 
supports PyMySQL
   (:phab:`T243154`, :phab:`T89976`)
-* Disfunctional Family.versionnumber() method was removed
+* Dysfunctional Family.versionnumber() method was removed
 * Refactor login functionality (:phab:`T137805`, :phab:`T224712`, 
:phab:`T248767`, :phab:`T248768`, :phab:`T248945`)
 * Bugfixes and improvements
 * Localisation updates
@@ -1506,7 +1507,7 @@
 * Refactor data attributes of Wikibase entities (:phab:`T233406`)
 * Functions dealing with stars list are desupported and may be removed
 * Use path's stem of script filename within pwb.py wrapper (:phab:`T248372`)
-* Disfunctional cgi_interface.py was removed (:phab:`T248292`, 
:phab:`T248250`, :phab:`T193978`)
+* Dysfunctional cgi_interface.py was removed (:phab:`T248292`, 
:phab:`T248250`, :phab:`T193978`)
 * Fix logout on MW < 1.24 (:phab:`T214009`)
 * Fixed TypeError in getFileVersionHistoryTable method (:phab:`T248266`)
 * Outdated secure connection overrides were removed (:phab:`T247668`)
@@ -1919,7 +1920,7 @@
 * Clean up issue with _WbDataPage (:phab:`T166362`)
 * Re-enable xml for WikiStats with py2 (:phab:`T165830`)
 * Solve httplib.IncompleteRead exception in eventstreams (:phab:`T168535`)
-* Only force input_choise if self.always is given (:phab:`T161483`)
+* Only force input_choice if self.always is given (:phab:`T161483`)
 * Add colon when replacing category and file weblink (:phab:`T127745`)
 * API Request: set uiprop only when ensuring 'userinfo' in meta 
(:phab:`T169202`)

@@ -1937,7 +1938,7 @@
 * Implement pywikibot support for adding thanks to normal revisions 
(:phab:`T135409`)
 * Implement server side event client EventStreams (:phab:`T158943`)
 * new pagegenerators filter option -titleregexnot
-* Add exception for -namepace option (:phab:`T167580`)
+* Add exception for -namespace option (:phab:`T167580`)
 * InteractiveReplace: Allow no replacements by default
 * Encode default globe in family file
 * Add on to pywikibot support for thanking normal revisions (:phab:`T135409`)
diff --git a/ROADMAP.rst b/ROADMAP.rst
index a2b2b64..43db81d 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -1,7 +1,10 @@
 Current Release Changes
 =======================

-* (no changes yet)
+* Add support for tigwiki (:phab:`T381381`)
+* Fix use of importlib.metadata.entry_points for pywikibot-scripts with Python 
3.8 and 3.9 (:phab:`T358635`)
+* i18n updates.
+

 Current Deprecations
 ====================
@@ -10,7 +13,6 @@
   :attr:`BaseSite.codes<pywikibot.site._basesite.BaseSite.codes>`
 * 9.5.0: 
:meth:`DataSite.getPropertyType()<pywikibot.site._datasite.DataSite.getPropertyType>`
 will be removed
   in favour of 
:meth:`DataSite.get_property_type()<pywikibot.site._datasite.DataSite.get_property_type>`
-* 9.4.0: :mod:`flow` support is deprecated and will be removed 
(:phab:`T371180`)
 * 9.3.0: :meth:`page.BasePage.userName` and :meth:`page.BasePage.isIpEdit` are 
deprecated in favour of
   ``user`` or ``anon`` attributes of :attr:`page.BasePage.latest_revision` 
property
 * 9.2.0: Imports of :mod:`logging` functions from :mod:`bot` module is 
deprecated and will be desupported
@@ -34,7 +36,7 @@
 * 9.0.0: ``iteritems`` method of :class:`data.api.Request` will be removed in 
favour of ``items``
 * 9.0.0: ``SequenceOutputter.output()`` is deprecated in favour of 
:attr:`tools.formatter.SequenceOutputter.out`
   property
-* 9.0.0: *nullcontext* context manager and *SimpleQueue* queue of 
:mod:`backports` are derecated
+* 9.0.0: *nullcontext* context manager and *SimpleQueue* queue of 
:mod:`backports` are deprecated
 * 8.4.0: *modules_only_mode* parameter of :class:`data.api.ParamInfo`, its 
*paraminfo_keys* class attribute
   and its preloaded_modules property will be removed
 * 8.4.0: *dropdelay* and *releasepid* attributes of :class:`throttle.Throttle` 
will be removed
@@ -66,6 +68,7 @@
 -------------------------------

 * 9.6.0: Python 3.7 support is deprecated and will be dropped with Pywikibot 10
+* 9.4.0: :mod:`flow` support is deprecated and will be removed 
(:phab:`T371180`)
 * 9.1.0: :func:`version.svn_rev_info` and :func:`version.getversion_svn` will 
be removed. SVN is no longer supported.
   (:phab:`T362484`)
 * 7.7.0: :mod:`tools.threading` classes should no longer imported from 
:mod:`tools`
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index 2375309..6819a7f 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -59,7 +59,7 @@
 )
 from pywikibot.site import BaseSite as _BaseSite
 from pywikibot.time import Timestamp
-from pywikibot.tools import normalize_username
+from pywikibot.tools import PYTHON_VERSION, normalize_username


 if TYPE_CHECKING:
@@ -87,6 +87,15 @@

 _sites: dict[str, APISite] = {}

+if PYTHON_VERSION < (3, 8):
+    __version = sys.version.split(maxsplit=1)[0]
+    warn(f"""
+
+    Python {__version} will be dropped soon with Pywikibot 10.
+    It is recommended to use Python 3.8 or above.
+    See phab: T379227 for further information.
+""", FutureWarning)  # adjust this line no in utils.execute()
+

 @cache
 def _code_fam_from_url(url: str, name: str | None = None
diff --git a/pywikibot/families/wikipedia_family.py 
b/pywikibot/families/wikipedia_family.py
index b725da4..3a03d0b 100644
--- a/pywikibot/families/wikipedia_family.py
+++ b/pywikibot/families/wikipedia_family.py
@@ -56,11 +56,11 @@
         'sc', 'scn', 'sco', 'sd', 'se', 'sg', 'sh', 'shi', 'shn', 'si',
         'simple', 'sk', 'skr', 'sl', 'sm', 'smn', 'sn', 'so', 'sq', 'sr',
         'srn', 'ss', 'st', 'stq', 'su', 'sv', 'sw', 'szl', 'szy', 'ta', 'tay',
-        'tcy', 'tdd', 'te', 'tet', 'tg', 'th', 'ti', 'tk', 'tl', 'tly', 'tn',
-        'to', 'tpi', 'tr', 'trv', 'ts', 'tt', 'tum', 'tw', 'ty', 'tyv', 'udm',
-        'ug', 'uk', 'ur', 'uz', 've', 'vec', 'vep', 'vi', 'vls', 'vo', 'wa',
-        'war', 'wo', 'wuu', 'xal', 'xh', 'xmf', 'yi', 'yo', 'za', 'zea', 'zgh',
-        'zh', 'zh-classical', 'zh-min-nan', 'zh-yue', 'zu',
+        'tcy', 'tdd', 'te', 'tet', 'tg', 'th', 'ti', 'tig', 'tk', 'tl', 'tly',
+        'tn', 'to', 'tpi', 'tr', 'trv', 'ts', 'tt', 'tum', 'tw', 'ty', 'tyv',
+        'udm', 'ug', 'uk', 'ur', 'uz', 've', 'vec', 'vep', 'vi', 'vls', 'vo',
+        'wa', 'war', 'wo', 'wuu', 'xal', 'xh', 'xmf', 'yi', 'yo', 'za', 'zea',
+        'zgh', 'zh', 'zh-classical', 'zh-min-nan', 'zh-yue', 'zu',
     }

     # Sites we want to edit but not count as real languages
diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py
index 0c683af..542f129 100644
--- a/pywikibot/i18n.py
+++ b/pywikibot/i18n.py
@@ -909,7 +909,7 @@
     >>> i18n.known_languages()[-10:]
     ['vo', 'vro', 'wa', 'war', 'xal', 'xmf', 'yi', 'yo', 'yue', 'zh']
     >>> len(i18n.known_languages())
-    255
+    254

     The implementation is roughly equivalent to:

diff --git a/pywikibot/scripts/wrapper.py b/pywikibot/scripts/wrapper.py
index 3a16b28..d3eddb2 100755
--- a/pywikibot/scripts/wrapper.py
+++ b/pywikibot/scripts/wrapper.py
@@ -250,7 +250,7 @@
         if dependency.startswith(('importlib_metadata', 'packaging')):
             # Ignore these dependencies because ImportError is raised in an
             # early state when they are imported in backports. They are already
-            # used at this point. This is a workaound for toolforge where some
+            # used at this point. This is a workaround for toolforge where some
             # modules are not installed as a site-package.
             # TODO: Check imports from external source
             continue
@@ -422,7 +422,18 @@

         from pywikibot.i18n import set_messages_package

-        for ep in entry_points(name='scriptspath', group='pywikibot'):
+        if sys.version_info < (3, 10):
+            entry_points_items = [
+                ep for ep in entry_points().get('pywikibot', [])
+                if ep.name == 'scriptspath'
+            ]
+        else:
+            entry_points_items = entry_points(
+                name='scriptspath',
+                group='pywikibot',
+            )
+
+        for ep in entry_points_items:
             path = ep.load()
             found = test_paths([''], path)
             if found:
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py
index 81c3a85..3802d23 100644
--- a/pywikibot/site/_apisite.py
+++ b/pywikibot/site/_apisite.py
@@ -1246,6 +1246,14 @@
             pywikibot.error(msg)
             raise

+        if MediaWikiVersion(version) < '1.31':
+            warn('\n'
+                 + fill(f'Support of MediaWiki {version} will be dropped. '
+                        'It is recommended to use MediaWiki 1.31 or above. '
+                        'You may use every Pywikibot 9.X for older MediaWiki '
+                        'versions. See T378984 for further information.'),
+                 FutureWarning)
+
         if MediaWikiVersion(version) < '1.27':
             raise RuntimeError(f'Pywikibot "{pywikibot.__version__}" does not '
                                f'support MediaWiki "{version}".\n'
diff --git a/scripts/CHANGELOG.rst b/scripts/CHANGELOG.rst
index e39cd84..ec7bba6 100644
--- a/scripts/CHANGELOG.rst
+++ b/scripts/CHANGELOG.rst
@@ -1,6 +1,11 @@
 Scripts Changelog
 =================

+9.6.1
+-----
+
+* Require Pywikibot 9.6.1 (:phab:`T358635`)
+
 9.6.0
 -----

@@ -55,7 +60,7 @@
 * Use :pylib:`difflib.get_close_matches()<difflib#difflib.get_close_matches>`
   to find the closest image match
 * Add ``-category`` option to work from given category and look for the
-  lastest file deletion first(:phab:`T372206`)
+  latest file deletion first (:phab:`T372206`)
 * Check whether image exists first (:phab:`T372106`)

 unlink
@@ -526,7 +531,7 @@
 checkimages
 ^^^^^^^^^^^

-*  Use page_from_repository() method to read categoried from wikibase
+*  Use page_from_repository() method to read categorized from wikibase
 *  Use ``itertools.zip_longest`` to find the most important image

 dataextend
@@ -610,7 +615,7 @@
 blockpageschecker
 ^^^^^^^^^^^^^^^^^

-*  Use different edit comments when adding, changeing or removing
+*  Use different edit comments when adding, changing or removing
    templates (:phab:`T291345`)
 *  Derive CheckerBot from ConfigParserBot (:phab:`T57106`)
 *  Derive CheckerBot from CurrentPageBot (:phab:`T196851`,
@@ -790,7 +795,7 @@
 template
 ^^^^^^^^

-*  Do not try to initialze generator twice in TemplateRobot
+*  Do not try to initialize generator twice in TemplateRobot
    (:phab:`T284534`)

 update_script
@@ -801,7 +806,7 @@
 version
 ^^^^^^^

-*  Show all mandatory dependecies
+*  Show all mandatory dependencies

 6.3.0
 -----
@@ -902,7 +907,7 @@

 *  Catch urllib3.LocationParseError and skip link (:phab:`T280356`)
 *  L10N updates
-*  Avoid dupliate reference names (:phab:`T278040`)
+*  Avoid duplicate reference names (:phab:`T278040`)

 solve_disambiguation
 ^^^^^^^^^^^^^^^^^^^^
@@ -959,7 +964,7 @@
 maintenance
 ^^^^^^^^^^^

-*  Add a preload_sites.py script to preload site informations
+*  Add a preload_sites.py script to preload site information
    (:phab:`T226157`)

 reflinks
diff --git a/scripts/pyproject.toml b/scripts/pyproject.toml
index 51c254d..d088b79 100644
--- a/scripts/pyproject.toml
+++ b/scripts/pyproject.toml
@@ -7,7 +7,7 @@

 [project]
 name = "pywikibot-scripts"
-version = "9.6.0"
+version = "9.6.1"

 authors = [
     {name = "xqt", email = "i...@gno.de"},
@@ -19,7 +19,7 @@
 readme = "scripts/README.rst"
 requires-python = ">=3.7.0"
 dependencies = [
-    "pywikibot >= 9.4.0",
+    "pywikibot >= 9.6.1",
     "isbnlib",
     "langdetect",
     "mwparserfromhell",
diff --git a/tests/utils.py b/tests/utils.py
index c80e331..89b92bb 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -23,6 +23,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

@@ -473,6 +474,9 @@
 
     :param command: executable to run and arguments to use
     """
+    if PYTHON_VERSION < (3, 8):
+        command.insert(1, '-W ignore::FutureWarning:pywikibot:97')
+
     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/+/1103280?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: stable
Gerrit-Change-Id: I8a4279463952a5616c33c7459fc7f660d3cd1038
Gerrit-Change-Number: 1103280
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <i...@gno.de>
Gerrit-Reviewer: Xqt <i...@gno.de>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- pywikibot-commits@lists.wikimedia.org
To unsubscribe send an email to pywikibot-commits-le...@lists.wikimedia.org

Reply via email to