Skip to content

bpo-26510: Add versionchanged for required arg of add_subparsers #16588

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

Merged
merged 4 commits into from
Oct 7, 2019
Merged

bpo-26510: Add versionchanged for required arg of add_subparsers #16588

merged 4 commits into from
Oct 7, 2019

Conversation

adamjstewart
Copy link
Contributor

@adamjstewart adamjstewart commented Oct 4, 2019

The required argument to argparse.add_subparsers was added in #3027. This PR specifies the earliest version of Python where it is available.

https://bugs.python.org/issue26510

Automerge-Triggered-By: @merwok

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@adamjstewart

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

Copy link
Member

@merwok merwok left a comment

Choose a reason for hiding this comment

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

Thanks for adding this piece that was missed in the original PR!

Because this part of the docs is super long, could you also add something like (added in 3.7) on line 1639? Would help readers get the version info right when they read about required.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@merwok merwok changed the title Add versionadded for required arg of add_subparsers bpo-26510: Add versionadded for required arg of add_subparsers Oct 4, 2019
@merwok merwok self-assigned this Oct 4, 2019
@merwok
Copy link
Member

merwok commented Oct 4, 2019

The what’s new note was removed by #7609 after the default value was changed in #6919, but now I realize that this was too much: subparsers are not required, but there is a new param! Would you @adamjstewart mind re-adding a note in what’s new for 3.7?

(also please say if you need any help with the CLA)

@adamjstewart
Copy link
Contributor Author

CLA has been signed 😄

@merwok
Copy link
Member

merwok commented Oct 4, 2019

Docs are a little vague indeed! From https://devguide.python.org/documenting/#paragraph-level-markup

versionadded
This directive documents the version of Python which added the described feature, or a part of it, to the library

But:

versionchanged
Similar to versionadded, but describes when and what changed in the named feature in some way (new parameters, changed side effects, platform support, etc.)

new parameters seems pretty clear here 🙂

I wouldn’t change FileType or other files in this PR.

@merwok
Copy link
Member

merwok commented Oct 4, 2019

A note about the review: these are all quite minor changes! I could do them myself by adding commits to the branch directly, but in general I prefer to have a discussion and let the contributor own their PR, unless they are not interested in or don’t have for tiny details, in which case I’m happy to polish and merge 🙂

@adamjstewart adamjstewart changed the title bpo-26510: Add versionadded for required arg of add_subparsers bpo-26510: Add versionchanged for required arg of add_subparsers Oct 4, 2019
@miss-islington miss-islington merged commit 9e71917 into python:master Oct 7, 2019
@miss-islington
Copy link
Contributor

Thanks @adamjstewart for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 7, 2019
…honGH-16588)

The `required` argument to `argparse.add_subparsers` was added in pythonGH-3027. This PR specifies the earliest version of Python where it is available.

https://bugs.python.org/issue26510

Automerge-Triggered-By: @merwok
(cherry picked from commit 9e71917)

Co-authored-by: Adam J. Stewart <[email protected]>
@bedevere-bot
Copy link

GH-16608 is a backport of this pull request to the 3.8 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 7, 2019
…honGH-16588)

The `required` argument to `argparse.add_subparsers` was added in pythonGH-3027. This PR specifies the earliest version of Python where it is available.

https://bugs.python.org/issue26510

Automerge-Triggered-By: @merwok
(cherry picked from commit 9e71917)

Co-authored-by: Adam J. Stewart <[email protected]>
@bedevere-bot
Copy link

GH-16609 is a backport of this pull request to the 3.7 branch.

miss-islington added a commit that referenced this pull request Oct 7, 2019
…16588)

The `required` argument to `argparse.add_subparsers` was added in GH-3027. This PR specifies the earliest version of Python where it is available.

https://bugs.python.org/issue26510

Automerge-Triggered-By: @merwok
(cherry picked from commit 9e71917)

Co-authored-by: Adam J. Stewart <[email protected]>
miss-islington added a commit that referenced this pull request Oct 7, 2019
…16588)

The `required` argument to `argparse.add_subparsers` was added in GH-3027. This PR specifies the earliest version of Python where it is available.

https://bugs.python.org/issue26510

Automerge-Triggered-By: @merwok
(cherry picked from commit 9e71917)

Co-authored-by: Adam J. Stewart <[email protected]>
@@ -2401,6 +2401,10 @@ Changes in the Python API
instead of a :class:`bytes` instance.
(Contributed by Victor Stinner in :issue:`21071`.)

* :mod:`argparse` subparsers can now be made mandatory by passing ``required=True``
to :meth:`ArgumentParser.add_subparsers() <argparse.ArgumentParser.add_subparsers>`.
Copy link
Member

@merwok merwok Oct 7, 2019

Choose a reason for hiding this comment

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

Small thing I didn’t notice before merge: in func/meth/etc roles, we don’t include the parentheses. Sphinx has a setting to add them or not automatically to all roles (I think it’s smart enough to not add them if already present, but not 100% sure, will check when the docs rebuild is published).

(I personnally don’t like to have them, especially given Python’s clear difference of referencing a function vs. calling it, but many programmers are used to writing things like the whatever() function probably to make it less ambiguous in plain text contexts like email, so Python’s doc is set up to have them 🙂)

I didn’t pay attention to the fact that the section here (Changes in the Python API) was part of Porting to Python 3.7 (we really need docs previews for PRs!), which made sense in the original PR (changed argparse behaviour) but less so now. I think it would have been better in Improved Modulesargparse https://docs.python.org/3.9/whatsnew/3.7.html#argparse

ned-deily pushed a commit to ned-deily/cpython that referenced this pull request Oct 14, 2019
…honGH-16588)

The `required` argument to `argparse.add_subparsers` was added in pythonGH-3027. This PR specifies the earliest version of Python where it is available.

https://bugs.python.org/issue26510

Automerge-Triggered-By: @merwok
(cherry picked from commit 9e71917)

Co-authored-by: Adam J. Stewart <[email protected]>
jacobneiltaylor pushed a commit to jacobneiltaylor/cpython that referenced this pull request Dec 5, 2019
…thonGH-16588)

The `required` argument to `argparse.add_subparsers` was added in python#3027. This PR specifies the earliest version of Python where it is available.


https://bugs.python.org/issue26510



Automerge-Triggered-By: @merwok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants