Skip to content
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

make install should symlink bin/python to bin/python3 #102358

Open
carljm opened this issue Mar 1, 2023 · 5 comments
Open

make install should symlink bin/python to bin/python3 #102358

carljm opened this issue Mar 1, 2023 · 5 comments
Labels
build The build process and cross-build topic-installation type-feature A feature request or enhancement

Comments

@carljm
Copy link
Member

carljm commented Mar 1, 2023

Feature or enhancement

When you build and make install CPython from source, currently the installed bin/ directory contains python3 (symlinked to python3.XX), but it does not contain python. This issue proposes that it should also contain a python symlink.

Pitch

Windows installs (from python.org) do not contain a python3 executable, so there is currently no form that documentation examples can take that will work for all platforms reliably.

#99185 has more discussion of python vs python3 from the Windows perspective.

Venv bin/ dir does contain a python -> python3 symlink.

PEP 394 recommends python over python3 as the canonical way to invoke Python.

The conclusion in #98761 was that python -m ... should be preferred over python3 -m ... in documentation examples.

Of course, most users will not be building and make install ing their own Python. But if our recommendation to redistributors is to provide python -> python3, would it not be best to model that ourselves in make install? Is there any downside?

@carljm
Copy link
Member Author

carljm commented Mar 1, 2023

I guess the downside could be that anyone who is installing a Python 2 and a Python 3 to the same prefix, up til now, would have had python -> python2, and after this change they'd have a potential name collision. So the question is, are we enough beyond caring about Python 2 at this point that this is no longer a compelling reason?

@terryjreedy
Copy link
Member

I agree with the desire for a cross-platform startup command. However, macOS 10 (Catalina) still has 'python' linked to python2. Startup message says that 'future' versions of macOS would not have python2, so use 'python3'. Should not scripts that try to start python2 with 'python' fail rather than silently run python3. I believe that we have considered the presence and meaning of a 'python' link to be a matter for each distribution. Not sure we are ready to change this.

@carljm
Copy link
Member Author

carljm commented Mar 2, 2023

I think the current (revised) PEP 394 is clear that we are beyond just "letting it be a matter for each distribution" to decide -- we are now already making a clear recommendation of what distributions should do. (They should make python be Python 3.)

But the fact that Catalina didn't get there yet is meaningful. It seems OK to hold off on this change until there are no (relevant) platforms that still have python as Python 2 by default. (Definition of "relevant" left as an exercise for the reader.)

@carljm
Copy link
Member Author

carljm commented Mar 2, 2023

we are now already making a clear recommendation of what distributions should do

Actually, after a re-read of the full current state of PEP 394, it isn't at all clear that we've made that shift yet. (Though it seems like we might be feeling ready to do so soon?)

@itamaro
Copy link
Contributor

itamaro commented Aug 20, 2023

It is unclear to me whether this issue is "awaiting a PR" (that adds a python symlink to make install), or pending further discussion about whether such a symlink should be added.

While it seems that the "python" over "python3" has won the docs discussion, it is also clear that neither is universally consistent across platforms. I am unsure if universal consistency has any relevance to the "to symlink or not to symlink" question.

@iritkatriel iritkatriel added build The build process and cross-build topic-installation labels Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build topic-installation type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants