Skip to content

Commit

Permalink
deprecate pywikibot.version.get_toolforge_hostname()
Browse files Browse the repository at this point in the history
With SGE being removed, the k8s hostname is not relevant

Change-Id: Ia81f58bf47fdf7ecc2f53c602cc3b1ab157d6764
  • Loading branch information
JJMC89 committed Dec 24, 2023
1 parent 9817eee commit 7e0c21a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions ROADMAP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Breaking changes and code cleanups
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
Expand Down
6 changes: 1 addition & 5 deletions pywikibot/scripts/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import sys

import pywikibot
from pywikibot.version import get_toolforge_hostname, getversion
from pywikibot.version import getversion


class DummyModule:
Expand Down Expand Up @@ -80,10 +80,6 @@ def main(*args: str) -> None:

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',
Expand Down
3 changes: 3 additions & 0 deletions pywikibot/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 7e0c21a

Please sign in to comment.