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

Change subject: cleabup: Remove deprecated code parts and update ROADMAP.rst
......................................................................

cleabup: Remove deprecated code parts and update ROADMAP.rst

Change-Id: I4d45620d23b45e46f8476658c7ab86eb84540681
---
M ROADMAP.rst
M pywikibot/_wbtypes.py
M pywikibot/data/api/__init__.py
M pywikibot/data/api/_paraminfo.py
M pywikibot/exceptions.py
M pywikibot/family.py
M pywikibot/login.py
7 files changed, 16 insertions(+), 78 deletions(-)

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




diff --git a/ROADMAP.rst b/ROADMAP.rst
index bae4daf..cc9e2e9 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -12,6 +12,20 @@

 **Code cleanups**

+* The ``get_login_token()`` method of :class:`login.ClientLoginManager`
+  was removed and can be replaces by 
``login.LoginManager.site.tokens['login']``
+* The :meth:`family.Family.maximum_GET_length` method was removed in favour of 
the
+  :ref:`config.maximum_GET_length<Account Settings>` configuration option 
(:phab:`T325957`)
+* The ``exceptions.Server414Error`` exception was replaced by
+  :exc:`exceptions.Client414Error` exception
+* The *modules_only_mode* parameter in the :class:`data.api.ParamInfo` class, 
its
+  *paraminfo_keys* class attribute, and its ``preloaded_modules`` property was 
removed
+* The ``data.api.LoginManager()`` constructor was removed in favour of the
+  :class:`login.ClientLoginManager` class
+* The `normalize` parameter was removed from the
+  :meth:`pywikibot.WbTime.toTimestr` and :meth:`pywikibot.WbTime.toWikibase`
+  methods in Pywikibot 8.2. Since Pywikibot 11, passing `normalize` as an 
argument
+  raises an error, because support for legacy arguments via was removed.
 * Several typing types were removed from :mod:`backports`.
 * The ``cache`` decorator was removed from :mod:`backports`. The 
:pylib:`@functools.cache()
   <functools#functools.cache>` can be used instead. (:phab:`T401802`)
@@ -44,25 +58,16 @@
 * 10.7.0: Dysfunctional :meth:`APISite.alllinks()
   <pywikibot.site._generators.GeneratorsMixin.alllinks>` will be removed.
   (:phab:`T359427`, :phab:`T407708`)
-* 10.6.0: Python 3.8 support is deprecated and will be dropped soon
 * 8.4.0: :attr:`data.api.QueryGenerator.continuekey` will be removed in favour 
of
   :attr:`data.api.QueryGenerator.modules`
-* 8.4.0: The *modules_only_mode* parameter in the :class:`data.api.ParamInfo` 
class, its
-  *paraminfo_keys* class attribute, and its ``preloaded_modules`` property 
will be removed
 * 8.4.0: The *dropdelay* and *releasepid* attributes of the 
:class:`throttle.Throttle` class will be
   removed in favour of the *expiry* class attribute
 * 8.2.0: The :func:`tools.itertools.itergroup` function will be removed in 
favour of the
   :func:`backports.batched` function
-* 8.2.0: The *normalize* parameter in the :meth:`pywikibot.WbTime.toTimestr` 
and
-  :meth:`pywikibot.WbTime.toWikibase` methods will be removed
 * 8.1.0: The inheritance of the :exc:`exceptions.NoSiteLinkError` exception 
from
   :exc:`exceptions.NoPageError` will be removed
-* 8.1.0: The ``exceptions.Server414Error`` exception is deprecated in favour 
of the
-  :exc:`exceptions.Client414Error` exception
 * 8.0.0: The :meth:`Timestamp.clone()<pywikibot.time.Timestamp.clone>` method 
is deprecated in
   favour of the ``Timestamp.replace()`` method
-* 8.0.0: The :meth:`family.Family.maximum_GET_length` method is deprecated in 
favour of the
-  :ref:`config.maximum_GET_length<Account Settings>` configuration option 
(:phab:`T325957`)
 * 8.0.0: The ``addOnly`` parameter in the :func:`textlib.replaceLanguageLinks` 
and
   :func:`textlib.replaceCategoryLinks` functions is deprecated in favour of 
``add_only``
 * 8.0.0: The regex attributes ``ptimeR``, ``ptimeznR``, ``pyearR``, 
``pmonthR``, and ``pdayR`` of
@@ -70,10 +75,6 @@
   which is a :class:`textlib.TimeStripperPatterns` object
 * 8.0.0: The ``groups`` attribute of the :class:`textlib.TimeStripper` class 
is deprecated in favour
   of the :data:`textlib.TIMEGROUPS` constant
-* 8.0.0: The 
:meth:`LoginManager.get_login_token<login.ClientLoginManager.get_login_token>` 
method
-  has been replaced by ``login.ClientLoginManager.site.tokens['login']``
-* 8.0.0: The ``data.api.LoginManager()`` constructor is deprecated in favour 
of the
-  :class:`login.ClientLoginManager` class
 * 8.0.0: The 
:meth:`APISite.messages()<pywikibot.site._apisite.APISite.messages>` method is
   deprecated in favour of the 
:attr:`userinfo['messages']<pywikibot.site._apisite.APISite.userinfo>`
   attribute
diff --git a/pywikibot/_wbtypes.py b/pywikibot/_wbtypes.py
index 5e863e1..6b6a189 100644
--- a/pywikibot/_wbtypes.py
+++ b/pywikibot/_wbtypes.py
@@ -19,11 +19,7 @@
 import pywikibot
 from pywikibot import exceptions
 from pywikibot.time import Timestamp
-from pywikibot.tools import (
-    deprecated_signature,
-    issue_deprecation_warning,
-    remove_last_args,
-)
+from pywikibot.tools import deprecated_signature, issue_deprecation_warning

 
 if TYPE_CHECKING:
@@ -877,7 +873,6 @@

         return type(self)(**kwargs)

-    @remove_last_args(['normalize'])  # since 8.2.0
     def toTimestr(self, force_iso: bool = False) -> str:
         """Convert the data to a UTC date/time string.

@@ -920,7 +915,6 @@
                 datetime.timedelta(minutes=self.timezone)))
         return ts

-    @remove_last_args(['normalize'])  # since 8.2.0
     def toWikibase(self) -> dict[str, Any]:
         """Convert the data to a JSON object for the Wikibase API.

diff --git a/pywikibot/data/api/__init__.py b/pywikibot/data/api/__init__.py
index c5af36c..bce3a72 100644
--- a/pywikibot/data/api/__init__.py
+++ b/pywikibot/data/api/__init__.py
@@ -25,7 +25,6 @@
 from pywikibot.data.api._paraminfo import ParamInfo
 from pywikibot.data.api._requests import CachedRequest, Request, encode_url
 from pywikibot.family import SubdomainFamily
-from pywikibot.tools import ModuleDeprecationWrapper


 __all__ = (
@@ -93,9 +92,3 @@


 MIMEMultipart = CTEBinaryMIMEMultipart
-
-wrapper = ModuleDeprecationWrapper(__name__)
-wrapper.add_deprecated_attr(
-    'LoginManager',
-    replacement_name='pywikibot.login.ClientLoginManager',
-    since='8.0.0')
diff --git a/pywikibot/data/api/_paraminfo.py b/pywikibot/data/api/_paraminfo.py
index ece8df3..a455b25 100644
--- a/pywikibot/data/api/_paraminfo.py
+++ b/pywikibot/data/api/_paraminfo.py
@@ -12,12 +12,7 @@
 import pywikibot
 from pywikibot import config
 from pywikibot.backports import batched
-from pywikibot.tools import (
-    classproperty,
-    deprecated,
-    deprecated_args,
-    remove_last_args,
-)
+from pywikibot.tools import deprecated_args


 __all__ = ['ParamInfo']
@@ -39,7 +34,6 @@
     _action_modules: frozenset[str]
     _modules: dict[str, set[str] | dict[str, str]]

-    @remove_last_args(['modules_only_mode'])
     def __init__(self,
                  site,
                  preloaded_modules: set[str] | None = None) -> None:
@@ -444,21 +438,3 @@

         return {mod: self[mod][attribute]
                 for mod in modules if attribute in self[mod]}
-
-    @classproperty
-    @deprecated(since='8.4.0')
-    def paraminfo_keys(cls) -> frozenset[str]:
-        """Return module types.
-
-        .. deprecated:: 8.4
-        """
-        return frozenset(['modules'])
-
-    @property
-    @deprecated(since='8.4.0')
-    def preloaded_modules(self) -> frozenset[str] | set[str]:
-        """Return set of preloaded modules.
-
-        .. deprecated:: 8.4
-        """
-        return self._preloaded_modules
diff --git a/pywikibot/exceptions.py b/pywikibot/exceptions.py
index d1a095a..fafa883 100644
--- a/pywikibot/exceptions.py
+++ b/pywikibot/exceptions.py
@@ -182,7 +182,6 @@
 from typing import Any

 import pywikibot
-from pywikibot.tools import ModuleDeprecationWrapper
 from pywikibot.tools._deprecate import _NotImplementedWarning


@@ -731,8 +730,3 @@
 class ApiNotAvailableError(Error):

     """API is not available, e.g. due to a network error or configuration."""
-
-
-wrapper = ModuleDeprecationWrapper(__name__)
-wrapper.add_deprecated_attr(
-    'Server414Error', Client414Error, since='8.1.0')
diff --git a/pywikibot/family.py b/pywikibot/family.py
index 1c42168..828e28a 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -652,15 +652,6 @@
             'Found multiple matches for URL "{}": {}'
             .format(url, ', '.join(str(s) for s in matched_sites)))

-    @deprecated('config.maximum_GET_length', since='8.0.0')
-    def maximum_GET_length(self, code):
-        """Return the maximum URL length for GET instead of POST.
-
-        .. deprecated:: 8.0
-           Use :ref:`config.maximum_GET_length<Account Settings>` instead.
-        """
-        return config.maximum_GET_length
-
     def dbName(self, code) -> str:
         """Return the name of the MySQL database."""
         return f'{code}{self.name}'
diff --git a/pywikibot/login.py b/pywikibot/login.py
index 94650e9..de72c08 100644
--- a/pywikibot/login.py
+++ b/pywikibot/login.py
@@ -22,7 +22,6 @@
 from pywikibot.exceptions import APIError, NoUsernameError
 from pywikibot.tools import (
     PYTHON_VERSION,
-    deprecated,
     file_mode_checker,
     normalize_username,
 )
@@ -517,16 +516,6 @@

         raise pywikibot.exceptions.APIError(code=status, info=fail_reason)

-    @deprecated("site.tokens['login']", since='8.0.0')
-    def get_login_token(self) -> str | None:
-        """Fetch login token.
-
-        .. deprecated:: 8.0
-
-        :return: login token
-        """
-        return self.site.tokens['login']
-

 class BotPassword:


--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1200630?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: I4d45620d23b45e46f8476658c7ab86eb84540681
Gerrit-Change-Number: 1200630
Gerrit-PatchSet: 1
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]

Reply via email to