#982924 what-is-python: The python-is-python3 and python-dev-is-python3 packages should not exist

#982924#5
Date:
2021-02-16 16:34:44 UTC
From:
To:
Any system where the unqualified command names ‘python’ and/or
‘python-config’, or the well-known pathname /usr/bin/python, refer to
Python 3, is misconfigured.  These names need to be **permanently**
reserved for the legacy Python 2 interpreter, even after Debian ceases
to ship Python 2, or you risk breaking unpackaged software that has
not yet been ported to Python 3.  Unpackaged Python-2-only software
will continue to exist indefinitely—I am *certain* that I will still
need a Python 2 interpreter ten years from now, and I fully expect my
grandchildren will occasionally trip over Python-2-only software even
a hundred years from now.

(I am aware that PEP 394 explicitly licenses ‘python’ to run the
Python 3 interpreter.  PEP 394 is wrong.  It is my understanding that
the authors of PEP 394 felt they could not declare various
distributions (e.g. arch), that had already made ‘python’ run the v3
interpreter, to be buggy—but they should have.)

Please remove the python-is-python3 and python-dev-is-python3 packages
from Debian, and document in Debian’s Python policy that the
unqualified command names ‘python’ and ‘python-config’ and the
pathname /usr/bin/python are **permanently** reserved for the Python 2
interpreter.

I cannot overstate how much I mean **permanently**.  Forever.

#982924#10
Date:
2021-02-17 20:17:00 UTC
From:
To:
In Bullseye release file:/usr/bin/python is not reserved, but
intentionally unused.
In Bullseye release neither deb:python2 nor deb:python3 packages own
/usr/bin/python.
This is a Bullseye Release Goal with consensus from all
cpythons/pypys/etc interpreter maintainers, modules maintainers, and
app maintainers.
Specifically cpython2.7 is still around to allow for re-bootstrapping
of pypy* ecosystem on existing or new architectures.
No packages in Bullseye may depend, or build-depend on neither
deb:python, nor deb:python-is-python* packages.
Thus it is a leaf package without any dependencies. By definition not
impacting any unrelated software.
It is intended for this package, and all of its binaries to be removed
in some future Debian release after the next one.
I hope you notice the irony in the package name src:what-is-python, it
is meant for local admins to deploy as compatibility with their
respective venvs and other estates only.
It is intended for nobody to use "/usr/bin/python" outside of venv for
now. And for them to change their scripts to use either python3 or
python2 explicitly.

I want to say this bug report is "bullseye-ignore" or "wontfix".

#982924#19
Date:
2021-02-17 20:56:26 UTC
From:
To:
That is not good enough.  It needs to be reserved.

Yes, I know.  That's fine as long as there is not, **and never will
be**, any package within Debian that creates /usr/bin/python as
anything other than a link to python2.  The existence of the
python-is-python3 package breaks this constraint.

That is not good enough.  The existence of the python-is-python3
package means that there can exist Debian installations in which
/usr/bin/python executes python3, breaking **unpackaged** software.
Hence the bug report.

(A sysadmin could of course `ln -s python3 /usr/bin/python`
themselves, but then that would be their error, not a bug in Debian.)

I am concerned with this package's effect on **unpackaged** software
written by end-users and present on existing Debian systems.  I hope
you will understand that "unrelated software" does not just mean
software within Debian.

zw

#982924#24
Date:
2021-03-02 09:30:19 UTC
From:
To:
Please also consider the burden on other grandparents having to explain their
grandchildren that they have to type "python3" on Debian, when anybody else
running Python on a different platform or running Python on other Linux
distributions is used to type "python" ;)

I don't think there's a good solution for everybody.  I still think it's better
to provide an explicit choice in a package, instead of following instructions
from the web to manage the "python" symlink using update-alternatives.

I'm going to propose an addition to the Debian Python Policy on the
debian-python ML:

