-
Notifications
You must be signed in to change notification settings - Fork 197
Drop python2 support? #2047
Description
Python2 is no longer supported by the Python developers since January 2020: https://www.python.org/doc/sunset-python-2/.
And major Linux distributions like Debian and Ubuntu as well as macOS have now also deprecated python2. This means they ship with python3 instead of 2 and have changed all shebangs in python scripts to #!/usr/bin/python3.
The general idea that seems to be adhered to by both Linux and macos seems to be: Installing 'python' will always install the deprecated python2 and calling 'python' will always run deprecated python2. This also means that any package still using #!/usr/bin/python will have python2 as a (deprecated) dependency. Ultimately, the idea is that you always call 'python3' or install 'python3-foo' and that running 'python' and installing 'python-foo' should become a thing of the past.
E.g.: https://wiki.debian.org/Python/2Removal:
port upstream package to python3 (or file upstream bug): make sure package doesn't call python at build- or compile time (as there won't be a python package and no python command in bullseye, only python3.)
and https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3#.2Fusr.2Fbin.2Fpython:
/usr/bin/python is a symbolic link to /usr/bin/python2 and belongs to the python2 package. This also means that packages that require /usr/bin/python (usually due to shebangs) de facto require Python 2.
...
Since Fedora 26, there is no python package, only python3 and python2. python is virtually provided from python2.
So the "python-is-python3" package that I mentioned I installed on ubuntu 20.04, is only an ugly workaround that will break software that still relies on the deprecated python2 and the right way forward seems to be to update all our python scripts to use #!/usr/bin/python3 instead... This would also mean that we effectively drop support for python2.
Any thoughts on this?