Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-101100: Fix sphinx warnings inhowto/*#127084

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
hugovk merged 4 commits intopython:mainfromkoyuki7w:doc-fix-2
Nov 26, 2024
Merged

Conversation

koyuki7w
Copy link
Contributor

@koyuki7wkoyuki7w commentedNov 21, 2024
edited by github-actionsbot
Loading

Removed sphinx roles of some classes and methods, as the classes are defined in the sample codes, not in Python.

Fixed warnings:

howto/descriptor.rst:45: WARNING: py:class reference target not found: Ten [ref.class]howto/descriptor.rst:218: WARNING: py:class reference target not found: Person [ref.class]howto/descriptor.rst:218: WARNING: py:class reference target not found: Person [ref.class]howto/descriptor.rst:256: WARNING: py:class reference target not found: Person [ref.class]howto/descriptor.rst:340: WARNING: py:class reference target not found: Validator [ref.class]howto/descriptor.rst:363: WARNING: py:class reference target not found: Validator [ref.class]howto/descriptor.rst:363: WARNING: py:meth reference target not found: validate [ref.meth]howto/descriptor.rst:372: WARNING: py:class reference target not found: OneOf [ref.class]howto/descriptor.rst:374: WARNING: py:class reference target not found: Number [ref.class]howto/descriptor.rst:378: WARNING: py:class reference target not found: String [ref.class]howto/descriptor.rst:876: WARNING: py:class reference target not found: Field [ref.class]howto/descriptor.rst:1143: WARNING: py:func reference target not found: Property [ref.func]howto/enum.rst:78: WARNING: py:class reference target not found: Weekday [ref.class]howto/enum.rst:90: WARNING: py:class reference target not found: Weekday [ref.class]howto/enum.rst:113: WARNING: py:class reference target not found: Weekday [ref.class]howto/enum.rst:131: WARNING: py:class reference target not found: Weekday [ref.class]howto/enum.rst:576: WARNING: py:class reference target not found: Animal [ref.class]howto/enum.rst:893: WARNING: py:class reference target not found: FloatEnum [ref.class]

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

Removed sphinx roles of some classes and methods,as the classes are defined in the sample codes, not in Python.Fixed warnings:```howto/descriptor.rst:45: WARNING: py:class reference target not found: Ten [ref.class]howto/descriptor.rst:218: WARNING: py:class reference target not found: Person [ref.class]howto/descriptor.rst:218: WARNING: py:class reference target not found: Person [ref.class]howto/descriptor.rst:256: WARNING: py:class reference target not found: Person [ref.class]howto/descriptor.rst:340: WARNING: py:class reference target not found: Validator [ref.class]howto/descriptor.rst:363: WARNING: py:class reference target not found: Validator [ref.class]howto/descriptor.rst:363: WARNING: py:meth reference target not found: validate [ref.meth]howto/descriptor.rst:372: WARNING: py:class reference target not found: OneOf [ref.class]howto/descriptor.rst:374: WARNING: py:class reference target not found: Number [ref.class]howto/descriptor.rst:378: WARNING: py:class reference target not found: String [ref.class]howto/descriptor.rst:876: WARNING: py:class reference target not found: Field [ref.class]howto/descriptor.rst:1143: WARNING: py:func reference target not found: Property [ref.func]howto/descriptor.rst:1725: WARNING: py:class reference target not found: Object [ref.class]howto/enum.rst:78: WARNING: py:class reference target not found: Weekday [ref.class]howto/enum.rst:90: WARNING: py:class reference target not found: Weekday [ref.class]howto/enum.rst:113: WARNING: py:class reference target not found: Weekday [ref.class]howto/enum.rst:131: WARNING: py:class reference target not found: Weekday [ref.class]howto/enum.rst:576: WARNING: py:class reference target not found: Animal [ref.class]howto/enum.rst:893: WARNING: py:class reference target not found: FloatEnum [ref.class]```
@@ -42,7 +42,7 @@ add new capabilities one by one.
Simple example: A descriptor that returns a constant
----------------------------------------------------

The:class:`Ten` class is a descriptor whose :meth:`__get__` method always
The``Ten`` class is a descriptor whose :meth:`__get__` method always
Copy link
Member

Choose a reason for hiding this comment

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

If we keep theclass role but add an exclamation mark then we keep the formatting of a class but don't try to resolve the reference, and get no warning:

Suggested change
The``Ten`` class is a descriptor whose:meth:`__get__` method always
The:class:`!Ten` class is a descriptor whose:meth:`!__get__` method always

Re:https://devguide.python.org/documentation/markup/#roles

Same applies to the others in this PR.

And we can also do it for the example__get__ method here.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@hugovk Fixed class references by using! prefix.__get__ is documented inhttps://docs.python.org/3/reference/datamodel.html#object.__get__ , so I think it is better to fix__get__ to~object.__get__.

Copy link
Member

Choose a reason for hiding this comment

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

__get__ is documented indocs.python.org/3/reference/datamodel.html#object.get , so I think it is better to fix__get__ to~object.__get__.

Yes, good idea.

koyuki7w reacted with thumbs up emoji
@koyuki7wkoyuki7w changed the titlegh-101100: Remove roles of sample classes inhowto/*gh-101100: Fix sphinx warnings inhowto/*Nov 25, 2024
Copy link
Member

@hugovkhugovk left a comment

Choose a reason for hiding this comment

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

Thanks!

koyuki7w reacted with heart emoji
@hugovkhugovk merged commit733fe59 intopython:mainNov 26, 2024
29 checks passed
@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestNov 26, 2024
(cherry picked from commit733fe59)Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
@miss-islington-app
Copy link

Sorry,@koyuki7w and@hugovk, I could not cleanly backport this to3.12 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker 733fe59206e04141fd5cf65606ebd3d42a996226 3.12

@bedevere-app
Copy link

GH-127287 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelNov 26, 2024
@hugovk
Copy link
Member

@koyuki7w Please could you take care of the 3.12 backport? Thanks!

hugovk pushed a commit that referenced this pull requestNov 26, 2024
Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
@bedevere-app
Copy link

GH-127311 is a backport of this pull request to the3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelNov 27, 2024
@koyuki7w
Copy link
ContributorAuthor

@hugovk Thanks. Opened 3.12 backport PR.

hugovk reacted with thumbs up emoji

@koyuki7wkoyuki7w deleted the doc-fix-2 branchNovember 27, 2024 00:58
ebonnal pushed a commit to ebonnal/cpython that referenced this pull requestJan 12, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@hugovkhugovkhugovk approved these changes

@ethanfurmanethanfurmanAwaiting requested review from ethanfurmanethanfurman is a code owner

@AA-TurnerAA-TurnerAwaiting requested review from AA-TurnerAA-Turner is a code owner

Assignees

@hugovkhugovk

Labels
docsDocumentation in the Doc dirskip news
Projects
Status: Done
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@koyuki7w@hugovk

[8]ページ先頭

©2009-2025 Movatter.jp