-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
PEP 394: Allow for more flexibility in handling /usr/bin/python #989
Conversation
Co-Authored-By: Petr Viktorin <encukou@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proposed change looks good to me in general, some minor wording suggestions and one more substantial adjustment inline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As co-author, I agree with the change, but I don't think I should be the reviewer :)
You should probably get the Steering Council to appoint a BDFL-Delegate who can approve it. Last time we had MvL as PEP Czar but he's not around, and BDFL-Delegate is the closest thing. I'm not touching this myself. :-) |
Thanks for the advice! Just before I read your comment, I asked for, essentially, just that :) |
Since Nick, Petr, and myself are all authors, who would we get to be a BD? |
The SC could deliberate it for a bit during our next meeting.
|
Definitely an SC level discussion (and it probably makes sense for us to just review the PR changes directly). Some potentially useful context for that discussion:
|
To complete the list of Fedora changes posted by Nick: My idea is to also include a Fedora 31 change that moves |
@hroncok Ah, nice! I think that would tie in better with my proposed guidance then, as once you've implemented that change, then |
About setting
I still think that is good advice. Setting Keep in mind this PEP's advice will be applied to new code. New code generally won't be deployed on systems without a |
I don't think always using "/usr/bin/python3" is generically good advice for new code, since I think requiring the So I think it's entirely reasonable for publishers to continue to use "/usr/bin/env python" as their default approach, and tell anyone with a system where that doesn't work to either:
While specifying |
Is that your personal view, or can the SC agree on that? Last time I suggested this, it was explicitly shot down (#630 (comment)). This PR tries to reflect consensus from the mailing list (as much as possible while giving sound suggestions). This is really frustrating – it feels like no one has the authoriity to decide, but too many people have a right to veto. And meanwhile, the status quo is inadequate; the PEP needs to be changed now if it's to keep any hope of relevance. This issue is good burnout material. The explicit
Would it be OK to just add a disclaimer that while while the |
(I'm currently commenting from a personal point of view, but I expect the merge decision on this PR will be made by SC consensus and/or vote) The key outcome I want to avoid is anyone claiming "PEP 394 says that using
|
This update reverts back to the version agnostic "python" invocation as the default recommendation for developers, and rewords the rest of the PEP accordingly. In particular, it makes it clear that publishers are free to adopt the attitude of "we assume you are using a virtual environment", while at the same time granting the distributors the freedom they need to make software with the expectation work correctly when run directly against a system Python installation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me now. The big change from the initial PR is to keep the "/usr/bin/env python" recommendation as the default, but emphasise that this may require the use of virtual environments to provide cross platform consistency.
It then frames the additional freedom for Python distributors in terms of making their system Python installations behave more like a Python virtual environment.
@gvanrossum @brettcannon @gvanrossum @willingc I think this is ready for broader steering council review now. General scope of change:
|
Ping @warsaw. This is just waiting on the question of whether or not you're happy for the stance the PEP takes to be "Unless they specifically know otherwise, script publishers only need to worry about end users that are either going to be using a virtual environment, or else are going to be running a Python package installer". I think that's the only reasonable stance we can take - at this point, shebang lines are too inconsistent across different platforms for us to do anything else. If you can narrow your focus to a specific subset of target platforms, then there are alternatives available, but that's guidance that documentation for those specific environments should be providing, not our generic upstream suggestions. |
ping @warsaw. Care to reply? Anything I can do to make your job easier? |
I'm going to put this on the steering council meeting agenda until Barry attends and notices this PR. 😄 |
We have a deadline coming up next Tuesday for Fedora 31 (scheduled to live 2019-10 to 2020-11). I'd like to let users have a working Since this PR's recommendations for distros are, as far as I know, agreed on, I'm tempted to switch (edit: corrected Fedora deadline date) |
@encukou Aye, that makes sense, as the only thing holding this up are the remaining concerns regarding We also have a steering council meeting tomorrow morning, so I'll try to get it resolved then - it's the classic problem of "Most software publishers are not system integrators, so what's right for system integrators shouldn't affect the default recommendations" :) |
Huh, since I deleted/edited the offending line I can't find a way to get back to the "single comment" thread that @warsaw started on the shebang line recommendation. (Found it via the commit history on the PR) Anyway, 4b20f8c changes the mention of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've read the entire proposal again and from the Fedora POV I'm in favor!
The GitHub interface had some whitespace problem and I've broke the RST syntax, Sorry about that, should be good now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ncoghlan Thanks very much for the changes regarding /usr/bin/env
. With the focus on venvs, I think the recommendations in the PEP are great now. I do have a few suggestions for improvements to the text, but I think these are mostly minor.
pep-0394.txt
Outdated
discrepancies across platforms and installation methods: | ||
|
||
* Older Linux distributions will provide a ``python`` command that | ||
refers to Python 2. Most of these distros do *not* provide a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second sentence feels a little too imprecise. What exactly is an "older Linux distribution" and how many of them count as "most"? Perhaps:
Older Linux distributions will provide a
python
command that refers to Python 2, and will likely not provide apython2
command
pep-0394.txt
Outdated
is released. | ||
* Even as the Python 2 interpreter becomes less common, it remains reasonable | ||
for scripts to continue to use the ``python3`` convention, rather than just | ||
``python``. In the event of a future Python 4.0 release, distributors may |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest leaving out any mention of Python 4. 1) it can create FUD; 2) it's entirely vaporware; 3) we don't even know whether there will be a Python 4 or what it will look like. We can always add a Python 4 recommendation when the time comes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Good catch @warsaw
- Clarify wording on "older" Linux distros - Remove discussion aroung Python 4.0
@ncoghlan I pushed a change addressing the issues above. Do you have any comments on them? |
LGTM! @warsaw, over to you for the final review & merge :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks everyone, for working together on this important update.
Thank you! |
Co-Authored-By: @encukou