python-matplotlib/0002-Set-FreeType-version-t...

115 lines
5.0 KiB
Diff
Raw Normal View History

2019-11-23 01:10:32 +00:00
From 53e911c1eb6b840036acfd6b630439bc55b4bdca Mon Sep 17 00:00:00 2001
2019-05-31 05:44:54 +00:00
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Sat, 4 May 2019 04:36:45 -0400
Subject: [PATCH 2/4] Set FreeType version to 2.10.0 and update tolerances.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
2019-11-23 01:10:32 +00:00
lib/matplotlib/__init__.py | 2 +-
lib/matplotlib/tests/test_axes.py | 6 +++---
lib/matplotlib/tests/test_constrainedlayout.py | 2 +-
lib/matplotlib/tests/test_tightlayout.py | 10 +++++-----
setupext.py | 5 ++++-
5 files changed, 14 insertions(+), 11 deletions(-)
2019-05-31 05:44:54 +00:00
diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py
2019-11-23 01:10:32 +00:00
index 7a4115491..1bf9d3e03 100644
2019-05-31 05:44:54 +00:00
--- a/lib/matplotlib/__init__.py
+++ b/lib/matplotlib/__init__.py
2019-11-23 01:10:32 +00:00
@@ -1361,7 +1361,7 @@ 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'
+ LOCAL_FREETYPE_VERSION = '2.10.0'
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
2019-11-23 01:10:32 +00:00
index 8ff5ac45d..25f5695f3 100644
2019-05-31 05:44:54 +00:00
--- a/lib/matplotlib/tests/test_axes.py
+++ b/lib/matplotlib/tests/test_axes.py
2019-11-23 01:10:32 +00:00
@@ -6198,7 +6198,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],
2019-11-23 01:10:32 +00:00
@@ -6216,7 +6216,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
@@ -6341,7 +6341,7 @@ def test_get_tightbbox_polar():
2019-05-31 05:44:54 +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)
+ [107.7778, 29.2778, 539.7847, 450.7222], rtol=1)
@check_figures_equal(extensions=["png"])
2019-11-23 01:10:32 +00:00
diff --git a/lib/matplotlib/tests/test_constrainedlayout.py b/lib/matplotlib/tests/test_constrainedlayout.py
index 8769fcec3..e9ae292f6 100644
--- a/lib/matplotlib/tests/test_constrainedlayout.py
+++ b/lib/matplotlib/tests/test_constrainedlayout.py
@@ -416,4 +416,4 @@ def test_hidden_axes():
extents1 = np.copy(axs[0, 0].get_position().extents)
np.testing.assert_allclose(extents1,
- [0.045552, 0.548288, 0.47319, 0.982638], rtol=1e-5)
+ [0.045552, 0.548288, 0.47319, 0.982638], rtol=1e-2)
2019-05-31 05:44:54 +00:00
diff --git a/lib/matplotlib/tests/test_tightlayout.py b/lib/matplotlib/tests/test_tightlayout.py
index 0b9469cb8..7963b82ff 100644
--- a/lib/matplotlib/tests/test_tightlayout.py
+++ b/lib/matplotlib/tests/test_tightlayout.py
@@ -186,12 +186,12 @@ def test_outward_ticks():
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
index 3e8b382cc..2a3fc3ee7 100644
--- a/setupext.py
+++ b/setupext.py
@@ -135,12 +135,15 @@ _freetype_hashes = {
'2.7.1': '162ef25aa64480b1189cdb261228e6c5c44f212aac4b4621e28cf2157efb59f5',
'2.8': '33a28fabac471891d0523033e99c0005b95e5618dc8ffa7fa47f9dadcacb1c9b',
'2.8.1': '876711d064a6a1bd74beb18dd37f219af26100f72daaebd2d86cb493d7cd7ec6',
+ '2.9': 'bf380e4d7c4f3b5b1c1a7b2bf3abb967bda5e9ab480d0df656e0e08c5019c5e6',
+ '2.9.1': 'ec391504e55498adceb30baceebd147a6e963f636eb617424bcfc47a169898ce',
+ '2.10.0': '955e17244e9b38adb0c98df66abb50467312e6bb70eac07e49ce6bd1a20e809a',
}
# This is the version of FreeType to use when building a local
# version. It must match the value in
# lib/matplotlib.__init__.py and also needs to be changed below in the
# embedded windows build script (grep for "REMINDER" in this file)
-LOCAL_FREETYPE_VERSION = '2.6.1'
+LOCAL_FREETYPE_VERSION = '2.10.0'
LOCAL_FREETYPE_HASH = _freetype_hashes.get(LOCAL_FREETYPE_VERSION, 'unknown')
--
2.21.0