| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Force-pushed a new version which should fix the failing tests -- the docutils import should have been after the pytest.importorskip check that Sphinx was installed. Incidentally, this means the CI doesn't have Sphinx installed and so these tests aren't actually run anyway... |
Sorry, something went wrong.
This commit adds a :caption: option to the plot directive provided by the Sphinx extension (matplotlib.sphinxext.plot_directive). Without this option, there is no way to specify a caption for a plot generated from inline content. This is fully backwards-compatible. If a plot directive with a path to a source file has both a :caption: option and content provided, the content is used for the caption and the option is ignored.
|
And another force-push to fix a flake8 error due to the above move of the import. |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for the PR 🚀 - I think this looks like a good addition, and the code looks good to me (just one question). I'm not too experienced with testing these things, so will let someone else chime in on that part.
Sorry, something went wrong.
| from docutils.nodes import caption, figure # noqa: E402 | ||
|
|
||
| # Sphinx has some deprecation warnings we don't want to turn into errors. | ||
| with warnings.catch_warnings(): |
There was a problem hiding this comment.
What are these warnings? I feel like long term we don't want to just ignore these.
Sorry, something went wrong.
There was a problem hiding this comment.
It's Jinja (imported by Sphinx) giving a DeprecationWarning: "Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop." This has been fixed in Jinja's master and should be included in the next release; see pallets/jinja#1028. The other warning (in build_test_doc()) is the same warning, also from Jinja and should also be fixed in the next release.
These warnings are only raised when importing Sphinx for test purposes (not in the actual library) so I don't think matplotlib needs to convert them to test failures.
Sorry, something went wrong.
|
With #18426 merged, is there anything here left to merge? |
Sorry, something went wrong.
|
The way of testing in this PR would be a plus... |
Sorry, something went wrong.
|
Closing in favour of #18426, Sorry for the PR overlap, but I think it was an honest mistake... |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
This PR adds a :caption: option to the plot directive provided by the Sphinx extension matplotlib.sphinxext.plot_directive. Without this option, there is no way to specify a caption for a plot generated from inline content.
This is fully backwards-compatible. If a plot directive with a path to a source file has both a :caption: option and content provided, the content is used for the caption and the option is ignored.
PR Checklist