Skip to content
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

boilerplate for standardize freetype in github actions? #178

Open
shapiromatron opened this issue Aug 11, 2022 · 2 comments
Open

boilerplate for standardize freetype in github actions? #178

shapiromatron opened this issue Aug 11, 2022 · 2 comments

Comments

@shapiromatron
Copy link

shapiromatron commented Aug 11, 2022

I'm getting CI/CD fails on windows vs linux, and I suspect it's related to the text renderer, as described here: https://github.com/matplotlib/pytest-mpl#removing-text . When I added this option, they still seem to fail.

I'm using the standard "ubuntu-20.04" and "windows-2019" github action runners. Are there instructions anywhere or existing repos that can use this library in different environments using the standard runners?

I'd be happy to contribute a PR to update the docs for this repo, if someone can steer me in the correct direction. Thanks!

@ConorMacBride
Copy link
Member

Hi @shapiromatron, it is difficult to test across multiple versions and platforms due to the text differences (because of different FreeType versions). Typically, the recommended solution is to run image comparison tests within a dedicated testing environment, which is configured to always uses the same GitHub Actions runner, Python version, and Matplotlib version. This is the standard recommendation from: https://github.com/matplotlib/pytest-mpl#package-version-dependencies

If figures also need to be tested on a different OS or a different dependency version, it is recommended to maintain a separate set of baseline hashes or images.

The remove text option doesn't remove all the text (as documented here), which may be why it doesn't work across different OSs.

Some more relevant issues here: https://github.com/matplotlib/pytest-mpl/issues?q=is%3Aissue+freetype

And when #150 is released, it should make cross platform testing work more reliably.

@dopplershift
Copy link
Contributor

My way of dealing with this has been:

  • For PyPI-based installs, make sure you allow matplotlib to download and install its default, internal copy of freetype (this is the default behavior)
  • For conda-based installs, I have been maintaining packages on conda-forge under the "testing" label that are built with matplotlib's internal (consistent) freetype copy. These can be installed with conda install -c conda-forge/label/testing matplotlib-base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants