-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[WIP] PEP 394: Allow not installing unversioned "python" command #893
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
Conversation
The intended future for the ``python`` command is: > ``python`` doesn't exist and one always has to specify ``python2`` > or ``python3``. ( – Guido, python#630 (comment) ) There are three conflicting ideas around the ``python`` command, longer-term: 1. The ``python`` command should continue to refer to Python 2 (if Python 2 is available). 2. ``python`` is a correct shebang for py2/py3 source-compatible scripts. 3. Python 2 should *not* be available (by default / after 2010). One of these has to give. It seems that (2) is the easiest to shed, so this proposal does just that. * Make ``python3`` the preferred shebang for py2/py3 compatible scripts, as that's the only shebang that'll work on py2-less systems. (An exception is made for scripts targetting the *system* Python on e.g. macOS/RHEL.) * Make the unversioned ``python`` command optional (along with ``idle``, ``pydoc``, and ``python-config``). Distributions now do not need to install it by default, even if Python 2 is installed. (But they should make it installable explicitly, as long as they ship Python 2.) This should introduce more people to systems without the "legacy" ``python`` command, encourage the use of explicit ``python2``/``python3``, and ease switching to systems that don't have Python 2 at all. * Clarify that distributions *should not* make unversioned ``python`` configurable. (That might work for carefully managed systems, but the ecosystem should converge on ``python3``, not "your ``python`` needs to be set properly".) * Remove mentions of choosing to link ``python`` to ``python3`` in the future, as we don't expect to start recommending that. * Use the term **"unversioned"** ``python`` when contrasting it with ``python3``/``python2``. I found that this makes the message much clearer.
Note: I'm responsible for how this is handled in RHEL 8 beta, where |
It sounds to me like you're suggesting that py2/py3 compatible scripts be basically indistinguishable from Python 3 scripts, which in turn implies that a Python 3.x needs to be installed, even though the script could easily run on Py2. Is that your intention? |
@Rosuav: Yes. In my opinion, that's the least bad option.
|
Cool. I'm absolutely okay with it too, but then, I'm one of those early adopters who runs everything on alpha releases, so my opinion carries little weight :) |
Related thread on python-dev: https://mail.python.org/pipermail/python-dev/2019-February/156272.html |
So, I'm pretty new to Python, but: I know a lot of distros kept |
@encukou Should this be closed in favour of #989? @FlyingWombat The PEP is slowly being moved in that direction, but back when the PEP was first written (2011, just after Python 3.2 had been released), distros doing that was a genuinely bad idea, so we wanted to actively discourage them from doing it. The situation has changed a lot in the past eight years though, so the guidance needs to change accordingly. |
The intended future for the
python
command is:( – Guido, #630 (comment) )
There are three conflicting ideas around the
python
command, longer-term:python
command should continue to refer to Python 2 (if Python 2 is available).python
is a correct shebang for py2/py3 source-compatible scripts.One of these has to give.
It seems that (2) is the easiest to shed, so this proposal does just that.
Make
python3
the preferred shebang for py2/py3 compatible scripts, as that's the only shebang that'll work on py2-less systems. (An exception is made for scripts targetting the system Python on e.g. macOS/RHEL.)Make the unversioned
python
command optional (along withidle
,pydoc
, andpython-config
).Distributions now do not need to install it by default, even if Python 2 is installed. (But they should make it installable explicitly, as long as they ship Python 2.)
This should introduce more people to systems without the "legacy"
python
command, encourage the use of explicitpython2
/python3
, and ease switching to systems that don't have Python 2 at all.Clarify that distributions should not make unversioned
python
configurable. (That might work for carefully managed systems, but the ecosystem should converge onpython3
, not "yourpython
needs to be set properly".)Remove mentions of choosing to link
python
topython3
in the future, as we don't expect to start recommending that.Use the term "unversioned"
python
when contrasting it withpython3
/python2
.I found that this makes the message much clearer.