diff --git a/.gitignore b/.gitignore index 6d93381..d6672e2 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,5 @@ matplotlib-1.0.0-without-gpc.tar.gz /matplotlib-3.4.1-with-freetype-2.11.0.tar.gz /matplotlib-3.4.3.tar.gz /matplotlib-3.4.3-with-freetype-2.11.0.tar.gz +/matplotlib-3.5.0b1.tar.gz +/matplotlib-3.5.0b1-with-freetype-2.11.0.tar.gz diff --git a/0001-matplotlibrc-path-search-fix.patch b/0001-matplotlibrc-path-search-fix.patch index 3f445aa..02308d3 100644 --- a/0001-matplotlibrc-path-search-fix.patch +++ b/0001-matplotlibrc-path-search-fix.patch @@ -1,4 +1,4 @@ -From fc48d068c9e28cdd82e93db2248ff2fa6facc986 Mon Sep 17 00:00:00 2001 +From 40ffe133485dba72cdfcb50ec4a11ef69e92c7ea Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 27 Sep 2017 19:35:59 -0400 Subject: [PATCH 1/4] matplotlibrc path search fix @@ -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 71c68a3d6b..9d795f65f5 100644 +index 0361a37aed..d58e5c3278 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py -@@ -473,7 +473,8 @@ def get_cachedir(): +@@ -524,7 +524,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 71c68a3d6b..9d795f65f5 100644 def matplotlib_fname(): -@@ -493,6 +494,7 @@ def matplotlib_fname(): +@@ -544,6 +545,7 @@ def matplotlib_fname(): is not defined) - On other platforms, - ``$HOME/.matplotlib/matplotlibrc`` if ``$HOME`` is defined @@ -30,7 +30,7 @@ index 71c68a3d6b..9d795f65f5 100644 - Lastly, it looks in ``$MATPLOTLIBDATA/matplotlibrc``, which should always exist. """ -@@ -511,6 +513,7 @@ def matplotlib_fname(): +@@ -562,6 +564,7 @@ def matplotlib_fname(): yield matplotlibrc yield os.path.join(matplotlibrc, 'matplotlibrc') yield os.path.join(get_configdir(), 'matplotlibrc') diff --git a/0002-Set-FreeType-version-to-2.11.0-and-update-tolerances.patch b/0002-Set-FreeType-version-to-2.11.0-and-update-tolerances.patch index 081afe2..bacba0e 100644 --- a/0002-Set-FreeType-version-to-2.11.0-and-update-tolerances.patch +++ b/0002-Set-FreeType-version-to-2.11.0-and-update-tolerances.patch @@ -1,4 +1,4 @@ -From 8e37877bc09957a50ee2f181b62447adb14d5162 Mon Sep 17 00:00:00 2001 +From 91ec30ea100a1632b6843b201554f28363aa1677 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 14 Feb 2020 06:05:42 -0500 Subject: [PATCH 2/4] Set FreeType version to 2.11.0 and update tolerances. @@ -15,10 +15,10 @@ Signed-off-by: Elliott Sales de Andrade 7 files changed, 23 insertions(+), 13 deletions(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py -index 9d795f65f5..f01024109b 100644 +index d58e5c3278..b28e192138 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py -@@ -1137,7 +1137,7 @@ default_test_modules = [ +@@ -1199,7 +1199,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` @@ -28,10 +28,10 @@ index 9d795f65f5..f01024109b 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 7950e5b830..046dbbe1b8 100644 +index 509910bdee..5b6607a696 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py -@@ -6500,7 +6500,7 @@ def test_normal_axes(): +@@ -6530,7 +6530,7 @@ def test_normal_axes(): ] for nn, b in enumerate(bbaxis): targetbb = mtransforms.Bbox.from_bounds(*target[nn]) @@ -40,7 +40,7 @@ index 7950e5b830..046dbbe1b8 100644 target = [ [150.0, 119.999, 930.0, 11.111], -@@ -6518,7 +6518,7 @@ def test_normal_axes(): +@@ -6548,7 +6548,7 @@ def test_normal_axes(): target = [85.5138, 75.88888, 1021.11, 1017.11] targetbb = mtransforms.Bbox.from_bounds(*target) @@ -50,10 +50,10 @@ index 7950e5b830..046dbbe1b8 100644 # test that get_position roundtrips to get_window_extent axbb = ax.get_position().transformed(fig.transFigure).bounds diff --git a/lib/matplotlib/tests/test_constrainedlayout.py b/lib/matplotlib/tests/test_constrainedlayout.py -index 117b221cc2..d009912dfa 100644 +index 007fac6ec1..a8bb740779 100644 --- a/lib/matplotlib/tests/test_constrainedlayout.py +++ b/lib/matplotlib/tests/test_constrainedlayout.py -@@ -429,7 +429,7 @@ def test_hidden_axes(): +@@ -411,7 +411,7 @@ def test_hidden_axes(): extents1 = np.copy(axs[0, 0].get_position().extents) np.testing.assert_allclose( @@ -63,17 +63,17 @@ index 117b221cc2..d009912dfa 100644 def test_colorbar_align(): diff --git a/lib/matplotlib/tests/test_mathtext.py b/lib/matplotlib/tests/test_mathtext.py -index b5fd906d2f..8e3801a231 100644 +index 768db940c7..3ce83763eb 100644 --- a/lib/matplotlib/tests/test_mathtext.py +++ b/lib/matplotlib/tests/test_mathtext.py @@ -1,5 +1,6 @@ import io - import os + from pathlib import Path +import platform import re - - import numpy as np -@@ -189,7 +190,8 @@ def baseline_images(request, fontset, index, text): + import shlex + from xml.etree import ElementTree as ET +@@ -191,7 +192,8 @@ def baseline_images(request, fontset, index, text): @pytest.mark.parametrize( 'fontset', ['cm', 'stix', 'stixsans', 'dejavusans', 'dejavuserif']) @pytest.mark.parametrize('baseline_images', ['mathtext'], indirect=True) @@ -83,7 +83,7 @@ index b5fd906d2f..8e3801a231 100644 def test_mathtext_rendering(baseline_images, fontset, index, text): mpl.rcParams['mathtext.fontset'] = fontset fig = plt.figure(figsize=(5.25, 0.75)) -@@ -213,7 +215,8 @@ def test_mathtext_rendering_lightweight(baseline_images, fontset, index, text): +@@ -215,7 +217,8 @@ def test_mathtext_rendering_lightweight(baseline_images, fontset, index, text): @pytest.mark.parametrize( 'fontset', ['cm', 'stix', 'stixsans', 'dejavusans', 'dejavuserif']) @pytest.mark.parametrize('baseline_images', ['mathfont'], indirect=True) @@ -94,10 +94,10 @@ index b5fd906d2f..8e3801a231 100644 mpl.rcParams['mathtext.fontset'] = fontset fig = plt.figure(figsize=(5.25, 0.75)) diff --git a/lib/matplotlib/tests/test_polar.py b/lib/matplotlib/tests/test_polar.py -index c614eff027..daf4e26fb8 100644 +index ea3cdfa129..d6cc018d5d 100644 --- a/lib/matplotlib/tests/test_polar.py +++ b/lib/matplotlib/tests/test_polar.py -@@ -312,7 +312,7 @@ def test_get_tightbbox_polar(): +@@ -314,7 +314,7 @@ def test_get_tightbbox_polar(): fig.canvas.draw() bb = ax.get_tightbbox(fig.canvas.get_renderer()) assert_allclose( @@ -129,10 +129,10 @@ index 23d363b508..e94c863477 100644 diff --git a/setupext.py b/setupext.py -index d8d0b6b393..45cab7d036 100644 +index 81c4fb56eb..c042f1b66d 100644 --- a/setupext.py +++ b/setupext.py -@@ -167,12 +167,18 @@ _freetype_hashes = { +@@ -166,12 +166,18 @@ _freetype_hashes = { '955e17244e9b38adb0c98df66abb50467312e6bb70eac07e49ce6bd1a20e809a', '2.10.1': '3a60d391fd579440561bf0e7f31af2222bc610ad6ce4d9d7bd2165bca8669110', @@ -152,7 +152,7 @@ index d8d0b6b393..45cab7d036 100644 LOCAL_FREETYPE_HASH = _freetype_hashes.get(LOCAL_FREETYPE_VERSION, 'unknown') LOCAL_QHULL_VERSION = '2020.2' -@@ -565,6 +571,7 @@ class FreeType(SetupPackage): +@@ -556,6 +562,7 @@ class FreeType(SetupPackage): ext.extra_objects.insert( 0, str(src_path / 'objs' / '.libs' / libfreetype)) ext.define_macros.append(('FREETYPE_BUILD_TYPE', 'local')) diff --git a/0003-Slightly-increase-tolerance-on-rcupdate-test.patch b/0003-Slightly-increase-tolerance-on-rcupdate-test.patch index ea09e8b..24886e3 100644 --- a/0003-Slightly-increase-tolerance-on-rcupdate-test.patch +++ b/0003-Slightly-increase-tolerance-on-rcupdate-test.patch @@ -1,4 +1,4 @@ -From 543d61d521c02120b48688ae56e39128144debd8 Mon Sep 17 00:00:00 2001 +From 24874d70222f64e221d8769d02fe91fe01554b1e 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. @@ -9,14 +9,14 @@ Signed-off-by: Elliott Sales de Andrade 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 040b2e7146..6ee36edc9e 100644 +index a463c96e61..4ff6a50de7 100644 --- a/lib/matplotlib/tests/test_backend_pgf.py +++ b/lib/matplotlib/tests/test_backend_pgf.py -@@ -127,7 +127,7 @@ def test_rcupdate(): +@@ -136,7 +136,7 @@ def test_rcupdate(): 'pgf.preamble': ('\\usepackage[utf8x]{inputenc}' '\\usepackage[T1]{fontenc}' '\\usepackage{sfmath}')}] -- tol = [6, 0] +- tol = [0, 13.2] if _old_gs_version else [0, 0] + tol = [6, 1.28] for i, rc_set in enumerate(rc_sets): with mpl.rc_context(rc_set): diff --git a/0004-Ensure-full-environment-is-passed-to-headless-test.patch b/0004-Ensure-full-environment-is-passed-to-headless-test.patch new file mode 100644 index 0000000..b5bc0f4 --- /dev/null +++ b/0004-Ensure-full-environment-is-passed-to-headless-test.patch @@ -0,0 +1,28 @@ +From 58debfaafeabc791b49dd9e3f2461b9cfe9812ab Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Tue, 24 Aug 2021 03:28:52 -0400 +Subject: [PATCH 4/4] Ensure full environment is passed to headless test. + +Otherwise, e.g., `PYTHONPATH` is not available. + +Signed-off-by: Elliott Sales de Andrade +--- + lib/matplotlib/tests/test_backends_interactive.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/matplotlib/tests/test_backends_interactive.py b/lib/matplotlib/tests/test_backends_interactive.py +index 36ec3bfc83..a1f27fea57 100644 +--- a/lib/matplotlib/tests/test_backends_interactive.py ++++ b/lib/matplotlib/tests/test_backends_interactive.py +@@ -301,7 +301,7 @@ else: + + """ + proc = subprocess.run([sys.executable, "-c", test_script], +- env={"MPLBACKEND": ""}) ++ env={**os.environ, "MPLBACKEND": ""}) + if proc.returncode: + pytest.fail("The subprocess returned with non-zero exit status " + f"{proc.returncode}.") +-- +2.31.1 + diff --git a/0004-Ignore-errors-trying-to-delete-make_release_tree.patch b/0004-Ignore-errors-trying-to-delete-make_release_tree.patch deleted file mode 100644 index ccc4138..0000000 --- a/0004-Ignore-errors-trying-to-delete-make_release_tree.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 64c8d772eaeeed5861a8990178e8a5691bc3c496 Mon Sep 17 00:00:00 2001 -From: Elliott Sales de Andrade -Date: Fri, 20 Aug 2021 22:11:33 -0400 -Subject: [PATCH 4/4] Ignore errors trying to delete make_release_tree. - -Which apparently happens in Fedora's automated build requirement -generator. - -Signed-off-by: Elliott Sales de Andrade ---- - setup.py | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/setup.py b/setup.py -index b51ae806c2..7b73f7e945 100644 ---- a/setup.py -+++ b/setup.py -@@ -41,7 +41,10 @@ try: - except ImportError: - pass - else: -- del sdist.sdist.make_release_tree -+ try: -+ del sdist.sdist.make_release_tree -+ except AttributeError: -+ pass - - from distutils.errors import CompileError - from distutils.dist import Distribution --- -2.31.1 - diff --git a/setup.cfg b/mplsetup.cfg similarity index 100% rename from setup.cfg rename to mplsetup.cfg diff --git a/python-matplotlib.spec b/python-matplotlib.spec index eb5bf2f..7c089d0 100644 --- a/python-matplotlib.spec +++ b/python-matplotlib.spec @@ -30,22 +30,22 @@ %global _docdir_fmt %{name} # Updated test images for new FreeType. -%global mpl_images_version 3.4.3 +%global mpl_images_version 3.5.0b1 # The version of FreeType in this Fedora branch. %global ftver 2.11.0 Name: python-matplotlib -Version: 3.4.3 -%global Version 3.4.3 -Release: %autorelease +Version: 3.5.0 +%global Version 3.5.0b1 +Release: %autorelease -p b1 Summary: Python 2D plotting library # qt4_editor backend is MIT # ResizeObserver at end of lib/matplotlib/backends/web_backend/js/mpl.js is Public Domain License: Python and MIT and Public Domain URL: http://matplotlib.org Source0: https://github.com/matplotlib/matplotlib/archive/v%{Version}/matplotlib-%{Version}.tar.gz -Source1: setup.cfg +Source1: mplsetup.cfg # Fedora-specific patches; see: # https://github.com/fedora-python/matplotlib/tree/fedora-patches @@ -57,8 +57,8 @@ Patch1001: 0001-matplotlibrc-path-search-fix.patch Patch1002: 0002-Set-FreeType-version-to-%{ftver}-and-update-tolerances.patch # Work around for problems with texlive 2021 (#1965547) Patch1003: 0003-Slightly-increase-tolerance-on-rcupdate-test.patch -# https://github.com/matplotlib/matplotlib/pull/20869 -Patch1004: 0004-Ignore-errors-trying-to-delete-make_release_tree.patch +# https://github.com/matplotlib/matplotlib/pull/20884 +Patch1004: 0004-Ensure-full-environment-is-passed-to-headless-test.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -227,8 +227,10 @@ Requires: python3-matplotlib%{?_isa} = %{version}-%{release} %package -n python3-matplotlib-tk Summary: Tk backend for python3-matplotlib +BuildRequires: python3-pillow-tk BuildRequires: python3-tkinter Requires: python3-matplotlib%{?_isa} = %{version}-%{release} +Requires: python3-pillow-tk Requires: python3-tkinter %description -n python3-matplotlib-tk @@ -276,8 +278,8 @@ Requires: python3-matplotlib%{?_isa} = %{version}-%{release} %patch1002 -p1 gzip -dc %SOURCE1000 | tar xf - --transform='s~^mpl-images-%{mpl_images_version}-with-freetype-%{ftver}/\([^/]\+\)/~lib/\1/tests/baseline_images/~' -# Copy setup.cfg to the builddir -cp -p %{SOURCE1} setup.cfg +# Copy mplsetup.cfg to the builddir +cp -p %{SOURCE1} mplsetup.cfg %patch1003 -p1 %patch1004 -p1 @@ -342,7 +344,7 @@ MPLCONFIGDIR=$PWD \ xvfb-run -a -s "-screen 0 640x480x24" \ env %{pytest} -ra -n auto \ -m 'not network' \ - -k 'not test_invisible_Line_rendering and not Qt4Agg' \ + -k 'not test_invisible_Line_rendering' \ --pyargs matplotlib mpl_toolkits.tests %endif diff --git a/sources b/sources index 3a8eafc..c94a8c0 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (matplotlib-3.4.3.tar.gz) = e346c7d0f33b7d2fb5b48a4578ec99a40c2e5b959d109526ccbe7582a37f10abb91d53062711c37eb4ccaf462fd8684e1557405c50ccf43139bc371601a60e80 -SHA512 (matplotlib-3.4.3-with-freetype-2.11.0.tar.gz) = d78333a2ce39f70fa1dd53545b25c83d519a40e01b115be59869b41d2bf56b92030d31d6e7bb1ffa555bdf0ab3e6b0acdb2a569c182d8ebc963f48f74ffead94 +SHA512 (matplotlib-3.5.0b1.tar.gz) = 5299ea0d04a686cb5a2a797c9f245b6477ee6eace04c7b1371195b5b3cfbd12fdba07497ee699443b6a51d5aacd0b9dec2ea4cdd06d6f00a6c77877174733cba +SHA512 (matplotlib-3.5.0b1-with-freetype-2.11.0.tar.gz) = cbbf471a30ec01d087fab51487a9480e73b98c475a241f0ae865f886d381b36395695befaaaeebe509863535f85dd6662fdff17680445ebc5accfd703ae20c91