Navigation Menu

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

Type annotations using typing.Annotated are not displayed well with the HEAD of 3.10 #9589

Closed
tk0miya opened this issue Aug 29, 2021 · 0 comments

Comments

@tk0miya
Copy link
Member

tk0miya commented Aug 29, 2021

Describe the bug

Recently, the implementation of typing.Annotated was changed on the HEAD of 3.10 (refs: python/cpython#27841). After this change, autodoc can't process annotations built by typing.Annotated well.

Note: this breaks our CI. So it should be fixed on 4.1.3.

How to Reproduce

Python 3.10.0rc1+ (heads/3.10:779b9ae, Aug 29 2021, 13:48:15) [Clang 11.0.3 (clang-1103.0.32.59)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from sphinx.util.typing import stringify
>>> from typing import Annotated
>>> assert stringify(Annotated[str, "foo", "bar"]) == "str"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AssertionError
>>> stringify(Annotated[str, "foo", "bar"])
'Annotated'

Expected behavior

No response

Your project

N/A

Screenshots

No response

OS

Linux

Python version

HEAD of 3.10

Sphinx version

4.1.x

Sphinx extensions

No response

Extra tools

No response

Additional context

No response

@tk0miya tk0miya added this to the 4.1.3 milestone Aug 29, 2021
tk0miya added a commit to tk0miya/sphinx that referenced this issue Aug 29, 2021
At the HEAD of 3.10, the implementation of `typing.Annotated` has
been changed to have __qualname__.
tk0miya added a commit that referenced this issue Aug 29, 2021
Fix #9589: autodoc: typing.Annotated has wrongly been rendered
tk0miya added a commit that referenced this issue Aug 29, 2021
At the HEAD of 3.10, the implementation of `typing.Annotated` has
been changed to have __qualname__.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant