jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/985370 )
Change subject: deprecate pywikibot.version.get_toolforge_hostname() ......................................................................
deprecate pywikibot.version.get_toolforge_hostname()
With SGE being removed, the k8s hostname is not relevant
Change-Id: Ia81f58bf47fdf7ecc2f53c602cc3b1ab157d6764 --- M pywikibot/version.py M ROADMAP.rst M pywikibot/scripts/version.py 3 files changed, 16 insertions(+), 5 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/ROADMAP.rst b/ROADMAP.rst index 0f5d08a..5026fdf 100644 --- a/ROADMAP.rst +++ b/ROADMAP.rst @@ -36,6 +36,7 @@ Deprecations ------------
+* 9.0.0: ``pywikibot.version.get_toolforge_hostname()`` is deprecated without replacement * 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 diff --git a/pywikibot/scripts/version.py b/pywikibot/scripts/version.py index be51af8..9e1f129 100755 --- a/pywikibot/scripts/version.py +++ b/pywikibot/scripts/version.py @@ -16,7 +16,7 @@ import sys
import pywikibot -from pywikibot.version import get_toolforge_hostname, getversion +from pywikibot.version import getversion
class DummyModule: @@ -80,10 +80,6 @@
pywikibot.info('Python: ' + sys.version)
- toolforge_env_hostname = get_toolforge_hostname() - if toolforge_env_hostname: - pywikibot.info('Toolforge hostname: ' + toolforge_env_hostname) - # check environment settings settings = {key for key in os.environ if key.startswith('PYWIKIBOT')} settings.update(['PYWIKIBOT_DIR', 'PYWIKIBOT_DIR_PWB', diff --git a/pywikibot/version.py b/pywikibot/version.py index 318468b..ae872d9 100644 --- a/pywikibot/version.py +++ b/pywikibot/version.py @@ -26,16 +26,19 @@ from pywikibot.backports import cache from pywikibot.comms.http import fetch from pywikibot.exceptions import VersionParseError +from pywikibot.tools import deprecated
def _get_program_dir() -> str: return os.path.normpath(os.path.split(os.path.dirname(__file__))[0])
+@deprecated(since='9.0.0') def get_toolforge_hostname() -> str | None: """Get hostname of the current Toolforge host.
.. versionadded:: 3.0 + .. deprecated:: 9.0
:return: The hostname of the currently running host, if it is in Wikimedia Toolforge; otherwise return None.
pywikibot-commits@lists.wikimedia.org