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-101100: Fix Sphinx warnings from removed ~! references #113629

Merged
merged 2 commits into from
Jan 2, 2024

Conversation

hugovk
Copy link
Member

@hugovk hugovk 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/

Doc/whatsnew/3.11.rst Outdated Show resolved Hide resolved
Misc/NEWS.d/3.11.0a7.rst Outdated Show resolved Hide resolved
Co-authored-by: Alex Waygood <[email protected]>
Copy link
Member

@AlexWaygood AlexWaygood 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!

@hugovk hugovk merged commit 7595380 into python:main Jan 2, 2024
24 checks passed
@hugovk hugovk 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 <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Jan 2, 2024

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 bug and security fixes label Jan 2, 2024
@bedevere-app
Copy link

bedevere-app bot commented Jan 2, 2024

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 <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>
AlexWaygood added a commit that referenced this pull request Jan 2, 2024
AlexWaygood added a commit that referenced this pull request Jan 2, 2024
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 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.

2 participants