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-108826: Document dis module CLI and rename _test function to main #108827

Merged
merged 16 commits into from
Oct 10, 2023

Conversation

chgnrdv
Copy link
Contributor

@chgnrdv chgnrdv commented Sep 2, 2023

Fixes #108826.
dis module has CLI, but it is not documented and declared as 'test program' in source code. This patch mentions CLI in documentation and renames the function where it is implemented.


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

dis module has CLI, but it is not documented and declared as 'test program' in source code. This patch mentions CLI in documentation and renames the function where it is implemented.
@chgnrdv chgnrdv changed the title Document dis module CLI and rename '_test' function to 'main' gh-108826: Document dis module CLI and rename '_test' function to 'main' Sep 2, 2023
@chgnrdv chgnrdv changed the title gh-108826: Document dis module CLI and rename '_test' function to 'main' gh-108826: Document dis module CLI and rename _test function to main Sep 2, 2023
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

Is it the right place for that section? I used to see the "Command-line interface" section at the end of the file, only followed by examples and howtos. But there are documents which do not follow this "custom", so I no longer sure.

@@ -0,0 +1 @@
:mod:`dis` module command line interface is now mentioned in documentation.
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure whether the Library section or the Documentation section are more suitable for this entry.

Copy link
Contributor Author

@chgnrdv chgnrdv Sep 3, 2023

Choose a reason for hiding this comment

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

Different docs mention CLI in different sections of file. I was looking at trace and pdb docs when making these changes.
dis module has a preamble with brief introduction to its functionality, and I found the place below it suitable for CLI overview.

Yes, "Documentation" section seems more suitable for news entry, even if I made changes in library code. I'll submit a new one.

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 for this, a couple of little suggestions :)

Doc/library/dis.rst Outdated Show resolved Hide resolved
chgnrdv and others added 2 commits September 3, 2023 21:22
…8826.KG7abS.rst

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
@hugovk
Copy link
Member

hugovk commented Oct 10, 2023

Please could you also update the anchor in https://docs.python.org/3.13/library/cmdline.html to link to the new CLI section of the dis page?

@chgnrdv
Copy link
Contributor Author

chgnrdv commented Oct 10, 2023

#110249 added --show-caches command line option. I think it's OK if I will document it in this PR.

@hugovk
Copy link
Member

hugovk commented Oct 10, 2023

Well spotted, thanks for adding it!

We'll have to make sure we don't include it in backports to 3.11 and 3.12. But we'll need a manual backport anyway, because we don't yet have Doc/library/cmdline.rst in those branches, and I also expect there will be some CLIs in 3.13 that don't belong in the other two.

@hugovk hugovk merged commit 0d805b9 into python:main Oct 10, 2023
@hugovk hugovk added the needs backport to 3.12 bug and security fixes label Oct 11, 2023
@miss-islington
Copy link
Contributor

Thanks @chgnrdv for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry, @chgnrdv and @hugovk, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 0d805b998ded854840f029b7f0c9a02eb3efa251 3.12

hugovk pushed a commit to hugovk/cpython that referenced this pull request Oct 11, 2023
…n to `main` (python#108827)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 0d805b9)
@bedevere-app
Copy link

bedevere-app bot commented Oct 11, 2023

GH-110681 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 Oct 11, 2023
@hugovk hugovk added the needs backport to 3.11 only security fixes label Oct 11, 2023
@miss-islington
Copy link
Contributor

Thanks @chgnrdv for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry, @chgnrdv and @hugovk, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 0d805b998ded854840f029b7f0c9a02eb3efa251 3.11

hugovk pushed a commit to hugovk/cpython that referenced this pull request Oct 11, 2023
…n to `main` (python#108827)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 0d805b9)
@bedevere-app
Copy link

bedevere-app bot commented Oct 11, 2023

GH-110689 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Oct 11, 2023
@chgnrdv
Copy link
Contributor Author

chgnrdv commented Oct 11, 2023

@hugovk, thanks for review and backport!

@hugovk
Copy link
Member

hugovk commented Oct 11, 2023

Thanks for the PR!

hugovk added a commit that referenced this pull request Oct 11, 2023
…on to `main` (#108827) (#110681)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
hugovk added a commit that referenced this pull request Oct 11, 2023
…on to `main` (#108827) (#110689)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…n to `main` (python#108827)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dis command line interface exists, but not documented
5 participants