jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1297765?usp=email )
Change subject: Remove deprecated languages, getPropertyType, userName, and
isIpEdit methods
......................................................................
Remove deprecated languages, getPropertyType, userName, and isIpEdit methods
Change-Id: I7fe82e337b9b57553e147cd6483b28e0b0e540fc
---
M ROADMAP.rst
M pywikibot/page/_basepage.py
M pywikibot/site/_basesite.py
M pywikibot/site/_datasite.py
M tests/page_tests.py
5 files changed, 1 insertion(+), 57 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/ROADMAP.rst b/ROADMAP.rst
index 00f14c4..47f2957 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -31,12 +31,6 @@
Pending removal in Pywikibot 12
-------------------------------
-* 9.6.0:
:meth:`BaseSite.languages()<pywikibot.site._basesite.BaseSite.languages>` will
be removed in
- favour of :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.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.3.0: *botflag* parameter of :meth:`Page.save()<page.BasePage.save>`,
:meth:`Page.put()
<page.BasePage.put>`, :meth:`Page.touch()<page.BasePage.touch>` and
:meth:`Page.set_redirect_target()<page.Page.set_redirect_target>` was
renamed to *bot*
diff --git a/pywikibot/page/_basepage.py b/pywikibot/page/_basepage.py
index ada80c6..cd0eafd 100644
--- a/pywikibot/page/_basepage.py
+++ b/pywikibot/page/_basepage.py
@@ -954,26 +954,6 @@
includecomments=includecomments)
return self._expanded_text
- @deprecated('latest_revision.user', since='9.3.0')
- def userName(self) -> str:
- """Return name or IP address of last user to edit page.
-
- .. version-deprecated:: 9.3
- Use :attr:`latest_revision.user<latest_revision>`
- instead.
- """
- return self.latest_revision.user # type: ignore[attr-defined]
-
- @deprecated('latest_revision.anon', since='9.3.0')
- def isIpEdit(self) -> bool:
- """Return True if last editor was unregistered.
-
- .. version-deprecated:: 9.3
- Use :attr:`latest_revision.anon<latest_revision>`
- instead.
- """
- return self.latest_revision.anon # type: ignore[attr-defined]
-
@cached
def lastNonBotUser(self) -> str | None:
"""Return name or IP address of last human/non-bot user to edit page.
diff --git a/pywikibot/site/_basesite.py b/pywikibot/site/_basesite.py
index aca3163..54977d3 100644
--- a/pywikibot/site/_basesite.py
+++ b/pywikibot/site/_basesite.py
@@ -25,7 +25,6 @@
from pywikibot.tools import (
ComparableMixin,
cached,
- deprecated,
first_upper,
normalize_username,
)
@@ -256,15 +255,6 @@
"""Return hash value of instance."""
return hash(repr(self))
- @deprecated('codes', since='9.6')
- def languages(self) -> list[str]:
- """Return list of all valid site codes for this site's Family.
-
- .. version-deprecated:: 9.6
- Use :meth:`codes` instead.
- """
- return sorted(self.codes)
-
@property
def codes(self) -> set[str]:
"""Return set of all valid site codes for this site's Family.
diff --git a/pywikibot/site/_datasite.py b/pywikibot/site/_datasite.py
index d089e07..c48fdf6 100644
--- a/pywikibot/site/_datasite.py
+++ b/pywikibot/site/_datasite.py
@@ -26,7 +26,7 @@
)
from pywikibot.site._apisite import APISite
from pywikibot.site._decorators import need_extension, need_right
-from pywikibot.tools import deprecated, merge_unique_dicts
+from pywikibot.tools import merge_unique_dicts
__all__ = ('DataSite', )
@@ -270,18 +270,6 @@
return entity['datatype']
- @deprecated('get_property_type', since='9.5.0')
- def getPropertyType(self, prop):
- """Obtain the type of a property.
-
- .. version-deprecated:: 9.5
- Use :meth:`get_property_type` instead.
- """
- try:
- return self.get_property_type(prop)
- except NoWikibaseEntityError as exc:
- raise KeyError(f'{exc.entity.id} does not exist') from None
-
@need_right('edit')
def editEntity(self,
entity: pywikibot.page.WikibaseEntity | dict,
diff --git a/tests/page_tests.py b/tests/page_tests.py
index c044bd0..8652072 100755
--- a/tests/page_tests.py
+++ b/tests/page_tests.py
@@ -598,14 +598,6 @@
# we only check that the returned objects are of correct type.
self.assertIsInstance(mainpage.get(), str)
self.assertIsInstance(mainpage.latest_revision_id, int)
-
- with suppress_warnings(
- r'pywikibot\.page\._basepage.BasePage\.\w+ is deprecated since '
- r'release 9\.3\.0; use latest_revision\..+ instead\.',
- FutureWarning):
- self.assertIsInstance(mainpage.userName(), str)
- self.assertIsInstance(mainpage.isIpEdit(), bool)
-
self.assertIsInstance(mainpage.exists(), bool)
self.assertIsInstance(mainpage.isRedirectPage(), bool)
self.assertIsInstance(mainpage.isDisambig(), bool)
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1297765?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: I7fe82e337b9b57553e147cd6483b28e0b0e540fc
Gerrit-Change-Number: 1297765
Gerrit-PatchSet: 4
Gerrit-Owner: Saurabh Tiwari <[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]