Skip to content

gh-101100: Fix Sphinx warnings from removed ~! references - #113629

Merged
hugovk merged 2 commits into
python:mainfrom
hugovk:docs-fix-sphinx-warnings-squiggle-bang
Jan 2, 2024
Merged

hugovk merged 2 commits into
python:mainfrom
hugovk:docs-fix-sphinx-warnings-squiggle-bang

Conversation

@hugovk

@hugovk hugovk commented Jan 1, 2024 •

Copy link
Copy Markdown
Member

Fix 23 warnings for things like :meth:`~!unittest.TestProgram.usageExit` - the tilde says to render it like usageExit and the exclamation mark says not to look up the reference.

But after deprecations have been removed, Sphinx nevertheless issues a warning. So instead let's switch to :meth:`!usageExit` to show the short version and not look it up. This silences the warning.

Doc/whatsnew/3.11.rst:1863: WARNING: py:meth reference target not found: !unittest.TestProgram.usageExit
Doc/whatsnew/3.3.rst:1055: WARNING: py:func reference target not found: !crypt.mksalt
Doc/whatsnew/3.4.rst:1531: WARNING: py:meth reference target not found: !sunau.getparams
Doc/whatsnew/3.4.rst:1543: WARNING: py:meth reference target not found: !sunau.AU_write.writeframes
Doc/whatsnew/3.4.rst:1543: WARNING: py:meth reference target not found: !sunau.AU_write.writeframesraw
Doc/whatsnew/3.4.rst:608: WARNING: py:meth reference target not found: !aifc.aifc.getparams
Doc/whatsnew/3.4.rst:611: WARNING: py:meth reference target not found: !aifc.aifc.close
Doc/whatsnew/3.4.rst:616: WARNING: py:meth reference target not found: !aifc.aifc.writeframes
Doc/whatsnew/3.4.rst:616: WARNING: py:meth reference target not found: !aifc.aifc.writeframesraw
Doc/whatsnew/3.4.rst:635: WARNING: py:func reference target not found: !audioop.byteswap
Doc/whatsnew/3.5.rst:1255: WARNING: py:func reference target not found: !imghdr.what
Doc/whatsnew/3.7.rst:2006: WARNING: py:meth reference target not found: !importlib.abc.MetaPathFinder.find_module
Doc/whatsnew/3.7.rst:2006: WARNING: py:meth reference target not found: !importlib.abc.PathEntryFinder.find_loader
Doc/whatsnew/3.7.rst:854: WARNING: py:func reference target not found: !crypt.mksalt
Doc/whatsnew/3.9.rst:588: WARNING: py:class reference target not found: !nntplib.NNTP
Doc/whatsnew/3.9.rst:588: WARNING: py:class reference target not found: !nntplib.NNTP_SSL
build/NEWS:10243: WARNING: py:meth reference target not found: !unittest.TestProgram.usageExit
build/NEWS:14046: WARNING: py:func reference target not found: !unittest.findTestCases
build/NEWS:14047: WARNING: py:func reference target not found: !unittest.makeSuite
build/NEWS:14048: WARNING: py:func reference target not found: !unittest.getTestCaseNames
build/NEWS:20562: WARNING: py:class reference target not found: !nntplib.NNTP
build/NEWS:20562: WARNING: py:class reference target not found: !nntplib.NNTP_SSL
build/NEWS:20578: WARNING: py:class reference target not found: !nntplib.NNTP

And for future removals, instead of doing:

-:meth:`~unittest.TestProgram.usageExit`
+:meth:`~!unittest.TestProgram.usageExit`

Let's prefer:

-:meth:`~unittest.TestProgram.usageExit`
+:meth:`!usageExit`

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

Comment thread Doc/whatsnew/3.11.rst Resolved
Comment thread Misc/NEWS.d/3.11.0a7.rst Resolved
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

@hugovk
hugovk merged commit 7595380 into python:main Jan 2, 2024
@hugovk
hugovk deleted the docs-fix-sphinx-warnings-squiggle-bang branch January 2, 2024 07:37
@miss-islington-app

Copy link
Copy Markdown

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

@miss-islington-app

Copy link
Copy Markdown

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

cherry_picker 7595380347610598a3f5529214a449660892537b 3.12
@miss-islington-app

Copy link
Copy Markdown

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

cherry_picker 7595380347610598a3f5529214a449660892537b 3.11
hugovk added a commit to hugovk/cpython that referenced this pull request Jan 2, 2024
…ces (pythonGH-113629)

(cherry picked from commit 7595380)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@bedevere-app

bedevere-app Bot commented Jan 2, 2024

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Jan 2, 2024
@bedevere-app

bedevere-app Bot commented Jan 2, 2024

Copy link
Copy Markdown

GH-113642 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 Jan 2, 2024
hugovk added a commit to hugovk/cpython that referenced this pull request Jan 2, 2024
…ces (pythonGH-113629)

(cherry picked from commit 7595380)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
AlexWaygood added a commit that referenced this pull request Jan 2, 2024
…H-113629) (#113641)

(cherry picked from commit 7595380)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
AlexWaygood added a commit that referenced this pull request Jan 2, 2024
…H-113629) (#113642)

(cherry picked from commit 7595380)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
kulikjak pushed a commit to kulikjak/cpython that referenced this pull request Jan 22, 2024
…thon#113629)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
…thon#113629)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…thon#113629)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
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

2 participants