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

When bumping sphinx, remove FrameType workaround in docs/source/conf.py #2921

Closed
jakkdl opened this issue Jan 10, 2024 · 3 comments · Fixed by #3070
Closed

When bumping sphinx, remove FrameType workaround in docs/source/conf.py #2921

jakkdl opened this issue Jan 10, 2024 · 3 comments · Fixed by #3070
Labels

Comments

@jakkdl
Copy link
Member

jakkdl commented Jan 10, 2024

sphinx-doc/sphinx#11802
sphinx-doc/sphinx#11861
being fixed should make

trio/docs/source/conf.py

Lines 200 to 203 in d1cc062

# `types.FrameType.__module__` is "builtins", so sphinx looks for
# builtins.FrameType.
# See https://github.com/sphinx-doc/sphinx/issues/11802
add_mapping("class", "types", "FrameType")

redundant. Though I had some issues with getting TracebackType working with their workaround previously:

# sphinx will *only* work if we use types.TracebackType, and import
# *inside* TYPE_CHECKING. No other combination works.....
import types

that'll probably be the case with FrameType as well - and if so we should probably investigate and open an issue in sphinx about it.

@Zac-HD Zac-HD added the docs label May 31, 2024
A5rocks added a commit to A5rocks/trio that referenced this issue Aug 23, 2024
@A5rocks A5rocks mentioned this issue Aug 23, 2024
@A5rocks
Copy link
Contributor

A5rocks commented Aug 23, 2024

This doesn't seem to work when updating Sphinx to 7.4.7 (I tried several combinations of from types import FrameType and moving things out of if TYPE_CHECKING but nothing changed).

@jakkdl
Copy link
Member Author

jakkdl commented Aug 25, 2024

I spent a while digging around in sphinx, and it appears I was wrong about the cause being types.FrameType.__module__ == 'builtins'. It's the same problem as with math.inf, where they're defined in the py:data section in the objects.inv file, rather than in py:class.

The open issues for this seem to be sphinx-doc/sphinx#10974 / sphinx-doc/sphinx#10785

@jakkdl
Copy link
Member Author

jakkdl commented Aug 25, 2024

pushed a commit to #3070 that fixes the comment, so we can probably close this. Don't think we need a dedicated tracking issue for it

@CoolCat467 CoolCat467 linked a pull request Aug 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants