2023-07-07 01:01:14 +00:00
|
|
|
From 3701d77ac6d708557ccc12dbbfe1ab114d36c319 Mon Sep 17 00:00:00 2001
|
2019-05-31 05:44:54 +00:00
|
|
|
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
2020-03-04 04:05:13 +00:00
|
|
|
Date: Fri, 14 Feb 2020 06:05:42 -0500
|
2023-07-07 01:01:14 +00:00
|
|
|
Subject: [PATCH 3/4] Set FreeType version to 2.13.1 and update tolerances
|
2019-05-31 05:44:54 +00:00
|
|
|
|
|
|
|
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
|
|
|
---
|
2023-07-07 01:01:14 +00:00
|
|
|
lib/matplotlib/__init__.py | 2 +-
|
|
|
|
lib/matplotlib/tests/test_axes.py | 4 ++--
|
|
|
|
.../tests/test_constrainedlayout.py | 8 +++----
|
|
|
|
lib/matplotlib/tests/test_legend.py | 4 ++--
|
|
|
|
lib/matplotlib/tests/test_polar.py | 2 +-
|
|
|
|
lib/matplotlib/tests/test_tightlayout.py | 10 ++++-----
|
|
|
|
setupext.py | 21 +++++++++++++++++--
|
|
|
|
7 files changed, 34 insertions(+), 17 deletions(-)
|
2019-05-31 05:44:54 +00:00
|
|
|
|
|
|
|
diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py
|
2023-07-07 01:01:14 +00:00
|
|
|
index 06fb76827d..0760141c77 100644
|
2019-05-31 05:44:54 +00:00
|
|
|
--- a/lib/matplotlib/__init__.py
|
|
|
|
+++ b/lib/matplotlib/__init__.py
|
2023-07-07 01:01:14 +00:00
|
|
|
@@ -1288,7 +1288,7 @@ def is_interactive():
|
2020-03-04 04:05:13 +00:00
|
|
|
def _init_tests():
|
2019-05-31 05:44:54 +00:00
|
|
|
# The version of FreeType to install locally for running the
|
|
|
|
# tests. This must match the value in `setupext.py`
|
|
|
|
- LOCAL_FREETYPE_VERSION = '2.6.1'
|
2023-07-07 01:01:14 +00:00
|
|
|
+ LOCAL_FREETYPE_VERSION = '2.13.1'
|
2019-05-31 05:44:54 +00:00
|
|
|
|
|
|
|
from matplotlib import ft2font
|
|
|
|
if (ft2font.__freetype_version__ != LOCAL_FREETYPE_VERSION or
|
|
|
|
diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py
|
2023-07-07 01:01:14 +00:00
|
|
|
index cef1c76af6..f1b7a0e884 100644
|
2019-05-31 05:44:54 +00:00
|
|
|
--- a/lib/matplotlib/tests/test_axes.py
|
|
|
|
+++ b/lib/matplotlib/tests/test_axes.py
|
2023-07-07 01:01:14 +00:00
|
|
|
@@ -7433,7 +7433,7 @@ def test_normal_axes():
|
2019-05-31 05:44:54 +00:00
|
|
|
]
|
|
|
|
for nn, b in enumerate(bbaxis):
|
|
|
|
targetbb = mtransforms.Bbox.from_bounds(*target[nn])
|
|
|
|
- assert_array_almost_equal(b.bounds, targetbb.bounds, decimal=2)
|
|
|
|
+ assert_array_almost_equal(b.bounds, targetbb.bounds, decimal=0)
|
|
|
|
|
|
|
|
target = [
|
|
|
|
[150.0, 119.999, 930.0, 11.111],
|
2023-07-07 01:01:14 +00:00
|
|
|
@@ -7451,7 +7451,7 @@ def test_normal_axes():
|
2019-05-31 05:44:54 +00:00
|
|
|
|
|
|
|
target = [85.5138, 75.88888, 1021.11, 1017.11]
|
|
|
|
targetbb = mtransforms.Bbox.from_bounds(*target)
|
|
|
|
- assert_array_almost_equal(bbtb.bounds, targetbb.bounds, decimal=2)
|
|
|
|
+ assert_array_almost_equal(bbtb.bounds, targetbb.bounds, decimal=0)
|
|
|
|
|
|
|
|
# test that get_position roundtrips to get_window_extent
|
|
|
|
axbb = ax.get_position().transformed(fig.transFigure).bounds
|
2019-11-23 01:10:32 +00:00
|
|
|
diff --git a/lib/matplotlib/tests/test_constrainedlayout.py b/lib/matplotlib/tests/test_constrainedlayout.py
|
2023-07-07 01:01:14 +00:00
|
|
|
index ee08c375c7..8d72db556b 100644
|
2019-11-23 01:10:32 +00:00
|
|
|
--- a/lib/matplotlib/tests/test_constrainedlayout.py
|
|
|
|
+++ b/lib/matplotlib/tests/test_constrainedlayout.py
|
2023-07-07 01:01:14 +00:00
|
|
|
@@ -432,7 +432,7 @@ def test_hidden_axes():
|
2019-11-23 01:10:32 +00:00
|
|
|
extents1 = np.copy(axs[0, 0].get_position().extents)
|
|
|
|
|
2020-06-30 00:38:52 +00:00
|
|
|
np.testing.assert_allclose(
|
2021-02-19 10:46:28 +00:00
|
|
|
- extents1, [0.045552, 0.543288, 0.47819, 0.982638], rtol=1e-5)
|
|
|
|
+ extents1, [0.045552, 0.543288, 0.47819, 0.982638], rtol=1e-2)
|
|
|
|
|
|
|
|
|
|
|
|
def test_colorbar_align():
|
2023-07-07 01:01:14 +00:00
|
|
|
@@ -638,7 +638,7 @@ def test_compressed1():
|
2022-08-20 09:48:01 +00:00
|
|
|
fig.draw_without_rendering()
|
|
|
|
|
|
|
|
pos = axs[0, 0].get_position()
|
|
|
|
- np.testing.assert_allclose(pos.x0, 0.2344, atol=1e-3)
|
|
|
|
+ np.testing.assert_allclose(pos.x0, 0.2344, atol=1e-2)
|
|
|
|
pos = axs[0, 1].get_position()
|
|
|
|
np.testing.assert_allclose(pos.x1, 0.7024, atol=1e-3)
|
|
|
|
|
2023-07-07 01:01:14 +00:00
|
|
|
@@ -653,10 +653,10 @@ def test_compressed1():
|
2022-08-20 09:48:01 +00:00
|
|
|
|
|
|
|
pos = axs[0, 0].get_position()
|
|
|
|
np.testing.assert_allclose(pos.x0, 0.06195, atol=1e-3)
|
|
|
|
- np.testing.assert_allclose(pos.y1, 0.8537, atol=1e-3)
|
|
|
|
+ np.testing.assert_allclose(pos.y1, 0.8537, atol=1e-2)
|
|
|
|
pos = axs[1, 2].get_position()
|
|
|
|
np.testing.assert_allclose(pos.x1, 0.8618, atol=1e-3)
|
2023-02-28 03:29:17 +00:00
|
|
|
- np.testing.assert_allclose(pos.y0, 0.1934, atol=1e-3)
|
|
|
|
+ np.testing.assert_allclose(pos.y0, 0.1934, atol=1e-2)
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize('arg, state', [
|
|
|
|
diff --git a/lib/matplotlib/tests/test_legend.py b/lib/matplotlib/tests/test_legend.py
|
|
|
|
index a8d7fd107d..cbca9e93e9 100644
|
|
|
|
--- a/lib/matplotlib/tests/test_legend.py
|
|
|
|
+++ b/lib/matplotlib/tests/test_legend.py
|
|
|
|
@@ -522,9 +522,9 @@ def test_figure_legend_outside():
|
|
|
|
fig.draw_without_rendering()
|
|
|
|
|
|
|
|
assert_allclose(axs.get_window_extent().extents,
|
|
|
|
- axbb[nn])
|
|
|
|
+ axbb[nn], rtol=1)
|
|
|
|
assert_allclose(leg.get_window_extent().extents,
|
|
|
|
- legbb[nn])
|
|
|
|
+ legbb[nn], rtol=1)
|
|
|
|
|
|
|
|
|
|
|
|
@image_comparison(['legend_stackplot.png'])
|
2020-06-30 00:38:52 +00:00
|
|
|
diff --git a/lib/matplotlib/tests/test_polar.py b/lib/matplotlib/tests/test_polar.py
|
2023-07-07 01:01:14 +00:00
|
|
|
index 9d6e78da2c..5f6ed538d1 100644
|
2020-06-30 00:38:52 +00:00
|
|
|
--- a/lib/matplotlib/tests/test_polar.py
|
|
|
|
+++ b/lib/matplotlib/tests/test_polar.py
|
2023-02-28 03:29:17 +00:00
|
|
|
@@ -321,7 +321,7 @@ def test_get_tightbbox_polar():
|
2020-06-30 00:38:52 +00:00
|
|
|
fig.canvas.draw()
|
|
|
|
bb = ax.get_tightbbox(fig.canvas.get_renderer())
|
|
|
|
assert_allclose(
|
|
|
|
- bb.extents, [107.7778, 29.2778, 539.7847, 450.7222], rtol=1e-03)
|
|
|
|
+ bb.extents, [107.7778, 29.2778, 539.7847, 450.7222], rtol=1)
|
|
|
|
|
|
|
|
|
|
|
|
@check_figures_equal(extensions=["png"])
|
2019-05-31 05:44:54 +00:00
|
|
|
diff --git a/lib/matplotlib/tests/test_tightlayout.py b/lib/matplotlib/tests/test_tightlayout.py
|
2023-02-28 03:29:17 +00:00
|
|
|
index 968f0da7b5..89caa81b98 100644
|
2019-05-31 05:44:54 +00:00
|
|
|
--- a/lib/matplotlib/tests/test_tightlayout.py
|
|
|
|
+++ b/lib/matplotlib/tests/test_tightlayout.py
|
2022-08-20 09:48:01 +00:00
|
|
|
@@ -173,12 +173,12 @@ def test_outward_ticks():
|
2019-05-31 05:44:54 +00:00
|
|
|
plt.tight_layout()
|
|
|
|
# These values were obtained after visual checking that they correspond
|
|
|
|
# to a tight layouting that did take the ticks into account.
|
|
|
|
- ans = [[[0.091, 0.607], [0.433, 0.933]],
|
|
|
|
- [[0.579, 0.607], [0.922, 0.933]],
|
|
|
|
- [[0.091, 0.140], [0.433, 0.466]],
|
|
|
|
- [[0.579, 0.140], [0.922, 0.466]]]
|
|
|
|
+ ans = [[[0.09, 0.61], [0.43, 0.93]],
|
|
|
|
+ [[0.58, 0.61], [0.92, 0.93]],
|
|
|
|
+ [[0.09, 0.14], [0.43, 0.47]],
|
|
|
|
+ [[0.58, 0.14], [0.92, 0.47]]]
|
|
|
|
for nn, ax in enumerate(fig.axes):
|
|
|
|
- assert_array_equal(np.round(ax.get_position().get_points(), 3),
|
|
|
|
+ assert_array_equal(np.round(ax.get_position().get_points(), 2),
|
|
|
|
ans[nn])
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/setupext.py b/setupext.py
|
2023-07-07 01:01:14 +00:00
|
|
|
index a898d642d6..b22d875d6f 100644
|
2019-05-31 05:44:54 +00:00
|
|
|
--- a/setupext.py
|
|
|
|
+++ b/setupext.py
|
2023-07-07 01:01:14 +00:00
|
|
|
@@ -176,13 +176,29 @@ _freetype_hashes = {
|
2020-07-19 03:14:00 +00:00
|
|
|
'955e17244e9b38adb0c98df66abb50467312e6bb70eac07e49ce6bd1a20e809a',
|
|
|
|
'2.10.1':
|
|
|
|
'3a60d391fd579440561bf0e7f31af2222bc610ad6ce4d9d7bd2165bca8669110',
|
|
|
|
+ '2.10.2':
|
|
|
|
+ 'e09aa914e4f7a5d723ac381420949c55c0b90b15744adce5d1406046022186ab',
|
2023-07-07 01:01:14 +00:00
|
|
|
+ '2.10.3':
|
|
|
|
+ '9dfb4e11efd6e460a87b1991a64bc69344ee7dc219d9b29e7faabc1c168ce8b0',
|
2020-11-12 06:35:38 +00:00
|
|
|
+ '2.10.4':
|
|
|
|
+ '5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01b2c953269f658dac',
|
2021-08-10 00:22:32 +00:00
|
|
|
+ '2.11.0':
|
|
|
|
+ 'a45c6b403413abd5706f3582f04c8339d26397c4304b78fa552f2215df64101f',
|
2022-05-04 23:14:19 +00:00
|
|
|
'2.11.1':
|
2022-08-12 20:43:30 +00:00
|
|
|
- 'f8db94d307e9c54961b39a1cc799a67d46681480696ed72ecf78d4473770f09b'
|
|
|
|
+ 'f8db94d307e9c54961b39a1cc799a67d46681480696ed72ecf78d4473770f09b',
|
|
|
|
+ '2.12.0':
|
|
|
|
+ '7940a46eeb0255baaa87c553d72778c4f8daa2b8888c8e2a05766a2a8686740c',
|
|
|
|
+ '2.12.1':
|
|
|
|
+ 'efe71fd4b8246f1b0b1b9bfca13cfff1c9ad85930340c27df469733bbb620938',
|
2023-07-07 01:01:14 +00:00
|
|
|
+ '2.13.0':
|
|
|
|
+ 'a7aca0e532a276ea8d85bd31149f0a74c33d19c8d287116ef8f5f8357b4f1f80',
|
|
|
|
+ '2.13.1':
|
|
|
|
+ '0b109c59914f25b4411a8de2a506fdd18fa8457eb86eca6c7b15c19110a92fa5',
|
2020-07-19 03:14:00 +00:00
|
|
|
}
|
2022-08-12 20:43:30 +00:00
|
|
|
# This is the version of FreeType to use when building a local version. It
|
2022-08-20 09:48:01 +00:00
|
|
|
# must match the value in lib/matplotlib.__init__.py, and the cache path in
|
|
|
|
# `.circleci/config.yml`.
|
2022-05-04 23:14:19 +00:00
|
|
|
-TESTING_VERSION_OF_FREETYPE = '2.6.1'
|
2023-07-07 01:01:14 +00:00
|
|
|
+TESTING_VERSION_OF_FREETYPE = '2.13.1'
|
2022-05-04 23:14:19 +00:00
|
|
|
if sys.platform.startswith('win') and platform.machine() == 'ARM64':
|
|
|
|
# older versions of freetype are not supported for win/arm64
|
|
|
|
# Matplotlib tests will not pass
|
2023-07-07 01:01:14 +00:00
|
|
|
@@ -597,6 +613,7 @@ class FreeType(SetupPackage):
|
2021-08-10 00:22:32 +00:00
|
|
|
ext.extra_objects.insert(
|
|
|
|
0, str(src_path / 'objs' / '.libs' / libfreetype))
|
|
|
|
ext.define_macros.append(('FREETYPE_BUILD_TYPE', 'local'))
|
|
|
|
+ ext.libraries.append('brotlidec')
|
|
|
|
|
|
|
|
def do_custom_build(self, env):
|
|
|
|
# We're using a system freetype
|
2019-05-31 05:44:54 +00:00
|
|
|
--
|
2023-06-22 08:56:24 +00:00
|
|
|
2.41.0
|
2019-05-31 05:44:54 +00:00
|
|
|
|