[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Updated PEP 394 (python and python2 commands)



PEP 394 [1] saw an update in April 2018 [2], the diffs at [3].

The most important change from my point of view is

-* It is suggested that even distribution-specific packages follow the
-  ``python2``/``python3`` convention, even in code that is not intended to
+* It is strongly encouraged that distribution-specific packages use ``python2``
+  or ``python3`` rather than ``python``, even in code that is not intended to
   operate on other distributions.

I don't think there is enough time to replace all python shebangs to python2 in
time for the buster release, however there is no harm in starting this process
now.  But I'd like to get this done for buster+1, in the case we still need to
ship a Python2/2.7, so that buster+1 doesn't ship with a python command, but
maybe with a python2 command.

The first step is to create a set of python2* packages in python-defaults, with
contain all the python2* symlinks, and having the python* packages depend on
those python2 packages.  This change itself is a no-op and shouldn't affect
anything.

As a second step change the dh_python2 (in python-defaults), and dh-python to
generate dependencies on python2 instead of python, and replacing the shebang
from python to python2.

This should cover the majority of packages to replace dependencies on python
with dependencies on python2.  There are packages which don't check for python2,
so these probably need adjustments.  But again, the goal for buster+1 is to ship
as few Python2 dependent packages as possible, if any.

The third step for buster+1 would be to drop the set of python* packages from
python-defaults.

Both Debian 8 and Debian 9 already have the python2 symlink, so you could even
reuse binary packages in the older releases.  If needed, python-defaults could
be packported to Debian 9 using versioned provides, and to Debian 8 introducing
the same set of python2 packages.

Matthias

[1] https://www.python.org/dev/peps/pep-0394/
[2] https://github.com/python/peps/pull/630
[3] https://github.com/python/peps/pull/630.diff


Reply to: