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

gh-90300: Improve the Python CLI help output #115853

Merged
merged 13 commits into from
Mar 19, 2024

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Feb 23, 2024

  • document equivalent command-line options for all environment variables
  • document equivalent environment variables for all command-line options
  • reduce the size of variable and option descriptions to minimum
  • sort the lists of -X options and variables that have equivalent command-line options
  • remove the ending period in single-sentence descriptions

📚 Documentation preview 📚: https://cpython-previews--115853.org.readthedocs.build/

* document equivalent command-line options for all environment variables
* document equivalent environment variables for all command-line options
* reduce the size of variable and option descriptions to minimum
* sort the lists of -X options and variables that have equivalent
  command-line options
* remove the ending period in single-sentence descriptions
@serhiy-storchaka
Copy link
Member Author

The CLI help should be short. It is a list of options and environment variables with short descriptions to have some idea what they are about. Ideally, every option description should be a single line. If you want to learn details, you should read the documentation. The CLI help is just to remind you exact names and format of some options and environment variables.

@merwok
Copy link
Member

merwok commented Feb 23, 2024

I’m not sure if I agree with that, or if it’s the consensus within python-dev.
Could you post your message to the issue at least, or even discuss?

@serhiy-storchaka
Copy link
Member Author

What can be done so that this PR does not hang for another 2 years like #93415? It is painful and errorprone to resolve merge conflicts after adding new options and environment variables.

@merwok
Copy link
Member

merwok commented Mar 13, 2024

@erlend-aasland, @AlexWaygood and @hugovk agree with you on the ticket.

To me this needed a little discussion – I don’t think that there is a current agreement that help should be more concise than (relatively) comprehensive. But this is only an interpreter option, not the public API, so it would be fine to follow EAFP and go ahead! And it’s true that people probably use the online docs more than the command-line, and that we have help texts duplicated in three places – one removed with this change. 🚀

@erlend-aasland
Copy link
Contributor

There's always the possibility of opening a topic on Discourse, so we can have a broader discussion. I think I want to read up some more on the CLI guide Hugo linked to in the issue, before I decide.

@ericsnowcurrently
Copy link
Member

FTR, this is a follow-up to gh-93415.

@serhiy-storchaka
Copy link
Member Author

Opened a topic: https://discuss.python.org/t/and-again-about-the-python-cli-help/48401.

@hugovk
Copy link
Member

hugovk commented Mar 13, 2024

It would be easier to review if the bullet points were in split into separate (followup) PRs. For example:

  • sort the lists of -X options and variables that have equivalent command-line options
  • remove the ending period in single-sentence descriptions

I think I could review and approve those as a single PR immediately, and it'd make followups smaller and easier (and quicker 🤞) to review.

@serhiy-storchaka
Copy link
Member Author

The part of the problem is that not for all options and variables the equivalent is currently specified, and that there are two lists for environment variables. So the change may require adding references to options and variables (which may increase the size of the description, and may not fit the style of the verbose description) and moving variables from one list to other. Is it okay?

@serhiy-storchaka
Copy link
Member Author

See #116739 for a simple step.

@serhiy-storchaka
Copy link
Member Author

Next step: #116756.

@serhiy-storchaka
Copy link
Member Author

Next step: #116765.

Python/initconfig.c Outdated Show resolved Hide resolved
Python/initconfig.c Outdated Show resolved Hide resolved
Python/initconfig.c Outdated Show resolved Hide resolved
Python/initconfig.c Outdated Show resolved Hide resolved
Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, much easier to review now :)

Looks good, a few suggestions.

Python/initconfig.c Outdated Show resolved Hide resolved
Python/initconfig.c Outdated Show resolved Hide resolved
Python/initconfig.c Outdated Show resolved Hide resolved
Python/initconfig.c Outdated Show resolved Hide resolved
Python/initconfig.c Outdated Show resolved Hide resolved
Python/initconfig.c Outdated Show resolved Hide resolved
Python/initconfig.c Outdated Show resolved Hide resolved
Python/initconfig.c Outdated Show resolved Hide resolved
Python/initconfig.c Outdated Show resolved Hide resolved
Python/initconfig.c Outdated Show resolved Hide resolved
serhiy-storchaka and others added 2 commits March 16, 2024 15:09
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@serhiy-storchaka serhiy-storchaka merged commit b85572c into python:main Mar 19, 2024
35 of 36 checks passed
@miss-islington-app
Copy link

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@serhiy-storchaka serhiy-storchaka deleted the python-cli-help branch March 19, 2024 17:26
@miss-islington-app
Copy link

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker b85572c47dc7a8c65fc366a87a3660fc7a3ed244 3.12

@miss-islington-app
Copy link

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker b85572c47dc7a8c65fc366a87a3660fc7a3ed244 3.11

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Mar 19, 2024
…15853)

* document equivalent command-line options for all environment variables
* document equivalent environment variables for all command-line options
* reduce the size of variable and option descriptions to minimum
* remove the ending period in single-sentence descriptions

(cherry picked from commit b85572c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented Mar 19, 2024

GH-117022 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Mar 19, 2024
serhiy-storchaka added a commit that referenced this pull request Mar 19, 2024
…17022)

* document equivalent command-line options for all environment variables
* document equivalent environment variables for all command-line options
* reduce the size of variable and option descriptions to minimum
* remove the ending period in single-sentence descriptions

(cherry picked from commit b85572c)

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Mar 19, 2024
…honGH-115853) (pythonGH-117022)

* document equivalent command-line options for all environment variables
* document equivalent environment variables for all command-line options
* reduce the size of variable and option descriptions to minimum
* remove the ending period in single-sentence descriptions

(cherry picked from commit b85572c)

(cherry picked from commit 4be9fa8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
serhiy-storchaka added a commit that referenced this pull request Mar 19, 2024
…17022) (GH-117034)

* document equivalent command-line options for all environment variables
* document equivalent environment variables for all command-line options
* reduce the size of variable and option descriptions to minimum
* remove the ending period in single-sentence descriptions

(cherry picked from commit b85572c)

(cherry picked from commit 4be9fa8)

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
vstinner pushed a commit to vstinner/cpython that referenced this pull request Mar 20, 2024
* document equivalent command-line options for all environment variables
* document equivalent environment variables for all command-line options
* reduce the size of variable and option descriptions to minimum
* remove the ending period in single-sentence descriptions

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 25, 2024
* document equivalent command-line options for all environment variables
* document equivalent environment variables for all command-line options
* reduce the size of variable and option descriptions to minimum
* remove the ending period in single-sentence descriptions

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
* document equivalent command-line options for all environment variables
* document equivalent environment variables for all command-line options
* reduce the size of variable and option descriptions to minimum
* remove the ending period in single-sentence descriptions

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@serhiy-storchaka serhiy-storchaka removed the needs backport to 3.11 only security fixes label Sep 29, 2024
@serhiy-storchaka serhiy-storchaka removed their assignment Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants