-
-
Notifications
You must be signed in to change notification settings - Fork 107
Invalid spacing between :rtype:
and following directives
#293
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
Comments
This behaviour was added in #290, which did add a test in |
It seems @hoodmane this was a regression introduced. |
Oops didn't notice the warning. I guess the fix is simple enough. As an aside, it occurs to me that this code would all be a lot simpler if we could manipulate a tree instead of strings containing a whitespace-sensitive markup format... |
@jakelishman, this broke https://github.com/tox-dev/pyproject-api/actions/runs/3933433212. Can you take a look, please? |
I think your CI run there is broken by 1.21.0 and fixed by the PR of mine you just merged (and the 1.21.1 release you just cut, thanks!). Could you try re-running your CI? I was unable to reproduce the failure locally with 1.21.1, but could if I pinned |
In the 1.21.0 release, the position of the emitted
:rtype:
field seems to have changed so that it is now earlier in the docstring, rather than reliably being at the end. This is fine, except when the place the injector chooses to place it is immediately before a.. <whatever>::
directive. There doesn't seem to reliable be a blank line inserted after it, and if not, Sphinx complains that the field list ends unexpectedly.For example, given this Python file
tmp/__init__.py
:and this Sphinx
conf.py
:running Sphinx's
make html
gives:The docstring enters
_inject_types_to_docstring
asand is modified to
This also happens if there's any regular text before the
.. rubric:: notes
as well (which is a bit more of a realistic scenario).The text was updated successfully, but these errors were encountered: