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