jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697874 )
Change subject: [IMPR] Only use FutureWarnings ......................................................................
[IMPR] Only use FutureWarnings
DeprecationWarnings are unhelpful since effectively no one sees them. This makes future_warning the default.
Bug: T281202 Change-Id: Ia92c9414cc6d543d932977d2b1586e4da9d22a28 --- M ROADMAP.rst M pywikibot/__init__.py M pywikibot/bot.py M pywikibot/bot_choice.py M pywikibot/comms/http.py M pywikibot/config.py M pywikibot/cosmetic_changes.py M pywikibot/data/api.py M pywikibot/date.py M pywikibot/echo.py M pywikibot/exceptions.py M pywikibot/families/wowwiki_family.py M pywikibot/family.py M pywikibot/i18n.py M pywikibot/interwiki_graph.py M pywikibot/login.py M pywikibot/page/__init__.py M pywikibot/pagegenerators.py M pywikibot/site/__init__.py M pywikibot/site/_apisite.py M pywikibot/site/_basesite.py M pywikibot/site/_datasite.py M pywikibot/site/_generators.py M pywikibot/specialbots/__init__.py M pywikibot/specialbots/_unlink.py M pywikibot/textlib.py M pywikibot/throttle.py M pywikibot/tools/__init__.py M pywikibot/tools/formatter.py M pywikibot/version.py M scripts/solve_disambiguation.py 31 files changed, 90 insertions(+), 113 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/ROADMAP.rst b/ROADMAP.rst index f489cd6..9f0b216 100644 --- a/ROADMAP.rst +++ b/ROADMAP.rst @@ -10,6 +10,9 @@ Deprecations ^^^^^^^^^^^^
+* 6.4.0: Pywikibot `began using semantic versioning + https://www.mediawiki.org/wiki/Manual:Pywikibot/Development/Guidelines#Deprecation_Policy`_, + all deprecated code will be removed in Pywikibot version 7.0.0. * 6.2.0: Bot's availableOptions will be removed in favour of available_options * 6.2.0: deprecated tools.is_IP will be removed * 6.2.0: Usage of pywikibot.config2 is deprecated and will be dropped diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py index 7fd8856..247b2b7 100644 --- a/pywikibot/__init__.py +++ b/pywikibot/__init__.py @@ -1354,15 +1354,15 @@
wrapper = _ModuleDeprecationWrapper(__name__) wrapper.add_deprecated_attr('config2', replacement_name='pywikibot.config', - since='20210426', future_warning=True) + since='20210426') wrapper.add_deprecated_attr('__release__', __version__, replacement_name='pywikibot.__version__', since='20200707') wrapper.add_deprecated_attr('showHelp', show_help, - since='20200705', future_warning=True) + since='20200705') wrapper.add_deprecated_attr( 'unicode2html', replacement_name='pywikibot.tools.chars.string2html', - since='6.2.0', future_warning=True) + since='6.2.0')
# This module aliases many (but not all) pywikibot.exception classes and one # from pywikibot.data.api. Use of these aliases is deprecated. When removed @@ -1387,5 +1387,5 @@ wrapper.add_deprecated_attr( name, replacement_name='pywikibot.exceptions.{}'.format(replacement), - since='20210424', future_warning=True + since='20210424' ) diff --git a/pywikibot/bot.py b/pywikibot/bot.py index ed6648f..543ef15 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -1117,12 +1117,12 @@ self.set_options(**kwargs)
@property - @deprecated('available_options', since='20201006', future_warning=True) + @deprecated('available_options', since='20201006') def availableOptions(self): """DEPRECATED. Available_options class property.""" return self.available_options
- @deprecated('set_options', since='20201006', future_warning=True) + @deprecated('set_options', since='20201006') def setOptions(self, **kwargs): # pragma: no cover """DEPRECATED. Set the instance options.""" self.set_options(**kwargs) @@ -1136,7 +1136,7 @@ if old_options: # old options were set and not updated self.available_options = self.availableOptions issue_deprecation_warning(warning, 'available_options', - since='20201006', future_warning=True) + since='20201006')
valid_options = set(self.available_options) received_options = set(options) @@ -1150,7 +1150,7 @@ pywikibot.warning('{} is not a valid option. It was ignored.' .format(opt))
- @deprecated(_DEPRECATION_MSG, since='20201006', future_warning=True) + @deprecated(_DEPRECATION_MSG, since='20201006') def getOption(self, option): # pragma: no cover """DEPRECATED. Get the current value of an option.
diff --git a/pywikibot/bot_choice.py b/pywikibot/bot_choice.py index 22d9552..af6a87a 100755 --- a/pywikibot/bot_choice.py +++ b/pywikibot/bot_choice.py @@ -252,8 +252,7 @@ return self.text[start:end]
@deprecated_args(start_context='start', end_context='end') - @deprecated('pywikibot.output(ContextOption.out)', since='6.2.0', - future_warning=True) + @deprecated('pywikibot.output(ContextOption.out)', since='6.2.0') def output_range(self, start, end): """DEPRECATED. Output a section from the text.""" pywikibot.output(self.text[start:end]) @@ -562,7 +561,7 @@ self.text[self.end:end])
@deprecated('pywikibot.output(HighlightContextOption.out)', - since='6.2.0', future_warning=True) + since='6.2.0') def output_range(self, start, end): """DEPRECATED. Show normal context with a highlighted center region.""" color_format = pywikibot.tools.formatter.color_format diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py index f42901b..d0ddea1 100644 --- a/pywikibot/comms/http.py +++ b/pywikibot/comms/http.py @@ -196,8 +196,7 @@ return formatted
-@deprecated('pywikibot.comms.http.fake_user_agent', since='20161205', - future_warning=True) +@deprecated('pywikibot.comms.http.fake_user_agent', since='20161205') def get_fake_user_agent(): """ Return a fake user agent depending on `fake_user_agent` option in config. diff --git a/pywikibot/config.py b/pywikibot/config.py index 09729af..d263da0 100644 --- a/pywikibot/config.py +++ b/pywikibot/config.py @@ -72,8 +72,7 @@ if new_env_name not in environ: environ[new_env_name] = env_value issue_deprecation_warning( - env_name + ' environment variable', new_env_name, 0, since='20180803', - future_warning=True) + env_name + ' environment variable', new_env_name, 0, since='20180803')
# This frozen set should contain all imported modules/variables, so it must diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py index 978590e..ab70b7d 100755 --- a/pywikibot/cosmetic_changes.py +++ b/pywikibot/cosmetic_changes.py @@ -307,7 +307,7 @@
@classmethod @deprecated('CosmeticChangesToolkit with pywikibot.Page object', - future_warning=True, since='20200415') + since='20200415') @deprecated_args(diff='show_diff') def from_page(cls, page, show_diff=False, ignore=CANCEL.ALL): """Create toolkit based on the page.""" @@ -1119,13 +1119,13 @@ wrapper = ModuleDeprecationWrapper(__name__) wrapper.add_deprecated_attr('CANCEL_ALL', _CANCEL_ALL, replacement_name='CANCEL.ALL', - since='20210528', future_warning=True) + since='20210528') wrapper.add_deprecated_attr('CANCEL_PAGE', _CANCEL_PAGE, replacement_name='CANCEL.PAGE', - since='20210528', future_warning=True) + since='20210528') wrapper.add_deprecated_attr('CANCEL_METHOD', _CANCEL_METHOD, replacement_name='CANCEL.METHOD', - since='20210528', future_warning=True) + since='20210528') wrapper.add_deprecated_attr('CANCEL_MATCH', _CANCEL_MATCH, replacement_name='CANCEL.MATCH', - since='20210528', future_warning=True) + since='20210528') diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index 3b05841..2b8ebee 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -3177,10 +3177,10 @@ wrapper = ModuleDeprecationWrapper(__name__) wrapper.add_deprecated_attr( 'APIError', replacement_name='pywikibot.exceptions.APIError', - since='20210423', future_warning=True) + since='20210423') wrapper.add_deprecated_attr( 'UploadWarning', replacement_name='pywikibot.exceptions.UploadError', - since='20210423', future_warning=True) + since='20210423') wrapper.add_deprecated_attr( 'APIMWException', replacement_name='pywikibot.exceptions.APIMWError', - since='20210423', future_warning=True) + since='20210423') diff --git a/pywikibot/date.py b/pywikibot/date.py index b5a6cfd..5abb2d4 100644 --- a/pywikibot/date.py +++ b/pywikibot/date.py @@ -1935,7 +1935,7 @@ return None, None
-@deprecated('date.format_date', since='20190526', future_warning=True) +@deprecated('date.format_date', since='20190526') class FormatDate:
"""DEPRECATED. Format a date.""" diff --git a/pywikibot/echo.py b/pywikibot/echo.py index 8ed2c72..3b66d15 100644 --- a/pywikibot/echo.py +++ b/pywikibot/echo.py @@ -51,7 +51,7 @@ return notif
@property - @deprecated('event_id', since='20190106', future_warning=True) + @deprecated('event_id', since='20190106') def id(self): """ DEPRECATED: Return notification id as unicode. diff --git a/pywikibot/exceptions.py b/pywikibot/exceptions.py index 0c9a446..adf7f5a 100644 --- a/pywikibot/exceptions.py +++ b/pywikibot/exceptions.py @@ -718,4 +718,4 @@ for old_name, new_name in DEPRECATED_EXCEPTIONS.items(): setattr(module, old_name, getattr(module, new_name)) wrapper.add_deprecated_attr(old_name, replacement_name=new_name, - since='20210423', future_warning=True) + since='20210423') diff --git a/pywikibot/families/wowwiki_family.py b/pywikibot/families/wowwiki_family.py index 029513d..6e98ce4 100644 --- a/pywikibot/families/wowwiki_family.py +++ b/pywikibot/families/wowwiki_family.py @@ -26,7 +26,7 @@ code_aliases = {'nn': 'no'}
@classproperty - @deprecated('codes attribute', since='20190422', future_warning=True) + @deprecated('codes attribute', since='20190422') def languages_by_size(cls): """DEPRECATED. languages_by_size property for compatibility purpose.""" return list(cls.codes) diff --git a/pywikibot/family.py b/pywikibot/family.py index 2b7bb17..6196f28 100644 --- a/pywikibot/family.py +++ b/pywikibot/family.py @@ -650,8 +650,7 @@ cr_set.add(newtitle) self._catredirtemplates[code] = list(cr_template_tuple) + list(cr_set)
- @deprecated('site.category_redirects()', since='20170608', - future_warning=True) + @deprecated('site.category_redirects()', since='20170608') def get_cr_templates(self, code, fallback): """DEPRECATED: Build list of category redirect templates.""" self._get_cr_templates(code, fallback) @@ -1257,5 +1256,4 @@
wrapper = ModuleDeprecationWrapper(__name__) wrapper.add_deprecated_attr('WikiaFamily', replacement=FandomFamily, - since='20190420', - future_warning=True) + since='20190420') diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py index c926c69..ac015f2 100644 --- a/pywikibot/i18n.py +++ b/pywikibot/i18n.py @@ -817,4 +817,4 @@ wrapper.add_deprecated_attr( 'TranslationError', replacement_name='pywikibot.exceptions.TranslationError', - since='20210423', future_warning=True) + since='20210423') diff --git a/pywikibot/interwiki_graph.py b/pywikibot/interwiki_graph.py index 9c042f4..1d7577c 100644 --- a/pywikibot/interwiki_graph.py +++ b/pywikibot/interwiki_graph.py @@ -229,5 +229,4 @@ wrapper.add_deprecated_attr( 'GraphImpossible', replacement_name='ImportError', - since='20210423', - future_warning=True) + since='20210423') diff --git a/pywikibot/login.py b/pywikibot/login.py index 7a31257..aa05d4b 100644 --- a/pywikibot/login.py +++ b/pywikibot/login.py @@ -479,5 +479,4 @@ wrapper.add_deprecated_attr( 'OAuthImpossible', replacement_name='ImportError', - since='20210423', - future_warning=True) + since='20210423') diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py index 3a81256..ddbd03d 100644 --- a/pywikibot/page/__init__.py +++ b/pywikibot/page/__init__.py @@ -1281,7 +1281,7 @@ **kwargs)
@deprecated('put(asynchronous=True) or save(asynchronous=True)', - since='20180501', future_warning=True) + since='20180501') @deprecated_args(comment='summary', watchArticle='watch', minorEdit='minor') def put_async(self, newtext, summary=None, watch=None, minor=True, @@ -4148,7 +4148,7 @@ # alias for backwards compatibility ItemPage.concept_url = redirect_func( ItemPage.concept_uri, old_name='concept_url', class_name='ItemPage', - since='20170222', future_warning=True) + since='20170222')
class Property: @@ -5746,8 +5746,7 @@
@deprecated_args(site='encodings') -@deprecated('pywikibot.tools.chars.url2string', since='6.2.0', - future_warning=True) +@deprecated('pywikibot.tools.chars.url2string', since='6.2.0') def url2unicode(title: str, encodings='utf-8') -> str: """ DEPRECATED. Convert URL-encoded text to unicode using several encoding. @@ -5778,8 +5777,8 @@ wrapper.add_deprecated_attr( 'UnicodeToAsciiHtml', replacement_name='pywikibot.tools.chars.string_to_ascii_html', - since='6.2.0', future_warning=True) + since='6.2.0') wrapper.add_deprecated_attr( 'unicode2html', replacement_name='pywikibot.tools.chars.string2html', - since='6.2.0', future_warning=True) + since='6.2.0') diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index 91b0116..d72d391 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -1270,7 +1270,7 @@ return v if (v is None or v == '') else int(v)
-@deprecated('Site.allpages()', since='20180512', future_warning=True) +@deprecated('Site.allpages()', since='20180512') @deprecated_args(step=True) def AllpagesPageGenerator(start: str = '!', namespace=0, includeredirects=True, site=None, @@ -1417,7 +1417,7 @@ return gen
-@deprecated('site.unconnected_pages()', since='20180512', future_warning=True) +@deprecated('site.unconnected_pages()', since='20180512') @deprecated_args(step=True) def UnconnectedPageGenerator(site=None, total: Optional[int] = None): """ @@ -2029,8 +2029,7 @@ pywikibot.output('Skipping {}'.format(page.title(as_link=True)))
-@deprecated('itertools.chain(*iterables)', since='20180513', - future_warning=True) +@deprecated('itertools.chain(*iterables)', since='20180513') def CombinedPageGenerator(generators): """Yield from each iterable until exhausted, then proceed with the next.""" return itertools.chain(*generators) # pragma: no cover @@ -2068,8 +2067,7 @@ yield page.toggleTalkPage()
-@deprecated('LiveRCPageGenerator or EventStreams', since='20180415', - future_warning=True) +@deprecated('LiveRCPageGenerator or EventStreams', since='20180415') def RepeatingGenerator(generator, key_func=lambda x: x, sleep_duration=60, total: Optional[int] = None, **kwargs): """Yield items in live time. @@ -2394,7 +2392,7 @@ return site.pages_with_property(name, total=total)
-@deprecated('Site.wantedpages', since='20180803', future_warning=True) +@deprecated('Site.wantedpages', since='20180803') def WantedPagesPageGenerator(total: int = 100, site=None): # pragma: no cover """ Wanted page generator. @@ -2964,11 +2962,10 @@
DuplicateFilterPageGenerator = redirect_func( - filter_unique, old_name='DuplicateFilterPageGenerator', since='20180715', - future_warning=True) + filter_unique, old_name='DuplicateFilterPageGenerator', since='20180715') PreloadingItemGenerator = redirect_func(PreloadingEntityGenerator, old_name='PreloadingItemGenerator', - since='20170314', future_warning=True) + since='20170314')
if __name__ == '__main__': # pragma: no cover pywikibot.output('Pagegenerators cannot be run as script - are you ' diff --git a/pywikibot/site/__init__.py b/pywikibot/site/__init__.py index 312cbf4..e2d5314 100644 --- a/pywikibot/site/__init__.py +++ b/pywikibot/site/__init__.py @@ -24,5 +24,4 @@ wrapper.add_deprecated_attr( 'PageInUse', replacement_name='pywikibot.exceptions.PageInUseError', - since='20210423', - future_warning=True) + since='20210423') diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py index 77240fe..f4dafbb 100644 --- a/pywikibot/site/_apisite.py +++ b/pywikibot/site/_apisite.py @@ -823,7 +823,7 @@ # return the magic word without the preceding '#' character return self.getmagicwords('redirect')[0].lstrip('#')
- @deprecated('redirect_regex', since='20210103', future_warning=True) + @deprecated('redirect_regex', since='20210103') def redirectRegex(self): # noqa: N802 """Return a compiled regular expression matching on redirect pages.""" return self.redirect_regex @@ -1144,7 +1144,7 @@ **args) self._update_page(page, query, verify_imageinfo=True)
- @deprecated('page.exists()', since='20180218', future_warning=True) + @deprecated('page.exists()', since='20180218') def page_exists(self, page): """Return True if and only if page is an existing page on site.""" return page.pageid > 0 @@ -2112,7 +2112,7 @@ self.unlock_page(page)
@deprecate_arg('summary', 'reason') - @deprecated('delete()', since='20210330', future_warning=True) + @deprecated('delete()', since='20210330') def deletepage(self, page, reason: str): """Delete page from the wiki. Requires appropriate privilege level.
@@ -2127,8 +2127,7 @@ """ self.delete(page, reason)
- @deprecated('delete() with oldimage keyword parameter', since='20210330', - future_warning=True) + @deprecated('delete() with oldimage keyword parameter', since='20210330') def deleteoldimage(self, page, oldimage: str, reason: str): """Delete a specific version of a file. Requires appropriate privileges.
@@ -2195,7 +2194,7 @@ self.unlock_page(page)
@deprecate_arg('summary', 'reason') - @deprecated('undelete()', since='20210330', future_warning=True) + @deprecated('undelete()', since='20210330') def undelete_page(self, page, reason: str, revisions=None): """DEPRECATED. Undelete page from the wiki.
@@ -2210,8 +2209,7 @@ """ self.undelete(page, reason, revisions=revisions)
- @deprecated('undelete() with fileids parameter', since='20210330', - future_warning=True) + @deprecated('undelete() with fileids parameter', since='20210330') def undelete_file_versions(self, page, reason: str, fileids=None): """DEPRECATED. Undelete page from the wiki.
diff --git a/pywikibot/site/_basesite.py b/pywikibot/site/_basesite.py index be7271a..7a8e354 100644 --- a/pywikibot/site/_basesite.py +++ b/pywikibot/site/_basesite.py @@ -410,32 +410,27 @@
# namespace shortcuts for backwards-compatibility
- @deprecated('namespaces.SPECIAL.custom_name', since='20160407', - future_warning=True) + @deprecated('namespaces.SPECIAL.custom_name', since='20160407') def special_namespace(self): """Return local name for the Special: namespace.""" return self.namespace(-1)
- @deprecated('namespaces.FILE.custom_name', since='20160407', - future_warning=True) + @deprecated('namespaces.FILE.custom_name', since='20160407') def image_namespace(self): """Return local name for the File namespace.""" return self.namespace(6)
- @deprecated('namespaces.MEDIAWIKI.custom_name', since='20160407', - future_warning=True) + @deprecated('namespaces.MEDIAWIKI.custom_name', since='20160407') def mediawiki_namespace(self): """Return local name for the MediaWiki namespace.""" return self.namespace(8)
- @deprecated('namespaces.TEMPLATE.custom_name', since='20160407', - future_warning=True) + @deprecated('namespaces.TEMPLATE.custom_name', since='20160407') def template_namespace(self): """Return local name for the Template namespace.""" return self.namespace(10)
- @deprecated('namespaces.CATEGORY.custom_name', since='20160407', - future_warning=True) + @deprecated('namespaces.CATEGORY.custom_name', since='20160407') def category_namespace(self): """Return local name for the Category namespace.""" return self.namespace(14) diff --git a/pywikibot/site/_datasite.py b/pywikibot/site/_datasite.py index d6c9bf7..56dd857 100644 --- a/pywikibot/site/_datasite.py +++ b/pywikibot/site/_datasite.py @@ -262,8 +262,7 @@ page.get() # cannot provide get_redirect=True (T145971) yield page
- @deprecated('DataSite.preload_entities', since='20170314', - future_warning=True) + @deprecated('DataSite.preload_entities', since='20170314') def preloaditempages(self, pagelist, groupsize=50): """DEPRECATED.""" return self.preload_entities(pagelist, groupsize) diff --git a/pywikibot/site/_generators.py b/pywikibot/site/_generators.py index 9025750..701f67b 100644 --- a/pywikibot/site/_generators.py +++ b/pywikibot/site/_generators.py @@ -1867,8 +1867,7 @@ yield (newpage, pageitem['timestamp'], pageitem['newlen'], '', pageitem['user'], pageitem['comment'])
- @deprecated('APISite.logevents(logtype="upload")', since='20170619', - future_warning=True) + @deprecated('APISite.logevents(logtype="upload")', since='20170619') @deprecated_args(lestart='start', leend='end', leuser='user', letitle=True, repeat=True, number='total', step=True) def newfiles(self, user=None, start=None, end=None, reverse=False, diff --git a/pywikibot/specialbots/__init__.py b/pywikibot/specialbots/__init__.py index 080ba21..bca9bc2 100644 --- a/pywikibot/specialbots/__init__.py +++ b/pywikibot/specialbots/__init__.py @@ -24,5 +24,4 @@ wrapper.add_deprecated_attr( 'EditReplacement', replacement_name='pywikibot.exceptions.EditReplacementError', - since='20210423', - future_warning=True) + since='20210423') diff --git a/pywikibot/specialbots/_unlink.py b/pywikibot/specialbots/_unlink.py index e23b904..56a6d93 100644 --- a/pywikibot/specialbots/_unlink.py +++ b/pywikibot/specialbots/_unlink.py @@ -101,5 +101,4 @@ wrapper.add_deprecated_attr( 'EditReplacement', replacement_name='EditReplacementError', - since='20210423', - future_warning=True) + since='20210423') diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py index 3bde56e..534cb78 100644 --- a/pywikibot/textlib.py +++ b/pywikibot/textlib.py @@ -153,7 +153,7 @@ return phrase
-@deprecated('html.unescape', since='20210405', future_warning=True) +@deprecated('html.unescape', since='20210405') def unescape(s: str) -> str: """Replace escaped HTML-special characters by their originals.""" return html.unescape(s) @@ -677,8 +677,7 @@ issue_deprecation_warning( 'site=None', 'a valid site for list or tuple parameter "replace"', - 2, since='20190223', - future_warning=True) + 2, since='20190223') elif site is None: raise ValueError('The "site" argument must be provided.')
diff --git a/pywikibot/throttle.py b/pywikibot/throttle.py index 3a9a707..172d9bb 100644 --- a/pywikibot/throttle.py +++ b/pywikibot/throttle.py @@ -87,13 +87,13 @@ self.setDelays()
@property - @deprecated(since='6.2', future_warning=True) + @deprecated(since='6.2') def multiplydelay(self): """DEPRECATED attribute.""" return True
@multiplydelay.setter - @deprecated(since='6.2', future_warning=True) + @deprecated(since='6.2') def multiplydelay(self): """DEPRECATED attribute setter."""
diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py index d822429..0a36a6b 100644 --- a/pywikibot/tools/__init__.py +++ b/pywikibot/tools/__init__.py @@ -1530,7 +1530,7 @@ return wrapper
since = kwargs.pop('since', None) - future_warning = kwargs.pop('future_warning', False) + future_warning = kwargs.pop('future_warning', True) without_parameters = len(args) == 1 and not kwargs and callable(args[0]) if 'instead' in kwargs: instead = kwargs['instead'] @@ -1741,7 +1741,7 @@ old_name: Optional[str] = None, class_name: Optional[str] = None, since: Optional[str] = None, - future_warning=False): + future_warning=True): """ Return a function which can be used to redirect to 'target'.
@@ -1822,7 +1822,7 @@ replacement_name: Optional[str] = None, warning_message: Optional[str] = None, since: Optional[str] = None, - future_warning: bool = False): + future_warning: bool = True): """ Add the name to the local deprecated names dict.
@@ -1993,17 +1993,16 @@
wrapper = ModuleDeprecationWrapper(__name__) wrapper.add_deprecated_attr('empty_iterator', replacement_name='iter(())', - since='20220422', future_warning=True) + since='20220422') wrapper.add_deprecated_attr('DotReadableDict', replacement_name='', - since='20210416', future_warning=True) + since='20210416') wrapper.add_deprecated_attr('frozenmap', replacement_name='types.MappingProxyType', - since='20210415', - future_warning=True) + since='20210415') wrapper.add_deprecated_attr('LazyRegex', replacement_name='', - since='20210418', future_warning=True) + since='20210418') wrapper.add_deprecated_attr('DeprecatedRegex', replacement_name='', - since='20210418', future_warning=True) + since='20210418')
is_IP = redirect_func(is_ip_address, old_name='is_IP', # noqa N816 diff --git a/pywikibot/tools/formatter.py b/pywikibot/tools/formatter.py index 7d81aaa..1abbb85 100644 --- a/pywikibot/tools/formatter.py +++ b/pywikibot/tools/formatter.py @@ -41,7 +41,7 @@ super().__init__() self.sequence = sequence
- @deprecated('out', since='6.2.0', future_warning=True) + @deprecated('out', since='6.2.0') def format_list(self): """DEPRECATED: Create the text with one item on each line.""" return self.out diff --git a/pywikibot/version.py b/pywikibot/version.py index be75245..3bc2e86 100644 --- a/pywikibot/version.py +++ b/pywikibot/version.py @@ -507,5 +507,4 @@ wrapper.add_deprecated_attr( 'ParseError', replacement_name='pywikibot.exceptions.VersionParseError', - since='20210423', - future_warning=True) + since='20210423') diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py index 02c68ef..84c5397 100755 --- a/scripts/solve_disambiguation.py +++ b/scripts/solve_disambiguation.py @@ -707,82 +707,82 @@ # Deprecated properties ---------------------------------------
@property - @deprecated('opt.always', since='20210303', future_warning=True) + @deprecated('opt.always', since='20210303') def always(self): # noqa: D102 return self.opt.always
@always.setter - @deprecated('opt.always', since='20210303', future_warning=True) + @deprecated('opt.always', since='20210303') def always(self, value): self.opt.always = value
@property - @deprecated('opt.dnskip', since='20210303', future_warning=True) + @deprecated('opt.dnskip', since='20210303') def dnSkip(self): # noqa: D102 return self.opt.dnskip
@dnSkip.setter - @deprecated('opt.dnskip', since='20210303', future_warning=True) + @deprecated('opt.dnskip', since='20210303') def dnSkip(self, value): self.opt.dnskip = value
@property - @deprecated('opt.primary', since='20210303', future_warning=True) + @deprecated('opt.primary', since='20210303') def primary(self): # noqa: D102 return self.opt.primary
@primary.setter - @deprecated('opt.primary', since='20210303', future_warning=True) + @deprecated('opt.primary', since='20210303') def primary(self, value): self.opt.primary = value
@property - @deprecated('opt.main', since='20210303', future_warning=True) + @deprecated('opt.main', since='20210303') def main_only(self): # noqa: D102 return self.opt.main
@main_only.setter - @deprecated('opt.main', since='20210303', future_warning=True) + @deprecated('opt.main', since='20210303') def main_only(self, value): self.opt.main = value
@property - @deprecated('opt.first', since='20210303', future_warning=True) + @deprecated('opt.first', since='20210303') def first_only(self): # noqa: D102 return self.opt.first
@first_only.setter - @deprecated('opt.first', since='20210303', future_warning=True) + @deprecated('opt.first', since='20210303') def first_only(self, value): self.opt.first = value
@property - @deprecated('opt.min', since='20210303', future_warning=True) + @deprecated('opt.min', since='20210303') def minimum(self): # noqa: D102 return self.opt.min
@minimum.setter - @deprecated('opt.min', since='20210303', future_warning=True) + @deprecated('opt.min', since='20210303') def minimum(self, value): self.opt.min = value
@property - @deprecated('opt.pos', since='20210303', future_warning=True) + @deprecated('opt.pos', since='20210303') def alternatives(self): # noqa: D102 return self.opt.pos
@alternatives.setter - @deprecated('opt.pos', since='20210303', future_warning=True) + @deprecated('opt.pos', since='20210303') def alternatives(self, value): self.opt.pos = value
@property - @deprecated('opt.just', since='20210303', future_warning=True) + @deprecated('opt.just', since='20210303') def getAlternatives(self): # noqa: D102 return self.opt.just
@getAlternatives.setter - @deprecated('opt.just', since='20210303', future_warning=True) + @deprecated('opt.just', since='20210303') def getAlternatives(self, value): self.opt.just = value
pywikibot-commits@lists.wikimedia.org