1b16bcd
From a5490ca593e1515bddbc96491efd8d1ff5e372d6 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
acd2786
Subject: [PATCH 3/5] Set FreeType version to 2.13.1 and update tolerances
9046bbb
9046bbb
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
9046bbb
---
05ffcff
 lib/matplotlib/__init__.py                    |  2 +-
05ffcff
 lib/matplotlib/tests/test_axes.py             |  4 ++--
acd2786
 lib/matplotlib/tests/test_backend_pgf.py      |  2 +-
acd2786
 .../tests/test_constrainedlayout.py           | 10 ++++-----
05ffcff
 lib/matplotlib/tests/test_legend.py           |  4 ++--
05ffcff
 lib/matplotlib/tests/test_polar.py            |  2 +-
05ffcff
 lib/matplotlib/tests/test_tightlayout.py      | 10 ++++-----
05ffcff
 setupext.py                                   | 21 +++++++++++++++++--
acd2786
 8 files changed, 36 insertions(+), 19 deletions(-)
9046bbb
9046bbb
diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py
1b16bcd
index 26dd9372e1..81b77d455f 100644
9046bbb
--- a/lib/matplotlib/__init__.py
9046bbb
+++ b/lib/matplotlib/__init__.py
acd2786
@@ -1307,7 +1307,7 @@ def _val_or_rc(val, rc_name):
e6f3591
 def _init_tests():
9046bbb
     # The version of FreeType to install locally for running the
9046bbb
     # tests.  This must match the value in `setupext.py`
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
1b16bcd
index 6c5dd712b7..0a70c37891 100644
9046bbb
--- a/lib/matplotlib/tests/test_axes.py
9046bbb
+++ b/lib/matplotlib/tests/test_axes.py
1b16bcd
@@ -7623,7 +7623,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],
1b16bcd
@@ -7641,7 +7641,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
acd2786
index a866916c58..a746cc2ca9 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
acd2786
index 6703dfe315..ea6a8d9630 100644
1f37c6a
--- a/lib/matplotlib/tests/test_constrainedlayout.py
1f37c6a
+++ b/lib/matplotlib/tests/test_constrainedlayout.py
05ffcff
@@ -432,7 +432,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():
acd2786
@@ -638,9 +638,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',
05ffcff
@@ -653,10 +653,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
acd2786
index 759ac6aada..8140d4d69f 100644
6053ff6
--- a/lib/matplotlib/tests/test_legend.py
6053ff6
+++ b/lib/matplotlib/tests/test_legend.py
acd2786
@@ -516,9 +516,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
 
6053ff6
 @image_comparison(['legend_stackplot.png'])
037e6ae
diff --git a/lib/matplotlib/tests/test_polar.py b/lib/matplotlib/tests/test_polar.py
05ffcff
index 9d6e78da2c..5f6ed538d1 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
6053ff6
index 968f0da7b5..89caa81b98 100644
9046bbb
--- a/lib/matplotlib/tests/test_tightlayout.py
9046bbb
+++ b/lib/matplotlib/tests/test_tightlayout.py
704b8e1
@@ -173,12 +173,12 @@ def test_outward_ticks():
9046bbb
     plt.tight_layout()
9046bbb
     # These values were obtained after visual checking that they correspond
9046bbb
     # to a tight layouting that did take the ticks into account.
9046bbb
-    ans = [[[0.091, 0.607], [0.433, 0.933]],
9046bbb
-           [[0.579, 0.607], [0.922, 0.933]],
9046bbb
-           [[0.091, 0.140], [0.433, 0.466]],
9046bbb
-           [[0.579, 0.140], [0.922, 0.466]]]
9046bbb
+    ans = [[[0.09, 0.61], [0.43, 0.93]],
9046bbb
+           [[0.58, 0.61], [0.92, 0.93]],
9046bbb
+           [[0.09, 0.14], [0.43, 0.47]],
9046bbb
+           [[0.58, 0.14], [0.92, 0.47]]]
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),
9046bbb
                            ans[nn])
9046bbb
 
9046bbb
 
9046bbb
diff --git a/setupext.py b/setupext.py
acd2786
index 9f78d88c87..6dc740e8f7 100644
9046bbb
--- a/setupext.py
9046bbb
+++ b/setupext.py
acd2786
@@ -176,14 +176,30 @@ _freetype_hashes = {
26c79f2
         '955e17244e9b38adb0c98df66abb50467312e6bb70eac07e49ce6bd1a20e809a',
26c79f2
     '2.10.1':
26c79f2
         '3a60d391fd579440561bf0e7f31af2222bc610ad6ce4d9d7bd2165bca8669110',
26c79f2
+    '2.10.2':
26c79f2
+        'e09aa914e4f7a5d723ac381420949c55c0b90b15744adce5d1406046022186ab',
05ffcff
+    '2.10.3':
05ffcff
+        '9dfb4e11efd6e460a87b1991a64bc69344ee7dc219d9b29e7faabc1c168ce8b0',
c24355d
+    '2.10.4':
c24355d
+        '5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01b2c953269f658dac',
bb0eaa7
+    '2.11.0':
bb0eaa7
+        'a45c6b403413abd5706f3582f04c8339d26397c4304b78fa552f2215df64101f',
f97a7a2
     '2.11.1':
d955e87
-        'f8db94d307e9c54961b39a1cc799a67d46681480696ed72ecf78d4473770f09b'
d955e87
+        'f8db94d307e9c54961b39a1cc799a67d46681480696ed72ecf78d4473770f09b',
d955e87
+    '2.12.0':
d955e87
+        '7940a46eeb0255baaa87c553d72778c4f8daa2b8888c8e2a05766a2a8686740c',
d955e87
+    '2.12.1':
d955e87
+        'efe71fd4b8246f1b0b1b9bfca13cfff1c9ad85930340c27df469733bbb620938',
05ffcff
+    '2.13.0':
05ffcff
+        'a7aca0e532a276ea8d85bd31149f0a74c33d19c8d287116ef8f5f8357b4f1f80',
05ffcff
+    '2.13.1':
05ffcff
+        '0b109c59914f25b4411a8de2a506fdd18fa8457eb86eca6c7b15c19110a92fa5',
26c79f2
 }
d955e87
 # This is the version of FreeType to use when building a local version.  It
704b8e1
 # must match the value in lib/matplotlib.__init__.py, and the cache path in
acd2786
 # `.circleci/config.yml`. Also update the docs in
acd2786
 # `docs/devel/dependencies.rst`.
f97a7a2
-TESTING_VERSION_OF_FREETYPE = '2.6.1'
05ffcff
+TESTING_VERSION_OF_FREETYPE = '2.13.1'
f97a7a2
 if sys.platform.startswith('win') and platform.machine() == 'ARM64':
f97a7a2
     # older versions of freetype are not supported for win/arm64
f97a7a2
     # Matplotlib tests will not pass
acd2786
@@ -599,6 +615,7 @@ class FreeType(SetupPackage):
acd2786
                 name = ext.name.split('.')[-1]
acd2786
                 ext.extra_link_args.append(
acd2786
                     f'-Wl,-exported_symbol,_PyInit_{name}')
bb0eaa7
+            ext.libraries.append('brotlidec')
bb0eaa7
 
bb0eaa7
     def do_custom_build(self, env):
bb0eaa7
         # We're using a system freetype
9046bbb
-- 
545cd05
2.41.0
9046bbb