Page MenuHomePhabricator

Drop support for Python 3.7
Closed, ResolvedPublic

Description

Proposal

The last main release Pywikibot 9 was released in March 2023. I propose to drop support for Python 3.7 with Pywikibot 10, deployed probably in at the beginning of 2025. Python 3.7 reached EOL in June 2023 (1). The current download statistic of the last 6 months is as follows (2):

Version Downloads [%]263 843
3.130.0
3.1214.5
3.1156.2⏹⏹⏹⏹⏹⏹
3.1015.9⏹⏹
3.95.4
3.81.2
3.71.0
unknown5.6

Please add your remarks, expand pros and cons and maybe draw attention to it when you find a blocker.

Pros

  • Toolforge k8s 3.9 available since May 2022 (T268438) and 3.11 and bastions have 3.11
  • Legacy buster bastion still has Python 3.7 but this host is deprecated and will eventually go away.
  • Python 3.8 has importlib.metadata and does not need any external package
  • Also a lot of packages do not support Python 3.7 any longer with their current release.
  • Python 3.8 comes with improvements like assignment expressions, positional-only parameters, self-documenting f-strings, functools.singledispatchmethod() and is much faster than Python 3.7 (3)
  • L10N updates can still be done by a maintenance script for older Pywikibot versions
  • Pywikibot 3.7 is not used very often (~ 1.0 %)
  • CI tests can be run faster without Python 3.7 support
  • Python 3.7 is not available on latest ubuntu os but needs 22.04
  • Python 3.7 can still be used with Pywikbot 9.

Cons

  • Python 3.8 has syntax changes that cannot be backported in any way.
  • Pywikibot is no longer updated for older Python versions
  • Bugfixes are not available for older Pywikibot versions

Event Timeline

@ChongDae: I found out that you are the only one running Pywikibot scripts with Python 3.7. Are you able to change the Python version within the next few months?

@Xqt Yes. I can change to newer version. Please go ahead.

Change #1100092 had a related patch set uploaded (by Xqt; author: Xqt):

[integration/config@master] jjb/zuul: use Python 3.8 instead of 3.7 for deeptest

https://gerrit.wikimedia.org/r/1100092

Change #1100094 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] CI: Use Python 3.8 instead of Python 3.7 for tests

https://gerrit.wikimedia.org/r/1100094

Change #1100094 merged by jenkins-bot:

[pywikibot/core@master] CI: Use Python 3.8 instead of Python 3.7 for tests

https://gerrit.wikimedia.org/r/1100094

Change #1100108 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] tests: run github actions with Python 3.8+

https://gerrit.wikimedia.org/r/1100108

Change #1100108 merged by Xqt:

[pywikibot/core@master] tests: run github actions with Python 3.8+

https://gerrit.wikimedia.org/r/1100108

Change #1100127 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] pwb 10: srop support for Python 3.7

https://gerrit.wikimedia.org/r/1100127

Change #1100130 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] pwb 10: drop support for Python 3.7 in time module

https://gerrit.wikimedia.org/r/1100130

Change #1100127 merged by Xqt:

[pywikibot/core@master] pwb 10: drop support for Python 3.7

https://gerrit.wikimedia.org/r/1100127

Change #1100130 merged by Xqt:

[pywikibot/core@master] pwb 10: drop support for Python 3.7 in time module

https://gerrit.wikimedia.org/r/1100130

Xqt claimed this task.

Change #1100092 merged by jenkins-bot:

[integration/config@master] jjb/zuul: use Python 3.8 instead of 3.7 for deeptest

https://gerrit.wikimedia.org/r/1100092

Change #1100501 had a related patch set uploaded (by JJMC89; author: JJMC89):

[pywikibot/core@master] remove pywiibot.backports.importlib_metadata

https://gerrit.wikimedia.org/r/1100501

Change #1100501 merged by JJMC89:

[pywikibot/core@master] remove pywikibot.backports.importlib_metadata

https://gerrit.wikimedia.org/r/1100501