Page MenuHomePhabricator

Drop support for Python 3.6
Closed, ResolvedPublic

Description

Proposal

The last main release Pywikibot 8 was released in January 2023. I propose to drop support for Python 3.6 with Pywikibot 9.0 (deployed probably in at the end of 2023).

Toolforge has Python 3.7 and 3.9 available since May 2022 (T268438) and there are further advantages with Python 3.7+.

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

Pros

  • Python 3.6 needs setuptools 59.6.0 but there is a vulnerability reported with setuptools < 65.5.1 (T347051). Therefore a minimal Python release 3.7 is necessary.
  • Python 3.6 needs requests 2.27.1 but there is a vulnerability reported with requests < 2.31.0 (T347031). Therefore a minimal Python release 3.7 is necessary.
  • tox is going to be updated from 3.8 to 4.8 but the virtual environment dependency of tox 4.8 does not match Python 3.6 restrictions. tox is necessary for jenkins code integration.
  • The end of life cycle of Python 3.6 has been reached since 23rd December 2021 [1]. This is about two years when Pywikibot 9 is to be deployed.
  • Older Python versions are still supported with Pywikibot releases marked with a tag [2][3]
  • Python 3.7 comes with improvements like dataclass constructors, forward references of annotations, insertion-order preservation nature of dict objects, namedtuples accepts default values. They might be very important for furher Pywikibot developent. [4]
  • nullcontext manager and SimpleQueue can be used from the standard library instead of backports [5]
  • Also a lot of packages do not support Python 3.6 any longer with their current release. This concerns in particular requests package, setuptools, fake-useragent and a lot of test packages [6]
  • Our documentation recommends Python 3.6 or higher [7]
  • L10N updates can still be done by maintenance scripts for older Python versions
  • Pywikibot 3.6 is not used very often (~ 0.8 %), see T266984
  • CI tests can be run faster without Python 3.6 support

Cons

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

Refs

[1] https://endoflife.date/python
[2] https://pypi.org/project/pywikibot/#history
[3] https://gerrit.wikimedia.org/r/admin/repos/pywikibot/core,tags
[4] https://docs.python.org/3.7/whatsnew/3.7.html
[5] https://doc.wikimedia.org/pywikibot/master/api_ref/x_backports.html#module-backports
[6] https://codesearch.wmcloud.org/pywikibot/?q=%5B%3C%3D%3E%5D+%5B%27%22%5D3%5C.7&files=&excludeFiles=&repos=
[7] https://doc.wikimedia.org/pywikibot/stable/index.html

Event Timeline

Xqt renamed this task from Drop suppot for Python 3.6 to Drop support for Python 3.6.Sep 21 2023, 4:32 PM

drop support for Python 3.5 with Pywikibot 9.0

@Xqt the part in bold refers to 3.5, I guess you were meaning 3.6?

drop support for Python 3.5 with Pywikibot 9.0

@Xqt the part in bold refers to 3.5, I guess you were meaning 3.6?

Yes indeed. Thank you.

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

[pywikibot/core@master] [9.0] Drop support for Python 3.6

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

Statistic update:

(T350568)

There are still 4% using Python 3.6 with Pywikibot 8. Most of them are made by the https://www.marefa.org project reading data from commons (I guess) by using Pywikibot 8.4. Excluding these 200k requests the remaining usage for Python 3.6 with Pywikibot 8 is 0.6% only, most of them is caused by Pywikibot testing.

I haven't found any usage for Python 3.6 with Pywikibot 8.5 and 8.6 except Pywikibot-test requests. Therefore dropping Python 3.6 can be done now safely in pariculary because older Pywikibot releases aren't affected with such change.

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

[pywikibot/core@master] [9.0] Prepare Pywikibot 9

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

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

[integration/config@master] [Pywikibot/core] Use Python 3.7 instead of 3.6 for deeptest

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

Change 980431 merged by jenkins-bot:

[pywikibot/core@master] [9.0] Prepare Pywikibot 9

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

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

[pywikibot/core@master] [tests] Disable Python 3.6 CI tests

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

Change 980435 merged by jenkins-bot:

[pywikibot/core@master] [tests] Disable Python 3.6 CI tests

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

Change 964180 merged by jenkins-bot:

[pywikibot/core@master] [9.0] Drop support for Python 3.6

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

Change 980432 merged by jenkins-bot:

[integration/config@master] [Pywikibot/core] Use Python 3.7 instead of 3.6 for deeptest

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

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

[pywikibot/core@master] [cleanup] use type annotation for singledispatch

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

Change 1001357 merged by jenkins-bot:

[pywikibot/core@master] [cleanup] use type annotation for singledispatch

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