aff8846
From d2ce17b7096e9f83f9ba4ac37052fe5d2e07f223 Mon Sep 17 00:00:00 2001
9046bbb
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
e6f3591
Date: Fri, 14 Feb 2020 06:05:42 -0500
aff8846
Subject: [PATCH 3/4] Set FreeType version to 2.13.1 and update tolerances
9046bbb
9046bbb
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
9046bbb
---
aff8846
 extern/meson.build                             |  2 +-
aff8846
 lib/matplotlib/__init__.py                     |  2 +-
aff8846
 lib/matplotlib/tests/test_axes.py              |  4 ++--
aff8846
 lib/matplotlib/tests/test_backend_pgf.py       |  2 +-
aff8846
 lib/matplotlib/tests/test_constrainedlayout.py | 10 +++++-----
aff8846
 lib/matplotlib/tests/test_legend.py            |  4 ++--
aff8846
 lib/matplotlib/tests/test_polar.py             |  2 +-
aff8846
 lib/matplotlib/tests/test_tightlayout.py       | 10 +++++-----
aff8846
 8 files changed, 18 insertions(+), 18 deletions(-)
9046bbb
aff8846
diff --git a/extern/meson.build b/extern/meson.build
aff8846
index 662feb7872..df42b908af 100644
aff8846
--- a/extern/meson.build
aff8846
+++ b/extern/meson.build
aff8846
@@ -14,7 +14,7 @@ else
aff8846
   # must match the value in `lib/matplotlib.__init__.py`. Also update the docs
aff8846
   # in `docs/devel/dependencies.rst`. Bump the cache key in
aff8846
   # `.circleci/config.yml` when changing requirements.
aff8846
-  LOCAL_FREETYPE_VERSION = '2.6.1'
aff8846
+  LOCAL_FREETYPE_VERSION = '2.13.1'
aff8846
 
aff8846
   freetype_proj = subproject(
aff8846
     f'freetype-@LOCAL_FREETYPE_VERSION@',
9046bbb
diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py
aff8846
index 346e3d3454..ebf5818417 100644
9046bbb
--- a/lib/matplotlib/__init__.py
9046bbb
+++ b/lib/matplotlib/__init__.py
aff8846
@@ -1313,7 +1313,7 @@ def _val_or_rc(val, rc_name):
e6f3591
 def _init_tests():
aff8846
     # The version of FreeType to install locally for running the tests. This must match
aff8846
     # the value in `meson.build`.
9046bbb
-    LOCAL_FREETYPE_VERSION = '2.6.1'
05ffcff
+    LOCAL_FREETYPE_VERSION = '2.13.1'
9046bbb
 
9046bbb
     from matplotlib import ft2font
9046bbb
     if (ft2font.__freetype_version__ != LOCAL_FREETYPE_VERSION or
9046bbb
diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py
aff8846
index 0ed5a11c13..ee220f1854 100644
9046bbb
--- a/lib/matplotlib/tests/test_axes.py
9046bbb
+++ b/lib/matplotlib/tests/test_axes.py
aff8846
@@ -7714,7 +7714,7 @@ def test_normal_axes():
9046bbb
     ]
9046bbb
     for nn, b in enumerate(bbaxis):
9046bbb
         targetbb = mtransforms.Bbox.from_bounds(*target[nn])
9046bbb
-        assert_array_almost_equal(b.bounds, targetbb.bounds, decimal=2)
9046bbb
+        assert_array_almost_equal(b.bounds, targetbb.bounds, decimal=0)
9046bbb
 
9046bbb
     target = [
9046bbb
         [150.0, 119.999, 930.0, 11.111],
aff8846
@@ -7732,7 +7732,7 @@ def test_normal_axes():
9046bbb
 
9046bbb
     target = [85.5138, 75.88888, 1021.11, 1017.11]
9046bbb
     targetbb = mtransforms.Bbox.from_bounds(*target)
9046bbb
-    assert_array_almost_equal(bbtb.bounds, targetbb.bounds, decimal=2)
9046bbb
+    assert_array_almost_equal(bbtb.bounds, targetbb.bounds, decimal=0)
9046bbb
 
9046bbb
     # test that get_position roundtrips to get_window_extent
9046bbb
     axbb = ax.get_position().transformed(fig.transFigure).bounds
acd2786
diff --git a/lib/matplotlib/tests/test_backend_pgf.py b/lib/matplotlib/tests/test_backend_pgf.py
97d2c54
index 8a83515f16..26bc9d6c48 100644
acd2786
--- a/lib/matplotlib/tests/test_backend_pgf.py
acd2786
+++ b/lib/matplotlib/tests/test_backend_pgf.py
acd2786
@@ -165,7 +165,7 @@ def test_pathclip():
acd2786
 # test mixed mode rendering
acd2786
 @needs_pgf_xelatex
acd2786
 @pytest.mark.backend('pgf')
acd2786
-@image_comparison(['pgf_mixedmode.pdf'], style='default')
acd2786
+@image_comparison(['pgf_mixedmode.pdf'], style='default', tol=0.87)
acd2786
 def test_mixedmode():
acd2786
     mpl.rcParams.update({'font.family': 'serif', 'pgf.rcfonts': False})
acd2786
     Y, X = np.ogrid[-1:1:40j, -1:1:40j]
1f37c6a
diff --git a/lib/matplotlib/tests/test_constrainedlayout.py b/lib/matplotlib/tests/test_constrainedlayout.py
aff8846
index 4dc4d9501e..47a4e80bb5 100644
1f37c6a
--- a/lib/matplotlib/tests/test_constrainedlayout.py
1f37c6a
+++ b/lib/matplotlib/tests/test_constrainedlayout.py
aff8846
@@ -435,7 +435,7 @@ def test_hidden_axes():
1f37c6a
     extents1 = np.copy(axs[0, 0].get_position().extents)
1f37c6a
 
037e6ae
     np.testing.assert_allclose(
ca0fc90
-        extents1, [0.045552, 0.543288, 0.47819, 0.982638], rtol=1e-5)
ca0fc90
+        extents1, [0.045552, 0.543288, 0.47819, 0.982638], rtol=1e-2)
ca0fc90
 
ca0fc90
 
ca0fc90
 def test_colorbar_align():
aff8846
@@ -641,9 +641,9 @@ def test_compressed1():
704b8e1
     fig.draw_without_rendering()
704b8e1
 
704b8e1
     pos = axs[0, 0].get_position()
704b8e1
-    np.testing.assert_allclose(pos.x0, 0.2344, atol=1e-3)
704b8e1
+    np.testing.assert_allclose(pos.x0, 0.2344, atol=1e-2)
704b8e1
     pos = axs[0, 1].get_position()
acd2786
-    np.testing.assert_allclose(pos.x1, 0.7024, atol=1e-3)
acd2786
+    np.testing.assert_allclose(pos.x1, 0.7024, atol=1e-2)
704b8e1
 
acd2786
     # wider than tall
acd2786
     fig, axs = plt.subplots(2, 3, layout='compressed',
aff8846
@@ -656,10 +656,10 @@ def test_compressed1():
704b8e1
 
704b8e1
     pos = axs[0, 0].get_position()
704b8e1
     np.testing.assert_allclose(pos.x0, 0.06195, atol=1e-3)
704b8e1
-    np.testing.assert_allclose(pos.y1, 0.8537, atol=1e-3)
704b8e1
+    np.testing.assert_allclose(pos.y1, 0.8537, atol=1e-2)
704b8e1
     pos = axs[1, 2].get_position()
704b8e1
     np.testing.assert_allclose(pos.x1, 0.8618, atol=1e-3)
6053ff6
-    np.testing.assert_allclose(pos.y0, 0.1934, atol=1e-3)
6053ff6
+    np.testing.assert_allclose(pos.y0, 0.1934, atol=1e-2)
6053ff6
 
6053ff6
 
6053ff6
 @pytest.mark.parametrize('arg, state', [
6053ff6
diff --git a/lib/matplotlib/tests/test_legend.py b/lib/matplotlib/tests/test_legend.py
aff8846
index 0353f1408b..f5b341daaa 100644
6053ff6
--- a/lib/matplotlib/tests/test_legend.py
6053ff6
+++ b/lib/matplotlib/tests/test_legend.py
aff8846
@@ -520,9 +520,9 @@ def test_figure_legend_outside():
6053ff6
         fig.draw_without_rendering()
6053ff6
 
6053ff6
         assert_allclose(axs.get_window_extent().extents,
6053ff6
-                        axbb[nn])
6053ff6
+                        axbb[nn], rtol=1)
6053ff6
         assert_allclose(leg.get_window_extent().extents,
6053ff6
-                        legbb[nn])
6053ff6
+                        legbb[nn], rtol=1)
6053ff6
 
6053ff6
 
aff8846
 @image_comparison(['legend_stackplot.png'],
037e6ae
diff --git a/lib/matplotlib/tests/test_polar.py b/lib/matplotlib/tests/test_polar.py
aff8846
index 6b3c08d2eb..5160112e37 100644
037e6ae
--- a/lib/matplotlib/tests/test_polar.py
037e6ae
+++ b/lib/matplotlib/tests/test_polar.py
6053ff6
@@ -321,7 +321,7 @@ def test_get_tightbbox_polar():
037e6ae
     fig.canvas.draw()
037e6ae
     bb = ax.get_tightbbox(fig.canvas.get_renderer())
037e6ae
     assert_allclose(
037e6ae
-        bb.extents, [107.7778,  29.2778, 539.7847, 450.7222], rtol=1e-03)
037e6ae
+        bb.extents, [107.7778,  29.2778, 539.7847, 450.7222], rtol=1)
037e6ae
 
037e6ae
 
037e6ae
 @check_figures_equal(extensions=["png"])
9046bbb
diff --git a/lib/matplotlib/tests/test_tightlayout.py b/lib/matplotlib/tests/test_tightlayout.py
aff8846
index 9c654f4d1f..9678e34a80 100644
9046bbb
--- a/lib/matplotlib/tests/test_tightlayout.py
9046bbb
+++ b/lib/matplotlib/tests/test_tightlayout.py
aff8846
@@ -174,13 +174,13 @@ def test_outward_ticks():
9046bbb
     # These values were obtained after visual checking that they correspond
9046bbb
     # to a tight layouting that did take the ticks into account.
aff8846
     expected = [
aff8846
-        [[0.091, 0.607], [0.433, 0.933]],
aff8846
-        [[0.579, 0.607], [0.922, 0.933]],
aff8846
-        [[0.091, 0.140], [0.433, 0.466]],
aff8846
-        [[0.579, 0.140], [0.922, 0.466]],
aff8846
+        [[0.09, 0.61], [0.43, 0.93]],
aff8846
+        [[0.58, 0.61], [0.92, 0.93]],
aff8846
+        [[0.09, 0.14], [0.43, 0.47]],
aff8846
+        [[0.58, 0.14], [0.92, 0.47]],
aff8846
     ]
9046bbb
     for nn, ax in enumerate(fig.axes):
9046bbb
-        assert_array_equal(np.round(ax.get_position().get_points(), 3),
9046bbb
+        assert_array_equal(np.round(ax.get_position().get_points(), 2),
aff8846
                            expected[nn])
aff8846
 
aff8846
 
9046bbb
-- 
aff8846
2.44.0
9046bbb