diff --git a/HISTORY.rst b/HISTORY.rst index 186f92f4eb..b0a5618de2 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,7 @@ Release History 9.6.0 ----- +*03 December 2024* * Add support for idwikivoyage (:phab:`T381082`) * Add docstrings of :class:`tools.classproperty` methods (:phab:`T380628`) diff --git a/ROADMAP.rst b/ROADMAP.rst index a2b2b64d60..756468cfce 100644 --- a/ROADMAP.rst +++ b/ROADMAP.rst @@ -1,8 +1,19 @@ Current Release Changes ======================= +**Improvements** + * (no changes yet) +**Bugfixes** + +* (no changes yet) + +**Breaking changes and code cleanups** + +* Python 3.7 support was dropped (:phab:`T378893`) + + Current Deprecations ==================== @@ -35,6 +46,10 @@ Current Deprecations * 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 + +Pending removal in Pywikibot 11 +------------------------------- + * 8.4.0: *modules_only_mode* parameter of :class:`data.api.ParamInfo`, its *paraminfo_keys* class attribute and its preloaded_modules property will be removed * 8.4.0: *dropdelay* and *releasepid* attributes of :class:`throttle.Throttle` will be removed @@ -65,7 +80,6 @@ Current Deprecations Pending removal in Pywikibot 10 ------------------------------- -* 9.6.0: Python 3.7 support is deprecated and will be dropped with Pywikibot 10 * 9.1.0: :func:`version.svn_rev_info` and :func:`version.getversion_svn` will be removed. SVN is no longer supported. (:phab:`T362484`) * 7.7.0: :mod:`tools.threading` classes should no longer imported from :mod:`tools` diff --git a/docs/index.rst b/docs/index.rst index ea1163c8c7..228bc7b74b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -21,8 +21,7 @@ system that has a compatible version of Python installed. To check whether you have Python installed and to find its version, just type ``python`` at the CMD or shell prompt. -Python 3.7 or higher is currently required to run the bot but Python 3.8 or -higher is recommended. Python 3.7 support will be dropped with Pywikibot 10 soon. +Python 3.8 or higher is currently required to run. Pywikibot and this documentation are licensed under the :ref:`MIT license`; diff --git a/pwb.py b/pwb.py index 809af165cb..077d9a36d5 100755 --- a/pwb.py +++ b/pwb.py @@ -4,7 +4,7 @@ .. versionadded:: 8.0 """ # -# (C) Pywikibot team, 2022 +# (C) Pywikibot team, 2022-2024 # # Distributed under the terms of the MIT license. # @@ -16,13 +16,13 @@ Pywikibot is not available on: {version} -This version of Pywikibot only supports Python 3.7+. +This version of Pywikibot only supports Python 3.8+. """ def python_is_supported(): """Check that Python is supported.""" - return sys.version_info[:3] >= (3, 7) + return sys.version_info[:3] >= (3, 8) if not python_is_supported(): # pragma: no cover diff --git a/pyproject.toml b/pyproject.toml index df9b092db9..4f2613b9af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ maintainers = [ {name = "The Pywikibot team", email = "pywikibot@lists.wikimedia.org"}, ] description = "Python MediaWiki Bot Framework" -requires-python = ">=3.7.0" +requires-python = ">=3.8.0" keywords = [ "API", "bot", "client", "framework", "mediawiki", "pwb", "pybot", "python", "pywiki", "pywikibase", "pywikibot", "pywikipedia", "pywikipediabot", @@ -92,7 +92,6 @@ classifiers=[ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -171,7 +170,7 @@ disable = [ [tool.isort] -py_version = 37 +py_version = 38 add_imports = ["from __future__ import annotations"] atomic = true ensure_newline_before_comments = true @@ -183,7 +182,7 @@ use_parentheses = true [tool.mypy] -python_version = 3.7 +python_version = 3.8 enable_error_code = [ "ignore-without-code", ] diff --git a/pywikibot/README.rst b/pywikibot/README.rst index 4e90b044a5..0de43580c8 100644 --- a/pywikibot/README.rst +++ b/pywikibot/README.rst @@ -27,7 +27,7 @@ are not installed by default on some Linux distributions: * python-tkinter (optional, used by some experimental GUI stuff) -You need to have at least Python version `3.7 `_ +You need to have at least Python version `3.8 `_ or newer installed on your computer to be able to run any of the code in this package. Please refer the manual at mediawiki for further details and restrictions. diff --git a/pywikibot/backports.py b/pywikibot/backports.py index 901f3156f5..986786b5c3 100644 --- a/pywikibot/backports.py +++ b/pywikibot/backports.py @@ -36,9 +36,7 @@ ) -if PYTHON_VERSION < (3, 7, 2): - from typing import Dict as OrderedDict -elif PYTHON_VERSION < (3, 9): +if PYTHON_VERSION < (3, 9): from typing import OrderedDict else: from collections import OrderedDict diff --git a/pywikibot/userinterfaces/gui.py b/pywikibot/userinterfaces/gui.py index 64bcbcfaf0..909104426d 100644 --- a/pywikibot/userinterfaces/gui.py +++ b/pywikibot/userinterfaces/gui.py @@ -20,7 +20,6 @@ from __future__ import annotations import pywikibot -from pywikibot.tools import PYTHON_VERSION # Some Python distributions have tkinter but the underlying _tkinter @@ -93,28 +92,17 @@ def _initialize_config(theme): 'width': idleConf.GetOption('main', 'EditorWindow', 'width'), 'height': idleConf.GetOption('main', 'EditorWindow', 'height'), } - if PYTHON_VERSION >= (3, 7, 4): # T241216 - config['foreground'] = idleConf.GetHighlight( - theme, 'normal')['foreground'] - config['background'] = idleConf.GetHighlight( - theme, 'normal')['background'] - config['highlightcolor'] = idleConf.GetHighlight( - theme, 'hilite')['foreground'] - config['highlightbackground'] = idleConf.GetHighlight( - theme, 'hilite')['background'] - config['insertbackground'] = idleConf.GetHighlight( - theme, 'cursor')['foreground'] - else: - config['foreground'] = idleConf.GetHighlight( - theme, 'normal', fgBg='fg') - config['background'] = idleConf.GetHighlight( - theme, 'normal', fgBg='bg') - config['highlightcolor'] = idleConf.GetHighlight( - theme, 'hilite', fgBg='fg') - config['highlightbackground'] = idleConf.GetHighlight( - theme, 'hilite', fgBg='bg') - config['insertbackground'] = idleConf.GetHighlight( - theme, 'cursor', fgBg='fg') + + config['foreground'] = idleConf.GetHighlight( + theme, 'normal')['foreground'] + config['background'] = idleConf.GetHighlight( + theme, 'normal')['background'] + config['highlightcolor'] = idleConf.GetHighlight( + theme, 'hilite')['foreground'] + config['highlightbackground'] = idleConf.GetHighlight( + theme, 'hilite')['background'] + config['insertbackground'] = idleConf.GetHighlight( + theme, 'cursor')['foreground'] return config def add_bindings(self) -> None: diff --git a/requirements.txt b/requirements.txt index 4193d61c53..41d2834736 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,7 +18,6 @@ # $ awk -F '[#>=]' '{print $1}' requirements.txt | xargs apt-cache search # mandatory dependencies, others are optional -importlib_metadata ; python_version < '3.8' mwparserfromhell>=0.5.2 packaging requests>=2.21.0 diff --git a/setup.py b/setup.py index 3f3953eafb..f360bf86b6 100755 --- a/setup.py +++ b/setup.py @@ -70,7 +70,6 @@ # ------- setup install_requires ------- # # packages which are mandatory dependencies = [ - 'importlib_metadata ; python_version < "3.8"', 'mwparserfromhell>=0.5.2', 'packaging', 'requests>=2.21.0',