-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
improvements for coverage_doctest.py #22429
Comments
I don't understand what this issue is for. Can it be made clearer? Otherwise it isn't useful to have an issue like this and it should be closed. |
It's for the script bin/coverage_doctest.py. My comments were originally made on #22426 |
Hello, since I worked on a previous issue with coverage_doctest I was thinking that I might try this one too. Just to clarify, this program is supposed to look for example code blocks in the sphinx HTML files, right? |
For Sphinx coverage, we might consider using https://www.sphinx-doc.org/en/master/usage/extensions/coverage.html instead. I haven't tested it, so we should check that it can do everything that we need. |
I tried adding that extension to conf.py but I couldn’t figure out where it puts its output, unfortunately it doesn’t seem to have much documentation. It looks like it checks that every module has generated sphinx documentation, so I think it might be useful to add if we can find the output. I’ve been making coverage_doctest.py check specifically whether every module has a code example in the Sphinx files, so they don’t completely overlap, and I think it may make sense to have both. |
You need to add it to the Makefile like diff --git a/doc/Makefile b/doc/Makefile
index 0e54ec0f76..590bba7b93 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -63,6 +63,9 @@ html: $(BUILDDIR)/logo/sympy-notailtext-favicon.ico
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+coverage:
+ $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/html
+
$(BUILDDIR)/html/pics/*.png: $(SOURCEDIR)/pics/*.png
mkdir -p $(BUILDDIR)/html
cp -r $(SOURCEDIR)/pics $(BUILDDIR)/html/ then run It looks like aside from those two options, it isn't very customizable, so we may end up needing to use coverage_doctest instead if it can't be suited to our needs. It also doesn't appear to actually return nonzero when there are uncovered functions, so that would need to be fixed as well. |
I think I have a fix for coverage_doctest finished. If we're also going to add the sphinx coverage extension, I think it would be best to make a new issue to add it to the makefile, unless you think that should be here too? |
As far as issues go I think we can just keep this one. For the pull request, you can do it in the same pull request or separately, it doesn't matter. If it is complicated enough it makes sense to do it separately, but if it is simple it can go together in the same PR. |
Alright, sounds good! For now I only have the fix for coverage_doctest and I haven't been able to get the extension to return nonzero so I’ll submit a pull request for coverage_doctest first. |
Some deficiencies in the running of coverage_doctest.py have been noted by @asmeurer in #22426:
The text was updated successfully, but these errors were encountered: