[Matplotlib-devel] On testing with other FreeType versions

Elliott Sales de Andrade quantum.analyst at gmail.com
Mon Dec 11 21:20:33 EST 2017


On 11 December 2017 at 00:44, Elliott Sales de Andrade <
quantum.analyst at gmail.com> wrote:

> Hi all,
>
> Downstream in Fedora (and maybe Debian), they are running into issues with
> testing and text. Fedora 26 has FreeType 2.7.1 and Fedora 27 & Rawhide has
> FreeType 2.8. Fedora 25 uses 2.6.5, but it will be EOL in the next week.
> Many other distros are also transitioning to these newer FreeType as well
> [1] and I think anaconda recently added 2.8 too.
>
> With 2.7.1, a few tests fail (rms < 1) and it is straightforward to patch
> that [2]. With 2.8 though, over 800 tests fail [3] ranging up to ~80 rms
> [4]. This is a bit harder to paper over.
>
> I see a few ways to mitigate the problem, with varying
> advantages/disadvantages:
>
> 1. Bundle the older version in the Matplotlib package like we do with
> tests. I don't really believe this to be a viable option for downstream,
> but I'm just mentioning it to be thorough. There are already a few (minor)
> security issues in the one we test against.
> 2. Inject older FreeType just to run tests on the package. Again I don't
> like this idea. The point of running tests is to be sure that the version
> in a distro works *in that distro*. Testing with something a user could
> never install seems useless.
> 3. Re-create all our current and future test images with 2.8. While this
> is most future-proof, adding over 800 images is going to bloat the repo
> quite a bit.
> 4. Create some sort of side repo with test images for other FreeType
> releases. This would reduce bloat in the main repo but be somewhat more
> work. Thus I'd only suggest doing so for tags.
>
>
One more thing I forgot to mention is ImageHash [5] which is used by Iris
for image tests using the following strategy [6]:


   - using a perceptual 'image hash' of the outputs
   <https://github.com/JohannesBuchner/imagehash> as the basis for checking
   test results.
   - storing the hashes of 'known accepted results' for each test in a
   database in the repo
   - storing associated reference images for each hash value in a separate
   public repository,
<https://github.com/SciTools/test-images-scitools>allowing
   human-eye judgement of 'valid equivalent' results.
   - a new version of the 'iris/tests/idiff.py' assists in comparing
   proposed new 'correct' result images with the existing accepted ones.

While this does reduce load in the main repo itself, it does increase the
cognitive load for developers. Iris has a small core group of developers
and much fewer drive-by contributions compared to Matplotlib, so I'm not
sure we want to be doing this full idea. (Note also their repo is LGPL3, so
please don't copy anything from there.) Using ImageHash might still be
useful instead of RMS, though it may generalize things too much.

I dislike the first two options as they would be repetitive across distros
> (unless they just stopped testing altogether), but the last two are not
> without work for us.
>
> Opinions? Alternative ideas?
>
> [1] https://repology.org/metapackage/freetype/versions
> [2] https://github.com/QuLogic/matplotlib/commit/cfdc8359234
> 07810bd087f60332cdc8cdcb23f05
> [3] https://kojipkgs.fedoraproject.org//work/tasks/3137/23623137/build.log
> [4] https://gist.github.com/QuLogic/477055a847a44cd444a0932432acffd1
>
[5] https://pypi.python.org/pypi/ImageHash
[6] https://github.com/SciTools/iris/blob/master/docs/iris/src/
developers_guide/graphics_tests.rst#graphics-testing-strategy

-- 
Elliott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20171211/77faa6ed/attachment.html>


More information about the Matplotlib-devel mailing list