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

Return type + docstring container directive generates error #513

Open
trevorbaca opened this issue Jan 2, 2025 · 0 comments
Open

Return type + docstring container directive generates error #513

trevorbaca opened this issue Jan 2, 2025 · 0 comments

Comments

@trevorbaca
Copy link

sphinx-autodoc-typehints generates an error and a warning when processing this function:

def foo() -> int:
    """
    Description.

    ..  container::

        More description.

    """
    return
/path/to/file:5: ERROR: Content block expected for the "container" directive; none found. [docutils]
/path/to/file:6: WARNING: Explicit markup ends without a blank line; unexpected unindent. [docutils]

The bug is triggered when these two things are true:

  • the function annotates a return type
  • the function's docstring contains a container directive

This is with sphinx-autodoc-typehints 2.5.0, but I think a version of this bug (always triggered by a container directive) has been around since at least February 2023.

trevorbaca added a commit to trevorbaca/baca that referenced this issue Jan 4, 2025
sphinx_autodoc_typehints has had some long-running bugs related
to the reST `container` directive.

The current bug is ...

    tox-dev/sphinx-autodoc-typehints#513

... which mangles the formatting of docstrings that have a return-type
annotation and a `container` directive.

This commit removes sphinx_autodoc_typethints. The extension doesn't
look like it was providing much value to the docs anyway.
trevorbaca added a commit to Abjad/abjad that referenced this issue Jan 4, 2025
sphinx_autodoc_typehints has had some long-running bugs related
to the reST `container` directive.

The current bug is ...

    tox-dev/sphinx-autodoc-typehints#513

... which mangles the formatting of docstrings that have a return-type
annotation and a `container` directive.

This commit removes sphinx_autodoc_typethints. This prevents
several dozen errors and warnings when Sphinx builds.

The extension doesn't look like it was providing much value to the docs
anyway. Sphinx adds type annotations without sphinx_autodoc_typehints.
trevorbaca added a commit to Abjad/abjad that referenced this issue Jan 4, 2025
sphinx_autodoc_typehints has had some long-running bugs related
to the reST `container` directive.

The current bug is ...

    tox-dev/sphinx-autodoc-typehints#513

... which mangles the formatting of docstrings that have a return-type
annotation and a `container` directive.

This commit removes sphinx_autodoc_typethints. This prevents
several dozen errors and warnings when Sphinx builds.

The extension doesn't look like it was providing much value to the docs
anyway. Sphinx adds type annotations without sphinx_autodoc_typehints.
trevorbaca added a commit to Abjad/abjad that referenced this issue Jan 4, 2025
sphinx_autodoc_typehints has had some long-running bugs related
to the reST `container` directive.

The current bug is ...

    tox-dev/sphinx-autodoc-typehints#513

... which mangles the formatting of docstrings that have a return-type
annotation and a `container` directive.

This commit removes sphinx_autodoc_typethints. This prevents
several dozen errors and warnings when Sphinx builds.

The extension doesn't look like it was providing much value to the docs
anyway. Sphinx adds type annotations without sphinx_autodoc_typehints.
trevorbaca added a commit to trevorbaca/baca that referenced this issue Jan 6, 2025
sphinx_autodoc_typehints has had some long-running bugs related
to the reST `container` directive.

The current bug is ...

    tox-dev/sphinx-autodoc-typehints#513

... which mangles the formatting of docstrings that have a return-type
annotation and a `container` directive.

This commit removes sphinx_autodoc_typethints. The extension doesn't
look like it was providing much value to the docs anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant