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 or early next year).
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
--
- 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.5 has been reached since 23th 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 standard library instead from backports [5]
- Also a lot of packages does 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 documenation 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 runned faster without Python 3.6 support
Cons
--
- Python 3.7 has syntax changes which 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