From 794ddb89d637defb7dd7047c654e01fcde0dbb61 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 4 Jun 2021 03:32:13 -0400 Subject: [PATCH] Workaround test failures with texlive 2021. --- 0001-matplotlibrc-path-search-fix.patch | 14 ++++----- ...sion-to-2.10.4-and-update-tolerances.patch | 18 ++++++------ ...-increase-tolerance-on-rcupdate-test.patch | 26 +++++++++++++++++ ...Use-new-style-for-test_text_urls_tex.patch | 29 +++++++++++++++++++ python-matplotlib.spec | 9 ++++++ 5 files changed, 80 insertions(+), 16 deletions(-) create mode 100644 0003-Slightly-increase-tolerance-on-rcupdate-test.patch create mode 100644 0004-Use-new-style-for-test_text_urls_tex.patch diff --git a/0001-matplotlibrc-path-search-fix.patch b/0001-matplotlibrc-path-search-fix.patch index 5c44103..bf3ddbd 100644 --- a/0001-matplotlibrc-path-search-fix.patch +++ b/0001-matplotlibrc-path-search-fix.patch @@ -1,7 +1,7 @@ -From 92b11ded669267100e3c6858578351cad3749cd0 Mon Sep 17 00:00:00 2001 +From 6277ea0c008b02cd2abe017d041b43a35a407c6c Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 27 Sep 2017 19:35:59 -0400 -Subject: [PATCH 1/3] matplotlibrc path search fix +Subject: [PATCH 1/4] matplotlibrc path search fix Signed-off-by: Elliott Sales de Andrade --- @@ -9,10 +9,10 @@ Signed-off-by: Elliott Sales de Andrade 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py -index c3d4aaf62d..ec115cd3f5 100644 +index 71c68a3d6b..9d795f65f5 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py -@@ -471,7 +471,8 @@ def get_cachedir(): +@@ -473,7 +473,8 @@ def get_cachedir(): @_logged_cached('matplotlib data path: %s') def get_data_path(): """Return the path to Matplotlib data.""" @@ -22,7 +22,7 @@ index c3d4aaf62d..ec115cd3f5 100644 def matplotlib_fname(): -@@ -491,6 +492,7 @@ def matplotlib_fname(): +@@ -493,6 +494,7 @@ def matplotlib_fname(): is not defined) - On other platforms, - ``$HOME/.matplotlib/matplotlibrc`` if ``$HOME`` is defined @@ -30,7 +30,7 @@ index c3d4aaf62d..ec115cd3f5 100644 - Lastly, it looks in ``$MATPLOTLIBDATA/matplotlibrc``, which should always exist. """ -@@ -509,6 +511,7 @@ def matplotlib_fname(): +@@ -511,6 +513,7 @@ def matplotlib_fname(): yield matplotlibrc yield os.path.join(matplotlibrc, 'matplotlibrc') yield os.path.join(get_configdir(), 'matplotlibrc') @@ -39,5 +39,5 @@ index c3d4aaf62d..ec115cd3f5 100644 for fname in gen_candidates(): -- -2.29.2 +2.31.1 diff --git a/0002-Set-FreeType-version-to-2.10.4-and-update-tolerances.patch b/0002-Set-FreeType-version-to-2.10.4-and-update-tolerances.patch index 535e8ea..c42b819 100644 --- a/0002-Set-FreeType-version-to-2.10.4-and-update-tolerances.patch +++ b/0002-Set-FreeType-version-to-2.10.4-and-update-tolerances.patch @@ -1,7 +1,7 @@ -From c970ba953bed9df6670d28cb4421ebd054033590 Mon Sep 17 00:00:00 2001 +From 69ecaadda7a7f59130056458ce9ca6a231aebf5a Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 14 Feb 2020 06:05:42 -0500 -Subject: [PATCH 2/3] Set FreeType version to 2.10.4 and update tolerances. +Subject: [PATCH 2/4] Set FreeType version to 2.10.4 and update tolerances. Signed-off-by: Elliott Sales de Andrade --- @@ -14,10 +14,10 @@ Signed-off-by: Elliott Sales de Andrade 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py -index ec115cd3f5..47c315bde4 100644 +index 9d795f65f5..5755ad73da 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py -@@ -1128,7 +1128,7 @@ default_test_modules = [ +@@ -1137,7 +1137,7 @@ default_test_modules = [ def _init_tests(): # The version of FreeType to install locally for running the # tests. This must match the value in `setupext.py` @@ -27,10 +27,10 @@ index ec115cd3f5..47c315bde4 100644 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 -index ed76af576f..f432713680 100644 +index ec4773d465..d63c200b1b 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py -@@ -6426,7 +6426,7 @@ def test_normal_axes(): +@@ -6500,7 +6500,7 @@ def test_normal_axes(): ] for nn, b in enumerate(bbaxis): targetbb = mtransforms.Bbox.from_bounds(*target[nn]) @@ -39,7 +39,7 @@ index ed76af576f..f432713680 100644 target = [ [150.0, 119.999, 930.0, 11.111], -@@ -6444,7 +6444,7 @@ def test_normal_axes(): +@@ -6518,7 +6518,7 @@ def test_normal_axes(): target = [85.5138, 75.88888, 1021.11, 1017.11] targetbb = mtransforms.Bbox.from_bounds(*target) @@ -62,7 +62,7 @@ index 67474628e7..d3e9d105dc 100644 def test_colorbar_align(): diff --git a/lib/matplotlib/tests/test_polar.py b/lib/matplotlib/tests/test_polar.py -index 389d08b6ee..865780bf62 100644 +index c614eff027..daf4e26fb8 100644 --- a/lib/matplotlib/tests/test_polar.py +++ b/lib/matplotlib/tests/test_polar.py @@ -312,7 +312,7 @@ def test_get_tightbbox_polar(): @@ -119,5 +119,5 @@ index d8d0b6b393..aabb7ed9fd 100644 LOCAL_QHULL_VERSION = '2020.2' -- -2.29.2 +2.31.1 diff --git a/0003-Slightly-increase-tolerance-on-rcupdate-test.patch b/0003-Slightly-increase-tolerance-on-rcupdate-test.patch new file mode 100644 index 0000000..9bbcd0d --- /dev/null +++ b/0003-Slightly-increase-tolerance-on-rcupdate-test.patch @@ -0,0 +1,26 @@ +From e633708795ea2626accc491ef2b118b256015119 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Fri, 4 Jun 2021 02:32:31 -0400 +Subject: [PATCH 3/4] Slightly increase tolerance on rcupdate test. + +Signed-off-by: Elliott Sales de Andrade +--- + lib/matplotlib/tests/test_backend_pgf.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/matplotlib/tests/test_backend_pgf.py b/lib/matplotlib/tests/test_backend_pgf.py +index 75f50ecbf0..0b56f01687 100644 +--- a/lib/matplotlib/tests/test_backend_pgf.py ++++ b/lib/matplotlib/tests/test_backend_pgf.py +@@ -127,7 +127,7 @@ def test_rcupdate(): + 'pgf.preamble': ('\\usepackage[utf8x]{inputenc}' + '\\usepackage[T1]{fontenc}' + '\\usepackage{sfmath}')}] +- tol = [6, 0] ++ tol = [6, 1.28] + for i, rc_set in enumerate(rc_sets): + with mpl.rc_context(rc_set): + for substring, pkg in [('sfmath', 'sfmath'), ('utf8x', 'ucs')]: +-- +2.31.1 + diff --git a/0004-Use-new-style-for-test_text_urls_tex.patch b/0004-Use-new-style-for-test_text_urls_tex.patch new file mode 100644 index 0000000..272acd2 --- /dev/null +++ b/0004-Use-new-style-for-test_text_urls_tex.patch @@ -0,0 +1,29 @@ +From b16f2142a12ef2c49d366634d7798075d1905553 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Fri, 4 Jun 2021 03:20:38 -0400 +Subject: [PATCH 4/4] Use new style for test_text_urls_tex. + +This test does not depend on the font style, just that the annotation +appears over it. Switching to mpl20 style stops using Helvetica, and +thus avoids the issue with texlive 2021 on Fedora Rawhide. + +Signed-off-by: Elliott Sales de Andrade +--- + lib/matplotlib/tests/test_backend_pdf.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/matplotlib/tests/test_backend_pdf.py b/lib/matplotlib/tests/test_backend_pdf.py +index 06bfe1cdb1..548149d19d 100644 +--- a/lib/matplotlib/tests/test_backend_pdf.py ++++ b/lib/matplotlib/tests/test_backend_pdf.py +@@ -238,6 +238,7 @@ def test_text_urls(): + assert annot.Rect[1] == decimal.Decimal(y) * 72 + + ++@pytest.mark.style('mpl20') + @needs_usetex + def test_text_urls_tex(): + pikepdf = pytest.importorskip('pikepdf') +-- +2.31.1 + diff --git a/python-matplotlib.spec b/python-matplotlib.spec index 1cbae79..424cbf8 100644 --- a/python-matplotlib.spec +++ b/python-matplotlib.spec @@ -66,6 +66,9 @@ Source1000: https://github.com/QuLogic/mpl-images/archive/v%{mpl_images_vers Patch1001: 0001-matplotlibrc-path-search-fix.patch # Increase tolerances for new FreeType everywhere: Patch1002: 0002-Set-FreeType-version-to-%{ftver}-and-update-tolerances.patch +# Workarounds for problems with texlive 2021 (#1965547) +Patch1003: 0003-Slightly-increase-tolerance-on-rcupdate-test.patch +Patch1004: 0004-Use-new-style-for-test_text_urls_tex.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -321,6 +324,9 @@ gzip -dc %SOURCE1000 | tar xf - --transform='s~^mpl-images-%{mpl_images_version} # Copy setup.cfg to the builddir cp -p %{SOURCE1} setup.cfg +%patch1003 -p1 +%patch1004 -p1 + %build %set_build_flags @@ -463,6 +469,9 @@ PYTHONDONTWRITEBYTECODE=1 \ %changelog +* Fri Jun 04 2021 Elliott Sales de Andrade - 3.4.2-2 +- Workaround failures with texlive 2021 + * Sat May 08 2021 Elliott Sales de Andrade - 3.4.2-1 - Update to latest version (#1958461)