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

Remove literal type alias to help sphinx render #1129

Merged
merged 1 commit into from
Jan 14, 2025
Merged

Conversation

sirosen
Copy link
Member

@sirosen sirosen commented Jan 14, 2025

This type alias is used in 3 locations (two of which are internal), but sphinx autodoc does not render it as desired or expected. It seems that there's something more complex going wrong with the docstring for this class, but it may also be related to some outstanding sphinx bugs related to type aliases and literals, specifically.

For now, switch off of the alias and use the literal verbatim in TransferData.__init__ to get a rendering which is much closer to being correct.


Here's the original render:
image

Here's the fix:
image

I burned a good chunk of time playing with sphinx autodoc settings to try to fix this, and I don't think that's the issue. I think it's something to do with the exact content of that file -- maybe a missing escape or other incorrect bit of RST in the docstring. For now, I'm satisfied with the fix as being loads better than what we're publishing today, but I'd like to come back to this and fully fix it at some point.


📚 Documentation preview 📚: https://globus-sdk-python--1129.org.readthedocs.build/en/1129/

This type alias is used in 3 locations (two of which are internal),
but sphinx autodoc does not render it as desired or expected. It seems
that there's something more complex going wrong with the docstring for
this class, but it may also be related to some outstanding sphinx bugs
related to type aliases and literals, specifically.

For now, switch off of the alias and use the literal verbatim in
`TransferData.__init__` to get a rendering which is much closer to
being correct.
@kurtmckee kurtmckee added the no-news-is-good-news This change does not require a news file label Jan 14, 2025
@sirosen sirosen merged commit fdebea0 into globus:main Jan 14, 2025
8 of 9 checks passed
@sirosen sirosen deleted the doc-fix branch January 14, 2025 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-news-is-good-news This change does not require a news file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants