Try setting autodoc_inherit_docstrings
<https://www.sphinx-doc.org/es/master/usage/extensions/autodoc.html#confval-autodoc_inherit_docstrings>
to False.

Luc

On 14.10.20 10:36, Andrew Porter wrote:
> Hello,
>
> I'm using autodoc in Sphinx 3.2.1 and have a problem where it reports
> formatting errors from what I think is the `dict` docstring rather
> than my code. I have a module (`node`) which contains a dict:
>
>     #: Colour map to use when writing Invoke schedule to terminal.
>     SCHEDULE_COLOUR_MAP = {"Schedule": "white",
>                        "Loop": "red",
>                        "GlobalSum": "cyan"}
>
> This module is then made available in the __all__ list of the
> __init__.py of the package
> containing the module, i.e. I have an __init__.py that contains:
>
>     from nodes.node import SCHEDULE_COLOUR_MAP
>     __all__ = ['SCHEDULE_COLOUR_MAP']
>    
> When running Sphinx autodoc I see:
>
>     /blah blah/nodes/__init__.py:docstring of
> psyclone.psyir.nodes.SCHEDULE_COLOUR_MAP:3: WARNING: Unexpected
> indentation.
>     /blah blah/nodes/__init__.py:docstring of
> psyclone.psyir.nodes.SCHEDULE_COLOUR_MAP:4: WARNING: Block quote ends
> without a blank line; unexpected unindent.
>     /blah blah/nodes/__init__.py:docstring of
> psyclone.psyir.nodes.SCHEDULE_COLOUR_MAP:7: WARNING: Unexpected
> indentation.
>     /blah blah/psyir/nodes/__init__.py:docstring of
> psyclone.psyir.nodes.SCHEDULE_COLOUR_MAP:9: WARNING: Inline strong
> start-string without end-string.
>
> As you can see, I've tried explicitly adding a docstring for the dict
> using the `#:` markup but that doesn't seem to get picked up.
>
> I get exactly the same problem with a different dictionary in a
> different module.
>
> Am I doing something wrong here?
>
> (FYI, you can reproduce this problem by cloning
> https://github.com/stfc/PSyclone.git, cd PSyclone; pip install .; cd
> doc/reference_guide; make html)
>
> Many thanks,
>
> Andy.
> -- 
> You received this message because you are subscribed to the Google
> Groups "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected]
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sphinx-users/d845e746-db09-4712-ad82-058d34d591efn%40googlegroups.com
> <https://groups.google.com/d/msgid/sphinx-users/d845e746-db09-4712-ad82-058d34d591efn%40googlegroups.com?utm_medium=email&utm_source=footer>.
   

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/4e2f40b0-fcf2-58bd-8186-984e243830e6%40gmail.com.

Reply via email to