jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/680638 )
Change subject: [cleanup] Remove already deprecated parameters ......................................................................
[cleanup] Remove already deprecated parameters
Change-Id: Iea8eef0a2fa60b3381bd6307f59dd5d7b89ecc5e --- M pywikibot/comms/http.py M pywikibot/site/_apisite.py M pywikibot/site/_decorators.py M pywikibot/site/_namespace.py M tests/replacebot_tests.py 5 files changed, 7 insertions(+), 28 deletions(-)
Approvals: JJMC89: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py index ecb9f90..51cd54a 100644 --- a/pywikibot/comms/http.py +++ b/pywikibot/comms/http.py @@ -311,7 +311,7 @@ warning('Http response status {}'.format(response.status_code))
-@deprecated_args(callback=True, body='data') +@deprecated_args(body='data') def fetch(uri: str, method: str = 'GET', headers: Optional[dict] = None, default_error_handling: bool = True, use_fake_user_agent: Union[bool, str] = False, **kwargs): diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py index 9619c38..ffbdeff 100644 --- a/pywikibot/site/_apisite.py +++ b/pywikibot/site/_apisite.py @@ -312,10 +312,7 @@ auth_token = get_authentication(self.base_url('')) return auth_token is not None and len(auth_token) == 4
- @deprecated_args(sysop=True) - def login(self, sysop=None, - autocreate: bool = False, - user: Optional[str] = None): + def login(self, autocreate: bool = False, user: Optional[str] = None): """ Log the user in if not already logged in.
@@ -328,11 +325,6 @@ by the site. @see: U{https://www.mediawiki.org/wiki/API:Login%7D """ - if sysop is not None: - issue_deprecation_warning("'sysop' parameter", - warning_class=FutureWarning, - since='20201230') - # TODO: this should include an assert that loginstatus # is not already IN_PROGRESS, however the # login status may be left 'IN_PROGRESS' because diff --git a/pywikibot/site/_decorators.py b/pywikibot/site/_decorators.py index 9913b13..f305fc0 100644 --- a/pywikibot/site/_decorators.py +++ b/pywikibot/site/_decorators.py @@ -1,14 +1,13 @@ """Decorators used by site models.""" # -# (C) Pywikibot team, 2008-2020 +# (C) Pywikibot team, 2008-2021 # # Distributed under the terms of the MIT license. # from pywikibot.exceptions import UnknownExtension, UserRightsError -from pywikibot.tools import deprecated_args, manage_wrapping, MediaWikiVersion +from pywikibot.tools import manage_wrapping, MediaWikiVersion
-@deprecated_args(right=True) def must_be(group=None): """Decorator to require a certain user status when method is called.
diff --git a/pywikibot/site/_namespace.py b/pywikibot/site/_namespace.py index 70be918..8edcf5f 100644 --- a/pywikibot/site/_namespace.py +++ b/pywikibot/site/_namespace.py @@ -9,12 +9,7 @@ from typing import Optional, Union
from pywikibot.backports import List -from pywikibot.tools import ( - ComparableMixin, - deprecated_args, - issue_deprecation_warning, - SelfCallMixin, -) +from pywikibot.tools import ComparableMixin, SelfCallMixin
class BuiltinNamespace(IntEnum): @@ -85,7 +80,6 @@ 15: 'Category talk', }
- @deprecated_args(use_image_name=True) def __init__(self, id, canonical_name: Optional[str] = None, custom_name: Optional[str] = None, @@ -266,14 +260,8 @@ return default_case
@classmethod - @deprecated_args(use_image_name=True) - def builtin_namespaces(cls, use_image_name=None, case='first-letter'): + def builtin_namespaces(cls, case='first-letter'): """Return a dict of the builtin namespaces.""" - if use_image_name is not None: - issue_deprecation_warning( - 'positional argument of "use_image_name"', None, 3, - FutureWarning, since='20181015') - return {i: cls(i, case=cls.default_case(i, case)) for i in range(-2, 16)}
diff --git a/tests/replacebot_tests.py b/tests/replacebot_tests.py index 97fdb40..85688a6 100644 --- a/tests/replacebot_tests.py +++ b/tests/replacebot_tests.py @@ -56,7 +56,7 @@ """Nothing to do here.""" inner_self.changed_pages = -47 # show that run was called
- def patched_login(sysop=False): + def patched_login(): """Do nothing.""" pass