1 From 00c02f0c02e9927d5bf9cab6f7d276d03afad558 Mon Sep 17 00:00:00 2001
2 From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
3 Date: Fri, 14 Feb 2020 06:05:42 -0500
4 Subject: [PATCH 2/4] Set FreeType version to 2.12.1 and update tolerances.
6 Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
8 lib/matplotlib/__init__.py | 2 +-
9 lib/matplotlib/tests/test_axes.py | 4 ++--
10 lib/matplotlib/tests/test_constrainedlayout.py | 6 +++---
11 lib/matplotlib/tests/test_polar.py | 2 +-
12 lib/matplotlib/tests/test_tightlayout.py | 10 +++++-----
13 setupext.py | 15 +++++++++++++--
14 6 files changed, 25 insertions(+), 14 deletions(-)
16 diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py
17 index 5eae4b50e2..1e68e9b991 100644
18 --- a/lib/matplotlib/__init__.py
19 +++ b/lib/matplotlib/__init__.py
20 @@ -1212,7 +1212,7 @@ default_test_modules = [
22 # The version of FreeType to install locally for running the
23 # tests. This must match the value in `setupext.py`
24 - LOCAL_FREETYPE_VERSION = '2.6.1'
25 + LOCAL_FREETYPE_VERSION = '2.12.1'
27 from matplotlib import ft2font
28 if (ft2font.__freetype_version__ != LOCAL_FREETYPE_VERSION or
29 diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py
30 index a230af2ac1..9cadbd7975 100644
31 --- a/lib/matplotlib/tests/test_axes.py
32 +++ b/lib/matplotlib/tests/test_axes.py
33 @@ -7203,7 +7203,7 @@ def test_normal_axes():
35 for nn, b in enumerate(bbaxis):
36 targetbb = mtransforms.Bbox.from_bounds(*target[nn])
37 - assert_array_almost_equal(b.bounds, targetbb.bounds, decimal=2)
38 + assert_array_almost_equal(b.bounds, targetbb.bounds, decimal=0)
41 [150.0, 119.999, 930.0, 11.111],
42 @@ -7221,7 +7221,7 @@ def test_normal_axes():
44 target = [85.5138, 75.88888, 1021.11, 1017.11]
45 targetbb = mtransforms.Bbox.from_bounds(*target)
46 - assert_array_almost_equal(bbtb.bounds, targetbb.bounds, decimal=2)
47 + assert_array_almost_equal(bbtb.bounds, targetbb.bounds, decimal=0)
49 # test that get_position roundtrips to get_window_extent
50 axbb = ax.get_position().transformed(fig.transFigure).bounds
51 diff --git a/lib/matplotlib/tests/test_backend_svg.py b/lib/matplotlib/tests/test_backend_svg.py
52 index 680efd6737..1c1900a443 100644
53 --- a/lib/matplotlib/tests/test_backend_svg.py
54 +++ b/lib/matplotlib/tests/test_backend_svg.py
55 @@ -74,7 +74,7 @@ def test_bold_font_output():
56 ax.set_title('bold-title', fontweight='bold')
59 -@image_comparison(['bold_font_output_with_none_fonttype.svg'])
60 +@image_comparison(['bold_font_output_with_none_fonttype.svg'], tol=15)
61 def test_bold_font_output_with_none_fonttype():
62 plt.rcParams['svg.fonttype'] = 'none'
63 fig, ax = plt.subplots()
64 diff --git a/lib/matplotlib/tests/test_constrainedlayout.py b/lib/matplotlib/tests/test_constrainedlayout.py
65 index 35eb850fcd..31086ae5b7 100644
66 --- a/lib/matplotlib/tests/test_constrainedlayout.py
67 +++ b/lib/matplotlib/tests/test_constrainedlayout.py
68 @@ -431,7 +431,7 @@ def test_hidden_axes():
69 extents1 = np.copy(axs[0, 0].get_position().extents)
71 np.testing.assert_allclose(
72 - extents1, [0.045552, 0.543288, 0.47819, 0.982638], rtol=1e-5)
73 + extents1, [0.045552, 0.543288, 0.47819, 0.982638], rtol=1e-2)
76 def test_colorbar_align():
77 @@ -637,7 +637,7 @@ def test_compressed1():
78 fig.draw_without_rendering()
80 pos = axs[0, 0].get_position()
81 - np.testing.assert_allclose(pos.x0, 0.2344, atol=1e-3)
82 + np.testing.assert_allclose(pos.x0, 0.2344, atol=1e-2)
83 pos = axs[0, 1].get_position()
84 np.testing.assert_allclose(pos.x1, 0.7024, atol=1e-3)
86 @@ -652,7 +652,7 @@ def test_compressed1():
88 pos = axs[0, 0].get_position()
89 np.testing.assert_allclose(pos.x0, 0.06195, atol=1e-3)
90 - np.testing.assert_allclose(pos.y1, 0.8537, atol=1e-3)
91 + np.testing.assert_allclose(pos.y1, 0.8537, atol=1e-2)
92 pos = axs[1, 2].get_position()
93 np.testing.assert_allclose(pos.x1, 0.8618, atol=1e-3)
94 np.testing.assert_allclose(pos.y0, 0.1934, atol=1e-3)
95 diff --git a/lib/matplotlib/tests/test_polar.py b/lib/matplotlib/tests/test_polar.py
96 index c51508ae22..942ffcb521 100644
97 --- a/lib/matplotlib/tests/test_polar.py
98 +++ b/lib/matplotlib/tests/test_polar.py
99 @@ -314,7 +314,7 @@ def test_get_tightbbox_polar():
101 bb = ax.get_tightbbox(fig.canvas.get_renderer())
103 - bb.extents, [107.7778, 29.2778, 539.7847, 450.7222], rtol=1e-03)
104 + bb.extents, [107.7778, 29.2778, 539.7847, 450.7222], rtol=1)
107 @check_figures_equal(extensions=["png"])
108 diff --git a/lib/matplotlib/tests/test_tightlayout.py b/lib/matplotlib/tests/test_tightlayout.py
109 index 1eb7b4b453..697eba3211 100644
110 --- a/lib/matplotlib/tests/test_tightlayout.py
111 +++ b/lib/matplotlib/tests/test_tightlayout.py
112 @@ -173,12 +173,12 @@ def test_outward_ticks():
114 # These values were obtained after visual checking that they correspond
115 # to a tight layouting that did take the ticks into account.
116 - ans = [[[0.091, 0.607], [0.433, 0.933]],
117 - [[0.579, 0.607], [0.922, 0.933]],
118 - [[0.091, 0.140], [0.433, 0.466]],
119 - [[0.579, 0.140], [0.922, 0.466]]]
120 + ans = [[[0.09, 0.61], [0.43, 0.93]],
121 + [[0.58, 0.61], [0.92, 0.93]],
122 + [[0.09, 0.14], [0.43, 0.47]],
123 + [[0.58, 0.14], [0.92, 0.47]]]
124 for nn, ax in enumerate(fig.axes):
125 - assert_array_equal(np.round(ax.get_position().get_points(), 3),
126 + assert_array_equal(np.round(ax.get_position().get_points(), 2),
130 diff --git a/setupext.py b/setupext.py
131 index 69835c12f7..79ee6174e1 100644
134 @@ -168,13 +168,23 @@ _freetype_hashes = {
135 '955e17244e9b38adb0c98df66abb50467312e6bb70eac07e49ce6bd1a20e809a',
137 '3a60d391fd579440561bf0e7f31af2222bc610ad6ce4d9d7bd2165bca8669110',
139 + 'e09aa914e4f7a5d723ac381420949c55c0b90b15744adce5d1406046022186ab',
141 + '5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01b2c953269f658dac',
143 + 'a45c6b403413abd5706f3582f04c8339d26397c4304b78fa552f2215df64101f',
145 - 'f8db94d307e9c54961b39a1cc799a67d46681480696ed72ecf78d4473770f09b'
146 + 'f8db94d307e9c54961b39a1cc799a67d46681480696ed72ecf78d4473770f09b',
148 + '7940a46eeb0255baaa87c553d72778c4f8daa2b8888c8e2a05766a2a8686740c',
150 + 'efe71fd4b8246f1b0b1b9bfca13cfff1c9ad85930340c27df469733bbb620938',
152 # This is the version of FreeType to use when building a local version. It
153 # must match the value in lib/matplotlib.__init__.py, and the cache path in
154 # `.circleci/config.yml`.
155 -TESTING_VERSION_OF_FREETYPE = '2.6.1'
156 +TESTING_VERSION_OF_FREETYPE = '2.12.1'
157 if sys.platform.startswith('win') and platform.machine() == 'ARM64':
158 # older versions of freetype are not supported for win/arm64
159 # Matplotlib tests will not pass
160 @@ -584,6 +594,7 @@ class FreeType(SetupPackage):
161 ext.extra_objects.insert(
162 0, str(src_path / 'objs' / '.libs' / libfreetype))
163 ext.define_macros.append(('FREETYPE_BUILD_TYPE', 'local'))
164 + ext.libraries.append('brotlidec')
166 def do_custom_build(self, env):
167 # We're using a system freetype