+Removal of the unversioned packages
+-----------------------------------
+
+Starting with the Debian 11 release (bullseye), the binary packages
+``python``, ``python-minimal``, ``python-dev``, ``python-dbg`` and
+``python-doc`` are removed.  No package in the archive must use any of
+these packages as build dependencies, dependencies, recommendations or
+suggestions.
+
+
+Unversioned python commands
+---------------------------
+
+For the Debian 11 release (bullseye), the :file:`/usr/bin/python`
+command is provided in the ``python-is-python2`` package (pointing to
+:file:`/usr/bin/python2`).  The :file:`/usr/bin/python-config` and
+:file:`/usr/bin/pydoc` commands are provided in the
+``python-dev-is-python2`` package.  These package are not installed by
+default for new installations, but only for upgrades from the Debian
+10 release (buster).  These packages should be removed after an
+upgrade.  These packages will not be part of the Debian 12 release
+(bookworm).
+
+The packages ``python-is-python3`` and ``python-dev-is-python3``
+provide the :file:`/usr/bin/python`, :file:`/usr/bin/python-config`
+and :file:`/usr/bin/pydoc` commands pointing to Python3.  These
+packages can be installed by developers and users to use the
+unversioned commands.  NOTE: Locally installed software not yet ported
+to Python3 is likely to break when installing these packages.
+
+The packages ``python-is-python3``, ``python-dev-is-python3``,
+``python-is-python2`` and ``python-dev-is-python2`` must not be used
+as build dependencies, dependencies, recommendations or suggestions.

I hope this makes it clear that installing python-is-python3 can cause problems,
and that it's an opt-in installation option, which is not enforced by any other
package dependencies.

Matthias

#982924#29
Date:
2021-03-02 09:43:04 UTC
From:
To:
I am appending the following two sections to the python policy chapter 2,
documenting what currently is in testing.  There are different opinions, no
perfect solutions, and if we disagree, we should delegate the final decision
whether to include or to not include the binary packages
python{,-dev}-is-python3 built from the what-is-python source to the CTTE.

Matthias

+Removal of the unversioned packages
+-----------------------------------
+
+Starting with the Debian 11 release (bullseye), the binary packages
+``python``, ``python-minimal``, ``python-dev``, ``python-dbg`` and
+``python-doc`` are removed.  No package in the archive must use any of
+these packages as build dependencies, dependencies, recommendations or
+suggestions.
+
+
+Unversioned python commands
+---------------------------
+
+For the Debian 11 release (bullseye), the :file:`/usr/bin/python`
+command is provided in the ``python-is-python2`` package (pointing to
+:file:`/usr/bin/python2`).  The :file:`/usr/bin/python-config` and
+:file:`/usr/bin/pydoc` commands are provided in the
+``python-dev-is-python2`` package.  These package are not installed by
+default for new installations, but only for upgrades from the Debian
+10 release (buster).  These packages should be removed after an
+upgrade.  These packages will not be part of the Debian 12 release
+(bookworm).
+
+The packages ``python-is-python3`` and ``python-dev-is-python3``
+provide the :file:`/usr/bin/python`, :file:`/usr/bin/python-config`
+and :file:`/usr/bin/pydoc` commands pointing to Python3.  These
+packages can be installed by developers and users to use the
+unversioned commands.  NOTE: Locally installed software not yet ported
+to Python3 is likely to break when installing these packages.
+
+The packages ``python-is-python3``, ``python-dev-is-python3``,
+``python-is-python2`` and ``python-dev-is-python2`` must not be used
+as build dependencies, dependencies, recommendations or suggestions.

#982924#34
Date:
2021-03-02 18:47:32 UTC
From:
To:
I sincerely hope that the organizations shipping Python 3 as "python"
will come to their senses in the near future and stop doing so, so
everyone will in fact be used to typing "python3".

That's all well and good, but I do not think the choice represented by
"python-is-python3" should be offered as an option.

The change I am asking for is the removal of this package from Debian,
and I think it is _especially_ important that this package not be
included in bullseye (as this will be the first release without Python
2, AIUI).
[...]

I like this except for the part that implies "python-is-python3" will
be an option.

zw