Page MenuHomePhabricator

Drop support for Python 3.8
Closed, ResolvedPublic

Description

Proposal

The last main release Pywikibot 10 was released in March 2024. I propose to drop support for Python 3.8 with Pywikibot 11, which will likely be deployed at the end of 2025 or later. Python 3.8 reached EOL in October 2024 (1). A warning message will be added in Pywikibot 10.6 (master only) in October 2025. The current download statistic of the last 6 months is as follows (2):

Pywikibot downloads by Python version (last 6 months) — October 2025

Python%rank
3.150.0
3.140.0
3.131.5
3.1270.1⏹⏹⏹⏹⏹⏹⏹
3.1117.7⏹⏹
3.106.1
3.91.7
3.80.1
other0.1
unknown2.7

Please add your remarks, expand pros and cons list, and note any potential blockers.

Pros

  • Toolforge already supports Python 3.13 (T381899)
  • Many third-party packages have dropped Python 3.8 support; building Pywikibot packages (e.g., for pywikibot.org nightly dumps) causes numerous warnings due to outdated settings, see T398947 for example
  • Dropping Python 3.8 removes the need to keep compatibility workarounds and suppress deprecation warnings for features removed in newer Python versions, see changelog.
  • Python 3.9 introduced useful feature such as str.removeprefix(prefix) and str.removesuffix(suffix) (3)
  • concurrent.futures.shutdown() in Python 3.9 supports the cancel_futures parameter, replacing the current workaround of manually calling cancel() on each Future.
  • The new graphlib module (added in Python 3.9) could be leveraged for category tree processing
  • Very low usage of Python 3.8 (~0.3%).
  • GitHub CI runs will be faster without Python 3.8 in the test matrix
  • PyPy 3.8 is no longer available on the latest Ubuntu OS (requires Ubuntu 22.04)
  • Users can continue using Python 3.8 with Pywikibot 10.
  • No backports of typing.Dict, typing.List etc. necessary for typing.cast()

Cons

  • Python 3.9 introduces syntax changes that cannot be backported
  • Users on older environments will no longer receive Pywikibot updates after version 10
  • Bugfixes for Python 3.8 users will not be available in newer Pywikibot versions.
  • Potential disruption for users on legacy systems (e.g., shared hosting, old enterprise distributions)
  • Changes listed in the Pywikibot changelog may require modifications to private scripts when upgrading, especially if deprecated features have been removed

Backward compatibility

Dropping Python 3.8 support will not break existing scripts immediately. Users who still rely on Python 3.8 can continue using Pywikibot 10 without changes. However, they will not receive further updates, new features, or bugfixes in later releases. Migrating to Python ≥ 3.9 is recommended to ensure compatibility with future Pywikibot versions and third-party packages.

Conclusion

Ending Python 3.8 support in Pywikibot 11 aligns with upstream EOL, reduces maintenance overhead, and enables the use of modern Python features without compatibility workarounds. Given the very low adoption rate (~0.3%), the benefits clearly outweigh the drawbacks.

Event Timeline

Xqt renamed this task from Drop support for Python 3.7 to Drop support for Python 3.8.Aug 13 2025, 9:22 AM
Xqt added a parent task: T396368: Pywikibot 11 release.

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

[pywikibot/core@master] Announcement:Show a warning if Pywikibot is running with Python 3.8

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

Change #1195398 merged by jenkins-bot:

[pywikibot/core@master] Announcement:Show a warning if Pywikibot is running with Python 3.8

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

I have checked the usage of Pywikibot versions 10.3–10.6 with Python 3.8 and informed the affected bot owners about this issue.

For older Pywikibot releases, I assume that the bot owners will continue using their current version for some time.
To update Pywikibot, they can refer to the documentation.

Me personally, i don't think i can update Python, old laptop, Windows 7. If there is some workaround to update Python i will gladly do it

Regards

Hi @Milicevic01, I understand your situation with Windows 7 and the limitations it imposes on upgrading Python. As far as I know, Python 3.9+ cannot be installed on Windows 7. A portable or embeddable package might work, but it is not officially supported.

Staying on Python 3.8 is a valid option for older setups, and several bots are still running Pywikibot 9 or even older versions (but not lower than 6.6.1) without bigger problems. But note that many issues are solved in newer releases.

In practice, you can continue using Pywikibot 10.x with Python 3.8. This allows your bots to keep running, but you would need to accept that future Pywikibot (11 or later) releases will require at least Python 3.9. In other words, a temporary grace period for Python 3.8 doesn’t benefit Windows 7 users in the long run; those who cannot upgrade their system will need to remain on older Pywikibot versions.

The main reasons to move to Python 3.9+ are already outlined in the pro-list: updated dependencies, security updates (Python 3.8 is End-of-Life), improved maintainability, and consistency with CI/CD and Linux environments. These factors ensure that Pywikibot development can continue efficiently and safely.

Hi @Milicevic01, I understand your situation with Windows 7 and the limitations it imposes on upgrading Python. As far as I know, Python 3.9+ cannot be installed on Windows 7. A portable or embeddable package might work, but it is not officially supported.

Staying on Python 3.8 is a valid option for older setups, and several bots are still running Pywikibot 9 or even older versions (but not lower than 6.6.1) without bigger problems. But note that many issues are solved in newer releases.

In practice, you can continue using Pywikibot 10.x with Python 3.8. This allows your bots to keep running, but you would need to accept that future Pywikibot (11 or later) releases will require at least Python 3.9. In other words, a temporary grace period for Python 3.8 doesn’t benefit Windows 7 users in the long run; those who cannot upgrade their system will need to remain on older Pywikibot versions.

The main reasons to move to Python 3.9+ are already outlined in the pro-list: updated dependencies, security updates (Python 3.8 is End-of-Life), improved maintainability, and consistency with CI/CD and Linux environments. These factors ensure that Pywikibot development can continue efficiently and safely.

👍

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

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

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

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

[pywikibot/core@master] tests: no longer run CI tests with Python 3.9

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

Change #1200391 merged by jenkins-bot:

[pywikibot/core@master] tests: no longer run CI tests with Python 3.9

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

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

[pywikibot/core@master] Cleanup: Drop support for Python 3.9

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

Change #1200414 merged by jenkins-bot:

[pywikibot/core@master] Cleanup: Drop support for Python 3.9

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

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

[pywikibot/core@master] cleanup: remove removeprefix and removesuffix from packports

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

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

[pywikibot/core@master] cleanup: replace backports.cache with functools.cache

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

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

[pywikibot/core@master] cleanup: replace Dict, List, Set from backports with bare types

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

Change #1200448 merged by Xqt:

[pywikibot/core@master] cleanup: remove removeprefix and removesuffix from packports

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

Change #1200449 merged by jenkins-bot:

[pywikibot/core@master] cleanup: replace backports.cache with functools.cache

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

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

[pywikibot/core@master] cleanup: replace Pattern, Match from backports with re.Pattern, re.Match

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

Change #1200450 merged by jenkins-bot:

[pywikibot/core@master] cleanup: replace Dict, List, Set from backports with bare types

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

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

[pywikibot/core@master] cleanup: replace collections from backports collections classes

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

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

[pywikibot/core@master] cleanup: update collections.abc classes

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

Change #1200451 merged by Xqt:

[pywikibot/core@master] cleanup: replace Pattern, Match from backports with re.Pattern, re.Match

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

Change #1200467 merged by jenkins-bot:

[pywikibot/core@master] cleanup: replace collections from backports collections classes

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

Change #1200472 merged by jenkins-bot:

[pywikibot/core@master] cleanup: update collections.abc classes

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

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

[pywikibot/core@master] cleanup: drop support for Python 3.8

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

Change #1200609 merged by jenkins-bot:

[pywikibot/core@master] cleanup: drop support for Python 3.8

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

Change #1200389 merged by jenkins-bot:

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

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

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

[pywikibot/core@master] tox: update CI jobs

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

Change #1201177 merged by jenkins-bot:

[pywikibot/core@master] tox: update CI jobs

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

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

[pywikibot/core@master] cleanup: remove deprecated code parts and update ROADMAP.rst

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

Change #1201556 merged by jenkins-bot:

[pywikibot/core@master] cleanup: remove deprecated code parts and update ROADMAP.rst

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

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

[pywikibot/core@master] cleanup: remove deprecated code parts and update ROADMAP.rst

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

Change #1201738 merged by jenkins-bot:

[pywikibot/core@master] cleanup: remove deprecated code parts and update ROADMAP.rst

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