Chilipp / autodocsumm

Extending your autodoc API docs with a summary
Apache License 2.0
48 stars 14 forks source link

Type annotations are not rendered properly #62

Closed greyli closed 3 years ago

greyli commented 3 years ago

Hi, thanks for the cool project. It seems that the type annotations for the class arguments are not rendered properly. Catch this 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)
Chilipp commented 3 years ago

Hey @greyli ! Thanks for your input! Indeed, that does not make sense. I wonder, whether this is a problem of autodocsumm or autosummary.

What do you get when you include

.. autosummary::

    marshmallow.validate.And

?

greyli commented 3 years ago

It's the same as the old output:

image

Source: https://github.com/marshmallow-code/marshmallow/blob/dev/docs/marshmallow.validate.rst

I think this may be related to https://github.com/sphinx-doc/sphinx/issues/6311, but that issue seems fixed by https://github.com/sphinx-doc/sphinx/pull/6353. Do you think I should report it to Sphinx? I'm a bit confused with autosummary and autodocsumm, sorry.

Chilipp commented 3 years ago

hey @greyli! yes, this is definitely an issue for the sphinx-doc repository and you should make sure that you use the latest version of sphinx.

I am closing this then.

greyli commented 3 years ago

I see, thanks!