Skip to content

Conversation

@hugovk
Copy link
Member

@hugovkhugovk commented Jan 1, 2024

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/

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Copy link
Member

@AlexWaygoodAlexWaygood left a comment

Choose a reason for hiding this comment

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

Looks good!

@hugovkhugovk merged commit 7595380 into python:mainJan 2, 2024
@hugovkhugovk deleted the docs-fix-sphinx-warnings-squiggle-bang branch January 2, 2024 07:37
@miss-islington-app
Copy link

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

@miss-islington-app
Copy link

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

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
Copy link

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

@bedevere-appbedevere-appbot removed the needs backport to 3.12 only security fixes label Jan 2, 2024
@bedevere-app
Copy link

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

@bedevere-appbedevere-appbot 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
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docsDocumentation in the Doc dirskip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@hugovk@AlexWaygood