matplotlib / pytest-mpl

A pytest plugin to facilitate image comparison for Matplotlib figures
Other
244 stars 47 forks source link

Set deterministic to True for vector graphics and warn about change to True in future for PNG #197

Closed astrofrog closed 8 months ago

astrofrog commented 1 year ago

While working on this I started to wonder if this should be a kwarg at all for mpl_image_compare or just a CLI/ini option. Any opinions?

ConorMacBride commented 1 year ago

Most people will want it enabled/disabled for all or none, so the CLI/ini option makes sense. I think also having the kwarg would be useful to some people. You also have https://github.com/matplotlib/pytest-mpl/pull/181 which is similar.

ConorMacBride commented 11 months ago

I see the changes in this PR are already in the documentation (https://pytest-mpl.readthedocs.io/en/latest/configuration.html#whether-to-make-metadata-deterministic) so we should merge this before releasing v0.17.0. This PR looks ready to me? Should we add the CLI and ini options now, or maybe later?

astrofrog commented 11 months ago

@ConorMacBride - I don't have time to work on the CLI and ini options now but if you do, feel free to push to this PR. Otherwise we could just merge without as you said.

ConorMacBride commented 10 months ago

@astrofrog I've added the CLI and INI options here: https://pytest-mpl--197.org.readthedocs.build/en/197/configuration.html#whether-to-make-metadata-deterministic

If this looks okay, feel free to merge. I'll then go ahead and release v0.17.0.

ConorMacBride commented 9 months ago

Hi @astrofrog, can you please take a quick look through this PR. I'd like to get it merged and publish v0.17.0. The latest pluggy release emits a new warning that makes the bug we fixed in https://github.com/matplotlib/pytest-mpl/pull/219 much more apparent -- and it's breaking astropy's CI https://github.com/astropy/astropy/issues/15944 Thanks! 😄