OpenAstronomy / packaging-guide

A generic Python packaging guide and template. Slightly focused more towards scientific packages.
https://packaging-guide.openastronomy.org
41 stars 23 forks source link

Suppress matplotlib plots on docs build #28

Closed bmorris3 closed 1 year ago

bmorris3 commented 1 year ago

This is a version of the improvement in PR astropy/package-template#453. Users attempting to build docs before this PR will find that the matplotlib plot directive renders plots in individual, interactive windows. After this PR, the figures are rendered in the agg backend and not in the display.

Cadair commented 1 year ago

Thanks for the PR! This is also useful if you start testing figures i.e. with pytest-mpl

Would you be willing to add a section on environment variables / extra config in tox.ini with this as an example to the tox docs page? I am trying to keep this repo as documentation first and not have (too much) stuff buried in the template without mention in the narrative documentation.

bmorris3 commented 1 year ago

@Cadair Sure thing! Would it be useful to include a small section about adding sphinx extensions? Happy to write a paragraph about mpl plot directive, for example.

bmorris3 commented 1 year ago

I went ahead and added a bit of text for using the plot directive in 7022fcf.