diff --git a/.gitignore b/.gitignore index 526b097..232cbc7 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,5 @@ matplotlib-1.0.0-without-gpc.tar.gz /matplotlib-3.3.3.tar.gz /matplotlib-3.3.3-with-freetype-2.10.4.tar.gz /matplotlib-3.3.4.tar.gz +/matplotlib-3.4.0rc1.tar.gz +/matplotlib-3.4.0rc1-with-freetype-2.10.4.tar.gz diff --git a/0001-matplotlibrc-path-search-fix.patch b/0001-matplotlibrc-path-search-fix.patch index df40125..5c44103 100644 --- a/0001-matplotlibrc-path-search-fix.patch +++ b/0001-matplotlibrc-path-search-fix.patch @@ -1,54 +1,28 @@ -From 7d34e4c6cf3e9f0b68d0a7f70f5c832a24b74d7e Mon Sep 17 00:00:00 2001 +From 92b11ded669267100e3c6858578351cad3749cd0 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 27 Sep 2017 19:35:59 -0400 -Subject: [PATCH 1/2] matplotlibrc path search fix +Subject: [PATCH 1/3] matplotlibrc path search fix Signed-off-by: Elliott Sales de Andrade --- - lib/matplotlib/__init__.py | 28 ++++------------------------ - 1 file changed, 4 insertions(+), 24 deletions(-) + lib/matplotlib/__init__.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py -index 1c47973f15..202acce525 100644 +index c3d4aaf62d..ec115cd3f5 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py -@@ -536,33 +536,11 @@ def get_data_path(*, _from_rc=None): - - @_logged_cached('(private) matplotlib data path: %s') - def _get_data_path(): -- path = Path(__file__).with_name("mpl-data") -+ path = (Path(__file__).parent.parent.parent.parent.parent / +@@ -471,7 +471,8 @@ def get_cachedir(): + @_logged_cached('matplotlib data path: %s') + def get_data_path(): + """Return the path to Matplotlib data.""" +- return str(Path(__file__).with_name("mpl-data")) ++ return (Path(__file__).parent.parent.parent.parent.parent / + 'share/matplotlib/mpl-data') - if path.is_dir(): - return str(path) - -- cbook.warn_deprecated( -- "3.2", message="Matplotlib installs where the data is not in the " -- "mpl-data subdirectory of the package are deprecated since %(since)s " -- "and support for them will be removed %(removal)s.") -- -- def get_candidate_paths(): -- # setuptools' namespace_packages may hijack this init file -- # so need to try something known to be in Matplotlib, not basemap. -- import matplotlib.afm -- yield Path(matplotlib.afm.__file__).with_name('mpl-data') -- # py2exe zips pure python, so still need special check. -- if getattr(sys, 'frozen', None): -- yield Path(sys.executable).with_name('mpl-data') -- # Try again assuming we need to step up one more directory. -- yield Path(sys.executable).parent.with_name('mpl-data') -- # Try again assuming sys.path[0] is a dir not a exe. -- yield Path(sys.path[0]) / 'mpl-data' -- -- for path in get_candidate_paths(): -- if path.is_dir(): -- defaultParams['datapath'][0] = str(path) -- return str(path) -- - raise RuntimeError('Could not find the matplotlib data files') -@@ -583,6 +561,7 @@ def matplotlib_fname(): + def matplotlib_fname(): +@@ -491,6 +492,7 @@ def matplotlib_fname(): is not defined) - On other platforms, - ``$HOME/.matplotlib/matplotlibrc`` if ``$HOME`` is defined @@ -56,12 +30,12 @@ index 1c47973f15..202acce525 100644 - Lastly, it looks in ``$MATPLOTLIBDATA/matplotlibrc``, which should always exist. """ -@@ -597,6 +576,7 @@ def matplotlib_fname(): +@@ -509,6 +511,7 @@ def matplotlib_fname(): yield matplotlibrc yield os.path.join(matplotlibrc, 'matplotlibrc') yield os.path.join(get_configdir(), 'matplotlibrc') + yield '/etc/matplotlibrc' - yield os.path.join(_get_data_path(), 'matplotlibrc') + yield os.path.join(get_data_path(), 'matplotlibrc') for fname in gen_candidates(): -- 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 7ef9ffb..535e8ea 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 40ed55c16c0d3f7d2365af5c6a8f99e02eadae31 Mon Sep 17 00:00:00 2001 +From c970ba953bed9df6670d28cb4421ebd054033590 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 14 Feb 2020 06:05:42 -0500 -Subject: [PATCH 2/2] Set FreeType version to 2.10.4 and update tolerances. +Subject: [PATCH 2/3] 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 202acce525..18731b7c4d 100644 +index ec115cd3f5..47c315bde4 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py -@@ -1198,7 +1198,7 @@ default_test_modules = [ +@@ -1128,7 +1128,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 202acce525..18731b7c4d 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 e0b340da1e..9090c2930c 100644 +index ed76af576f..f432713680 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py -@@ -6055,7 +6055,7 @@ def test_normal_axes(): +@@ -6426,7 +6426,7 @@ def test_normal_axes(): ] for nn, b in enumerate(bbaxis): targetbb = mtransforms.Bbox.from_bounds(*target[nn]) @@ -39,7 +39,7 @@ index e0b340da1e..9090c2930c 100644 target = [ [150.0, 119.999, 930.0, 11.111], -@@ -6073,7 +6073,7 @@ def test_normal_axes(): +@@ -6444,7 +6444,7 @@ def test_normal_axes(): target = [85.5138, 75.88888, 1021.11, 1017.11] targetbb = mtransforms.Bbox.from_bounds(*target) @@ -49,20 +49,23 @@ index e0b340da1e..9090c2930c 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 46e6b9663e..593b3fb3ee 100644 +index 67474628e7..d3e9d105dc 100644 --- a/lib/matplotlib/tests/test_constrainedlayout.py +++ b/lib/matplotlib/tests/test_constrainedlayout.py -@@ -398,4 +398,4 @@ def test_hidden_axes(): +@@ -429,7 +429,7 @@ 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) -+ extents1, [0.045552, 0.548288, 0.47319, 0.982638], rtol=1e-2) +- 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(): diff --git a/lib/matplotlib/tests/test_polar.py b/lib/matplotlib/tests/test_polar.py -index da9a77c825..a7a98ef59e 100644 +index 389d08b6ee..865780bf62 100644 --- a/lib/matplotlib/tests/test_polar.py +++ b/lib/matplotlib/tests/test_polar.py -@@ -314,7 +314,7 @@ def test_get_tightbbox_polar(): +@@ -312,7 +312,7 @@ def test_get_tightbbox_polar(): fig.canvas.draw() bb = ax.get_tightbbox(fig.canvas.get_renderer()) assert_allclose( @@ -72,10 +75,10 @@ index da9a77c825..a7a98ef59e 100644 @check_figures_equal(extensions=["png"]) diff --git a/lib/matplotlib/tests/test_tightlayout.py b/lib/matplotlib/tests/test_tightlayout.py -index 9ad2e0a9a0..7c9085a314 100644 +index 23d363b508..e94c863477 100644 --- a/lib/matplotlib/tests/test_tightlayout.py +++ b/lib/matplotlib/tests/test_tightlayout.py -@@ -171,12 +171,12 @@ def test_outward_ticks(): +@@ -172,12 +172,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. @@ -94,10 +97,10 @@ index 9ad2e0a9a0..7c9085a314 100644 diff --git a/setupext.py b/setupext.py -index dfa004d7f0..8ec77feed9 100644 +index d8d0b6b393..aabb7ed9fd 100644 --- a/setupext.py +++ b/setupext.py -@@ -129,12 +129,16 @@ _freetype_hashes = { +@@ -167,12 +167,16 @@ _freetype_hashes = { '955e17244e9b38adb0c98df66abb50467312e6bb70eac07e49ce6bd1a20e809a', '2.10.1': '3a60d391fd579440561bf0e7f31af2222bc610ad6ce4d9d7bd2165bca8669110', @@ -114,7 +117,7 @@ index dfa004d7f0..8ec77feed9 100644 +LOCAL_FREETYPE_VERSION = '2.10.4' LOCAL_FREETYPE_HASH = _freetype_hashes.get(LOCAL_FREETYPE_VERSION, 'unknown') - + LOCAL_QHULL_VERSION = '2020.2' -- 2.29.2 diff --git a/0003-Increase-tolerances-for-other-arches.patch b/0003-Increase-tolerances-for-other-arches.patch new file mode 100644 index 0000000..6020f19 --- /dev/null +++ b/0003-Increase-tolerances-for-other-arches.patch @@ -0,0 +1,66 @@ +From 209dd631c428fba83c66fa03b516e90b65659ed5 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Fri, 19 Feb 2021 16:33:00 -0500 +Subject: [PATCH 3/3] Increase tolerances for other arches. + +See scratch build here: +https://koji.fedoraproject.org/koji/taskinfo?taskID=62275793 + +Signed-off-by: Elliott Sales de Andrade +--- + lib/matplotlib/tests/test_arrow_patches.py | 3 ++- + .../tests/test_axisartist_grid_helper_curvelinear.py | 2 +- + lib/mpl_toolkits/tests/test_mplot3d.py | 4 +++- + 3 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/lib/matplotlib/tests/test_arrow_patches.py b/lib/matplotlib/tests/test_arrow_patches.py +index 0eee4f1fba..3c95535e0c 100644 +--- a/lib/matplotlib/tests/test_arrow_patches.py ++++ b/lib/matplotlib/tests/test_arrow_patches.py +@@ -114,7 +114,8 @@ def test_fancyarrow_dash(): + ax.add_patch(e2) + + +-@image_comparison(['arrow_styles.png'], style='mpl20', remove_text=True) ++@image_comparison(['arrow_styles.png'], style='mpl20', remove_text=True, ++ tol=0 if platform.machine() == 'x86_64' else 0.005) + def test_arrow_styles(): + styles = mpatches.ArrowStyle.get_styles() + +diff --git a/lib/mpl_toolkits/tests/test_axisartist_grid_helper_curvelinear.py b/lib/mpl_toolkits/tests/test_axisartist_grid_helper_curvelinear.py +index 57397a5962..9a78a2676a 100644 +--- a/lib/mpl_toolkits/tests/test_axisartist_grid_helper_curvelinear.py ++++ b/lib/mpl_toolkits/tests/test_axisartist_grid_helper_curvelinear.py +@@ -17,7 +17,7 @@ from mpl_toolkits.axisartist.grid_helper_curvelinear import \ + + + @image_comparison(['custom_transform.png'], style='default', +- tol=0.03 if platform.machine() == 'x86_64' else 0.034) ++ tol=0.03 if platform.machine() == 'x86_64' else 0.04) + def test_custom_transform(): + class MyTransform(Transform): + input_dims = output_dims = 2 +diff --git a/lib/mpl_toolkits/tests/test_mplot3d.py b/lib/mpl_toolkits/tests/test_mplot3d.py +index cfcc383db1..f55edaa4aa 100644 +--- a/lib/mpl_toolkits/tests/test_mplot3d.py ++++ b/lib/mpl_toolkits/tests/test_mplot3d.py +@@ -1,5 +1,6 @@ + import functools + import itertools ++import platform + + import pytest + +@@ -1267,7 +1268,8 @@ def test_errorbar3d(): + ax.legend() + + +-@image_comparison(['stem3d.png'], style='mpl20') ++@image_comparison(['stem3d.png'], style='mpl20', ++ tol=0.0 if platform.machine() == 'x86_64' else 0.003) + def test_stem3d(): + fig, axs = plt.subplots(2, 3, figsize=(8, 6), + constrained_layout=True, +-- +2.29.2 + diff --git a/python-matplotlib.spec b/python-matplotlib.spec index aa9806a..b4bc4d7 100644 --- a/python-matplotlib.spec +++ b/python-matplotlib.spec @@ -41,15 +41,15 @@ %global _docdir_fmt %{name} # Updated test images for new FreeType. -%global mpl_images_version 3.3.3 +%global mpl_images_version 3.4.0rc1 # The version of FreeType in this Fedora branch. %global ftver 2.10.4 Name: python-matplotlib -Version: 3.3.4 -%global Version 3.3.4 -Release: 3%{?dist} +Version: 3.4.0~rc1 +%global Version 3.4.0rc1 +Release: 1%{?dist} 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 @@ -66,6 +66,8 @@ 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 +# https://github.com/matplotlib/matplotlib/pull/19548 +Patch0001: 0003-Increase-tolerances-for-other-arches.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -317,7 +319,9 @@ Requires: python3-matplotlib%{?_isa} = %{version}-%{release} # Updated test images for new FreeType. %patch1002 -p1 gzip -dc %SOURCE1000 | tar xf - --transform='s~^mpl-images-%{mpl_images_version}-with-freetype-%{ftver}/\([^/]\+\)/~lib/\1/tests/baseline_images/~' -rm -r extern/libqhull + +# Backports +%patch0001 -p1 # Copy setup.cfg to the builddir cp -p %{SOURCE1} setup.cfg @@ -345,6 +349,13 @@ find examples -name '*.py' -exec chmod a-x '{}' \; export http_proxy=http://127.0.0.1/ MPLCONFIGDIR=$PWD %py3_install + +# Delete unnecessary files. +rm %{buildroot}%{python3_sitearch}/matplotlib/backends/web_backend/.{eslintrc.js,prettierignore,prettierrc} +rm %{buildroot}%{python3_sitearch}/matplotlib/tests/tinypages/.gitignore +rm %{buildroot}%{python3_sitearch}/matplotlib/tests/tinypages/_static/.gitignore + +# Move files to Fedora-specific locations. mkdir -p %{buildroot}%{_sysconfdir} %{buildroot}%{_datadir}/matplotlib mv %{buildroot}%{python3_sitearch}/matplotlib/mpl-data \ %{buildroot}%{_datadir}/matplotlib @@ -456,7 +467,8 @@ PYTHONDONTWRITEBYTECODE=1 \ %changelog -* Thu Jan 28 2021 Elliott Sales de Andrade - 3.4.0-0 +* Fri Feb 19 2021 Elliott Sales de Andrade - 3.4.0~rc1-1 +- Update to latest release candidate - Deprecated python3-matplotlib-qt4 subpackage * Tue Feb 16 2021 Troy Dawson - 3.3.4-3 diff --git a/sources b/sources index 95f6bef..52a8315 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (matplotlib-3.3.4.tar.gz) = e29bcd17ea2b65c26c75421a319d3f21c5b0148c9e61d55d719c191c07342ed19032f97cde269647bd545ed45b5e142483e50caf29ffd421acde5b0b3bfa238b -SHA512 (matplotlib-3.3.3-with-freetype-2.10.4.tar.gz) = b583842a24edc5deb39a3182797199081500fb089bff467a9e55d3612d8c049d43ed08385d42060271928f5cb02240599c7173a65c213fae9bafb2081c54c5a1 +SHA512 (matplotlib-3.4.0rc1.tar.gz) = a5eec56becca26ce8cb4537f08d8575182ebea1cdccf42106ac340a5e371ee723e308369145092176910d5f1fe82002e46344f23d072a9f1d337665e1da460a5 +SHA512 (matplotlib-3.4.0rc1-with-freetype-2.10.4.tar.gz) = 331461235474d44d8f180be3b809faa63e0775ef95d0a3fc6b5e83dca2aafca82258b54a393b0f68a4a213b88564afa54444ee8ac040873f06b9b2d53705767b