Skip to content

Commit

Permalink
Merge "pwb 10: drop support for Python 3.7"
Browse files Browse the repository at this point in the history
  • Loading branch information
xqt authored and Gerrit Code Review committed Dec 3, 2024
2 parents e2f3c9a + eba241c commit eee12de
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 39 deletions.
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand Down
16 changes: 15 additions & 1 deletion ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -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
====================

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`
Expand Down
3 changes: 1 addition & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down
6 changes: 3 additions & 3 deletions pwb.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.. versionadded:: 8.0
"""
#
# (C) Pywikibot team, 2022
# (C) Pywikibot team, 2022-2024
#
# Distributed under the terms of the MIT license.
#
Expand All @@ -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
Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ maintainers = [
{name = "The Pywikibot team", email = "[email protected]"},
]
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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand All @@ -183,7 +182,7 @@ use_parentheses = true


[tool.mypy]
python_version = 3.7
python_version = 3.8
enable_error_code = [
"ignore-without-code",
]
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://www.python.org/downloads/>`_
You need to have at least Python version `3.8 <https://www.python.org/downloads/>`_
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.
Expand Down
4 changes: 1 addition & 3 deletions pywikibot/backports.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 11 additions & 23 deletions pywikibot/userinterfaces/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit eee12de

Please sign in to comment.