-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-9694: Fix misleading phrase "optional arguments" #23858
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
Doc/howto/argparse.rst
Outdated
@@ -468,7 +468,7 @@ verbosity argument (check the output of ``python --help``):: | |||
print(answer) | |||
|
|||
We have introduced another action, "count", | |||
to count the number of occurrences of a specific optional arguments: | |||
to count the number of occurrences of a specific options: |
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 old version has this issue, too: shouldn't this be singular "options", or maybe "occurrences of specific options" (omitting "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.
Yes, that makes sense.
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.
Sorry I'm leaving this as two reviews: I pressed the wrong button on the first one.
Two little nits, otherwise looks good.
@@ -0,0 +1 @@ | |||
Argparse help no longer use the confusing phrase, "optional arguments". |
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 think you should add: ', it now uses "options".'
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.
Will do.
This PR changed the "optional arguments" to "optional" in 3.10, breaking some tests. python/cpython#23858
This PR changed the "optional arguments" to "optional" in 3.10, breaking some tests. python/cpython#23858
Optional Arguments was renamed to Options in python 3.10 release [1] [1]: python/cpython#23858 Signed-off-by: Leonidas Spyropoulos <artafinde@gmail.com>
Optional Arguments was renamed to Options in python 3.10 release [1] [1]: python/cpython#23858 Signed-off-by: Leonidas Spyropoulos <artafinde@gmail.com>
In python/cpython#23858 the section header for option flags was changed from "optional arguments" to "options" with the rationale that they are not (necessarily) at all optional, while GNU coreutils calls them options. In fact, POSIX calls them options (-o) and option-arguments (-o val) and operands ("positional arguments") so it is indeed a mess, but argparse is not yet perfect. Still, fix the documentation generator for now so that it is compatible with python 3.10 as well. Fixes traceback on building the docs with: ``` [1/4] Generating gen_docs with a custom command FAILED: gen_docs.stamp /home/eschwartz/git/meson/docs/../tools/regenerate_docs.py --output-dir /home/eschwartz/git/meson/docs/builddir --dummy-output-file gen_docs.stamp Traceback (most recent call last): File "/home/eschwartz/git/meson/docs/../tools/regenerate_docs.py", line 160, in <module> regenerate_docs(output_dir=args.output_dir, File "/home/eschwartz/git/meson/docs/../tools/regenerate_docs.py", line 146, in regenerate_docs generate_hotdoc_includes(root_dir, output_dir) File "/home/eschwartz/git/meson/docs/../tools/regenerate_docs.py", line 113, in generate_hotdoc_includes cmd_data = get_commands_data(root_dir) File "/home/eschwartz/git/meson/docs/../tools/regenerate_docs.py", line 106, in get_commands_data cmd_data[cmd] = parse_cmd(cmd_output) File "/home/eschwartz/git/meson/docs/../tools/regenerate_docs.py", line 65, in parse_cmd assert arguments_start AssertionError ```
First, fix test_help(). A commit[1], which first appeared in Python 3.10, changes the output of the help feature of argparse. Options used to be in a section named "Optional arguments:", and they are now in a section named "Options:". Second, tox 4 changes the behaviour of tox, and {toxinidir}/requirements.txt is no longer installed automagically in the docs virtual environment. This causes autodoc to fail on some imports. We explicitely add {toxinidir}/requirements.txt to the list of dependencies to fix this issue. These issues should be fixed in separate patches, but since they both block the CI, they depend on each other. [1] python/cpython#23858 Change-Id: Ia7866390b31f469bdea95624325a13aaf45a496e Closes-Bug: #2002566
* Update python-glanceclient from branch 'master' to 6c95122777c8449056115292b492ec3e1e0d6e50 - Fix functional tests and docs generation First, fix test_help(). A commit[1], which first appeared in Python 3.10, changes the output of the help feature of argparse. Options used to be in a section named "Optional arguments:", and they are now in a section named "Options:". Second, tox 4 changes the behaviour of tox, and {toxinidir}/requirements.txt is no longer installed automagically in the docs virtual environment. This causes autodoc to fail on some imports. We explicitely add {toxinidir}/requirements.txt to the list of dependencies to fix this issue. These issues should be fixed in separate patches, but since they both block the CI, they depend on each other. [1] python/cpython#23858 Change-Id: Ia7866390b31f469bdea95624325a13aaf45a496e Closes-Bug: #2002566
The section heading used in argparse's formatted help output changed in 3.10¹, rendering --help equivalent to --help-all. This affected anyone with Nextstrain CLI installed on Python 3.10 or newer, including our standalone installation binaries. ¹ <python/cpython#23858> <https://bugs.python.org/issue9694>
The section heading used in argparse's formatted help output changed in 3.10¹, rendering --help equivalent to --help-all. This affected anyone with Nextstrain CLI installed on Python 3.10 or newer, including our standalone installation binaries. ¹ <python/cpython#23858> <https://bugs.python.org/issue9694>
The section heading used in argparse's formatted help output changed in 3.10¹, rendering --help equivalent to --help-all. This affected anyone with Nextstrain CLI installed on Python 3.10 or newer, including our standalone installation binaries. ¹ <python/cpython#23858> <https://bugs.python.org/issue9694>
https://bugs.python.org/issue9694
I still need to change the examples in the main docs and add an introductory sentence or two explaining the terminology. Will wait until further discussions are complete before making those edits.