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-122873: Allow "python3 -m json" to work #122884

Merged
merged 24 commits into from
Aug 13, 2024
Merged

Conversation

treyhunner
Copy link
Member

@treyhunner treyhunner commented Aug 10, 2024

Allow python3 -m json to work in addition to python3 -m json.tool and update documentation to use python3 -m json instead of python3 -m json.tool.

Issue: #122873


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

Doc/library/json.rst Outdated Show resolved Hide resolved
Doc/library/json.rst Outdated Show resolved Hide resolved
Lib/json/__main__.py Outdated Show resolved Hide resolved
Lib/json/__main__.py Outdated Show resolved Hide resolved
@treyhunner
Copy link
Member Author

Thank you @AA-Turner for reviewing. Let me know if you'd like any variation of the suggestions I commented on made.

I just used blurb to add a NEWS.d entry as well.
I wrote the same copy as in "What's New".
I'm fuzzy on the use of "What's New" and NEWS.d, so please correct me if either should be updated or removed.

treyhunner and others added 3 commits August 10, 2024 14:38
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@AA-Turner
Copy link
Member

I just used blurb to add a NEWS.d entry as well.
I wrote the same copy as in "What's New".
I'm fuzzy on the use of "What's New" and NEWS.d, so please correct me if either should be updated or removed.

NEWS.d goes into the full changelog, whatsnes is for bigger or user visible changes. Using the same text for both is fine, you've done the right thing here.

A

@hugovk
Copy link
Member

hugovk commented Aug 10, 2024

I'm fuzzy on the use of "What's New" and NEWS.d, so please correct me if either should be updated or removed.

We do want both.

"What's New" is the main set release notes. This'll be the main document people read about the release (~30k views/month):

https://docs.python.org/3.14/whatsnew/3.14.html#json

NEWS.d files eventually becomes part of the giant changelog, not read so often (~4k views/month), but can be useful to filter via the search box:

https://docs.python.org/3.14/whatsnew/changelog.html

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.

Let's also change ./Doc/library/cmdline.rst:

-* :ref:`json.tool <json-commandline>`
+* :ref:`json <json-commandline>`

https://cpython-previews--122884.org.readthedocs.build/en/122884/library/cmdline.html

For the What's New and NEWS.d, shall we also mention python -m json explicitly, and include a link to the json-commandline reference?

And there's some json.tool -> json we can update in the Lib/json/__init__.py docstring.

Copy link
Contributor

@ncoghlan ncoghlan left a comment

Choose a reason for hiding this comment

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

PR mostly looks good to me, just some comments inline around keeping a minimal level of json.tool documentation (since the submodule still exists and isn't going anywhere).

Doc/library/json.rst Outdated Show resolved Hide resolved
Doc/library/json.rst Show resolved Hide resolved
Doc/library/json.rst Outdated Show resolved Hide resolved
Doc/whatsnew/3.14.rst Outdated Show resolved Hide resolved
Lib/json/tool.py Show resolved Hide resolved
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
treyhunner and others added 3 commits August 12, 2024 07:01
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
@hugovk
Copy link
Member

hugovk commented Aug 13, 2024

I think this is almost ready!

Please also change Doc/library/cmdline.rst:

-* :ref:`json.tool <json-commandline>`
+* :ref:`json <json-commandline>`

https://cpython-previews--122884.org.readthedocs.build/en/122884/library/cmdline.html

@treyhunner
Copy link
Member Author

I think this is almost ready!

Please also change Doc/library/cmdline.rst:

-* :ref:`json.tool <json-commandline>`
+* :ref:`json <json-commandline>`

https://cpython-previews--122884.org.readthedocs.build/en/122884/library/cmdline.html

Just updated.

I had no idea this page existed. I wish I had known about it when writing my post on Python's CLIs! 😆

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.

Thank you!

@AA-Turner AA-Turner merged commit 906b796 into python:main Aug 13, 2024
36 checks passed
@AA-Turner
Copy link
Member

Thanks @treyhunner!

A

@treyhunner treyhunner deleted the json-script2 branch August 13, 2024 16:10
blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.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.

4 participants