Xqt has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1100127?usp=email )

Change subject: pwb 10: drop support for Python 3.7
......................................................................

pwb 10: drop support for Python 3.7

Bug: T378893
Change-Id: Iec00194b97abe7f89d7fc49db233346f198b38b5
---
M HISTORY.rst
M ROADMAP.rst
M docs/index.rst
M pwb.py
M pyproject.toml
M pywikibot/README.rst
M pywikibot/backports.py
M pywikibot/userinterfaces/gui.py
M requirements.txt
M setup.py
10 files changed, 36 insertions(+), 39 deletions(-)

Approvals:
  jenkins-bot: Verified
  Xqt: Verified; Looks good to me, approved




diff --git a/HISTORY.rst b/HISTORY.rst
index 186f92f..b0a5618 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -3,6 +3,7 @@

 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 a2b2b64..756468c 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 @@
 * 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 @@
 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 ea1163c..228bc7b 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -21,8 +21,7 @@
 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 809af16..077d9a3 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 df9b092..4f2613b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -17,7 +17,7 @@
     {name = "The Pywikibot team", email = "pywiki...@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 @@
     "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 @@


 [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 @@


 [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 4e90b04..0de4358 100644
--- a/pywikibot/README.rst
+++ b/pywikibot/README.rst
@@ -27,7 +27,7 @@
   * 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.
diff --git a/pywikibot/backports.py b/pywikibot/backports.py
index 901f315..986786b 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 64bcbcf..9091044 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 @@
             '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 4193d61..41d2834 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 3f3953e..f360bf8 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',

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1100127?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: Iec00194b97abe7f89d7fc49db233346f198b38b5
Gerrit-Change-Number: 1100127
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <i...@gno.de>
Gerrit-Reviewer: Xqt <i...@gno.de>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- pywikibot-commits@lists.wikimedia.org
To unsubscribe send an email to pywikibot-commits-le...@lists.wikimedia.org

Reply via email to