-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop support for EOL Python 2.6 #149
Conversation
yamllint is not only used by Ansible. What makes you say that Python 2.6 support can be dropped like that, without impacting any other project? |
I understand if you wish to retain 2.6, and the decision is of course ultimately yours. However, at some point it's good to draw a line and stop supporting EOL versions, to reduce maintenance burden, to allow newer features of Python to be used, to reduce resource usage, and also free other dependencies from supporting old versions. Two CPython core developers talk about the network effect here and here. I think now is a good time to drop 2.6. People still using 2.6 are advised to upgrade to 3.x (or 2.7). Those still using 2.6 are already using an insecure Python runtime and already have to pin many dependencies which have dropped 2.6. I agree completely that Ansible isn't the only thing using yamllint. And there's no way to know what proprietary/in-house/closed-source code might still be using yamllint with Python 2.6 (or 3.3!). Ansible was cited as the reason to maintain 2.6 support in, for example, #55 (comment) and cpburnz/python-pathspec#16. The latter also says yamllint is used by OpenStack, however that has also dropped 2.6: https://wiki.openstack.org/wiki/Python3#Python_2:_Python_2.6_support_dropped.2C_Python_2.7_only. Looking at the first 10 projects under "Used by" at https://libraries.io/pypi/yamllint, I don't see any supporting Python 2.6:
Finally, with Python 2's EOL approaching, many projects have pledged to drop support for Python 2 on or before 2020-01-01 |
Thanks a lot for this comprehensive review of dependent Python projects. You convinced me. I'll do a slight reword of your last commit then merge. |
You're welcome, and thanks for your work on yamllint! |
Summary: yamllint used to support Python 2.6 because it's a dependency of Ansible, which supported Python 2.6. Ansible has now dropped 2.6, so yamllint may also drop it.
Python 2.6 is EOL since 2013-10-29 and no longer receiving security updates (or any updates) from the core Python team.
Source: https://en.wikipedia.org/wiki/CPython#Version_history
Ansible 2.7.0 was released in October 2018 which drops Python 2.6.
https://github.com/ansible/ansible/blob/stable-2.7/changelogs/CHANGELOG-v2.7.rst#v2-7-0
https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.7.html#python-compatibility
Yamllint's support of Python 2.6 is also preventing its dependencies from dropping it too, for example pathspec: cpburnz/python-pathspec#16.
This PR drops support for 2.6.
It adds
python_requires
to help pip install the right version for people still running old Python versions, plus Trove version classifiers for PyPI.It also upgrades unit tests to use more useful asserts, and upgrades to modern Python syntax using
pyupgrade
.