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 which contain commas in autosummary table are not removed completely #9600

Closed
greyli opened this issue Sep 1, 2021 · 0 comments

Comments

@greyli
Copy link
Contributor

greyli commented Sep 1, 2021

Describe the bug

Here is an example in marshmallow docs: https://marshmallow.readthedocs.io/en/stable/marshmallow.validate.html

Take the first And class as an example. Here is the raw definition:

And(*validators: Callable[[Any], Any], error: Optional[str] = None)

Expected output:

And(*validators, error)

Actual output:

And(*validators, Any], error)

It seems that Sphinx uses the comma to separate the arguments, but it can't tell if the comma is in the arguments list or in the type annotations.

How to Reproduce

$ git clone https://github.com/marshmallow-code/marshmallow
$ cd marshmallow
$ pip install tox
$ tox -e docs
$ # open _build/html/marshmallow.validate.html

Expected behavior

No response

Your project

https://github.com/marshmallow-code/marshmallow

Screenshots

Source: https://github.com/marshmallow-code/marshmallow/blob/dev/docs/marshmallow.validate.rst
Doc: https://marshmallow.readthedocs.io/en/stable/marshmallow.validate.html

OS

macOS Big Sur 11.4

Python version

3.8

Sphinx version

4.1.2

Sphinx extensions

No response

Extra tools

No response

Additional context

No response

@greyli greyli added the type:bug label Sep 1, 2021
@tk0miya tk0miya added this to the 4.2.0 milestone Sep 3, 2021
tk0miya added a commit to tk0miya/sphinx that referenced this issue Sep 4, 2021
@tk0miya tk0miya closed this as completed in 0a8655b Sep 5, 2021
tk0miya added a commit that referenced this issue Sep 5, 2021
Fix #9600: autosummary: Typehints including commas confuses autosummary
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 6, 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

2 participants