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
"Unexpected indentation" warnings from :members: #4606
Comments
Apparently, these warnings are caused by not having a newline before ":members:". See sphinx-doc/sphinx#4606.
Apparently the "one warning at a time" behavior is a result of our use of the |
It seems this problem is a combination of two issues. At first, The next is an issue of markups. It seems docstrings of sympy is not correct. For example, here is the docstring of This docstring contains a example code, but it is not a code-block. So reST parser raises an error "Unexpected indentation.".
From these issues, 1.7 causes "Unexpected indentation." warnings. On the other hand, your workaround is not correct.
This fix removes |
Thank you. My top priority was to fix CI build failures in master, so I didn't focus too much on the actual documentation build itself. I'll see if I can fix it correctly, if someone else doesn't do it first. I think there is a bug here, which is that the error reporting from Sphinx is not very good. It would help a lot if it named the actual function that the docstring came from (Function.eval instead of exp2.eval). There's also the warnings as errors only appearing one at a time issue I mentioned, but that can be a separate issue if you want. |
Absolutely. The messages should be improved.
Yes please! |
…ocstring Fix #4606: autodoc: the location of the warning is incorrect for inherited method
Since Sphinx updated to 1.7.0, our SymPy docs started failing. We have the setting enabled in our docs to turn warnings into errors.
We have gotten many errors like
It turns out the source of the error has nothing to do with the method in question (which doesn't even have a docstring). The problem is that we used
instead of
This is requiring changes across our entire docs.
Now if Sphinx wants to require the newline here, that is fine. But the warning should be much more indicative of what the problem is. Also, quite annoyingly, it only warns about one issue at a time, so if you fix an issue and rebuild, it will warn about another one (and for whatever reason, Sphinx no longer caches the build??? Every build is done from scratch. This is even if I make no changes to anything).
I tested this against the master branch and it is the same result.
Upstream SymPy issue: sympy/sympy#14181
The text was updated successfully, but these errors were encountered: