diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..f087b429e2f81a9f37b28a8308e2210f84df6c9b --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.tar.gz filter=lfs diff=lfs merge=lfs -text diff --git a/.lfsconfig b/.lfsconfig new file mode 100644 index 0000000000000000000000000000000000000000..0a3d1557be11de762e641d685a8fdade9fbf1a5c --- /dev/null +++ b/.lfsconfig @@ -0,0 +1,2 @@ +[lfs] + url = https://artlfs.openeuler.openatom.cn/src-openEuler/python-matplotlib diff --git a/0002-Set-FreeType-version-to-2.13.1-and-update-tolerances.patch b/0002-Set-FreeType-version-to-2.13.1-and-update-tolerances.patch index 1ce37afd6ca3c2f4a5e9f4e8ef190acd973d278f..d6fb22c6f939f4585dc31d62a902a41acdbfd592 100644 --- a/0002-Set-FreeType-version-to-2.13.1-and-update-tolerances.patch +++ b/0002-Set-FreeType-version-to-2.13.1-and-update-tolerances.patch @@ -1,38 +1,50 @@ -From a5490ca593e1515bddbc96491efd8d1ff5e372d6 Mon Sep 17 00:00:00 2001 +From 944d5021f46735045a69af1e57ff0bb0c43e7fbb Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 14 Feb 2020 06:05:42 -0500 -Subject: [PATCH 3/5] Set FreeType version to 2.13.1 and update tolerances - +Subject: [PATCH 2/5] Set FreeType version to 2.13.1 and update tolerances + Signed-off-by: Elliott Sales de Andrade --- - lib/matplotlib/__init__.py | 2 +- - lib/matplotlib/tests/test_axes.py | 4 ++-- - lib/matplotlib/tests/test_backend_pgf.py | 2 +- - .../tests/test_constrainedlayout.py | 10 ++++----- - lib/matplotlib/tests/test_legend.py | 4 ++-- - lib/matplotlib/tests/test_polar.py | 2 +- - lib/matplotlib/tests/test_tightlayout.py | 10 ++++----- - setupext.py | 21 +++++++++++++++++-- - 8 files changed, 36 insertions(+), 19 deletions(-) - + extern/meson.build | 2 +- + lib/matplotlib/__init__.py | 2 +- + lib/matplotlib/tests/test_axes.py | 4 ++-- + lib/matplotlib/tests/test_backend_pgf.py | 2 +- + lib/matplotlib/tests/test_ft2font.py | 6 +++--- + lib/matplotlib/tests/test_legend.py | 4 ++-- + lib/matplotlib/tests/test_polar.py | 2 +- + 7 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/extern/meson.build b/extern/meson.build +index 5463183a90..c7233815af 100644 +--- a/extern/meson.build ++++ b/extern/meson.build +@@ -13,7 +13,7 @@ else + # must match the value in `lib/matplotlib.__init__.py`. Also update the docs + # in `docs/devel/dependencies.rst`. Bump the cache key in + # `.circleci/config.yml` when changing requirements. +- LOCAL_FREETYPE_VERSION = '2.6.1' ++ LOCAL_FREETYPE_VERSION = '2.13.1' + + freetype_proj = subproject( + f'freetype-@LOCAL_FREETYPE_VERSION@', diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py -index 26dd9372e1..81b77d455f 100644 +index f82d92466a..c0551b5b5f 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py -@@ -1307,7 +1307,7 @@ def _val_or_rc(val, rc_name): +@@ -1361,7 +1361,7 @@ def _val_or_rc(val, rc_name): def _init_tests(): - # The version of FreeType to install locally for running the - # tests. This must match the value in `setupext.py` + # The version of FreeType to install locally for running the tests. This must match + # the value in `meson.build`. - LOCAL_FREETYPE_VERSION = '2.6.1' + LOCAL_FREETYPE_VERSION = '2.13.1' 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 6c5dd712b7..0a70c37891 100644 +index e3fc1ada99..28870ea736 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py -@@ -7623,7 +7623,7 @@ def test_normal_axes(): +@@ -8065,7 +8065,7 @@ def test_normal_axes(): ] for nn, b in enumerate(bbaxis): targetbb = mtransforms.Bbox.from_bounds(*target[nn]) @@ -41,7 +53,7 @@ index 6c5dd712b7..0a70c37891 100644 target = [ [150.0, 119.999, 930.0, 11.111], -@@ -7641,7 +7641,7 @@ def test_normal_axes(): +@@ -8083,7 +8083,7 @@ def test_normal_axes(): target = [85.5138, 75.88888, 1021.11, 1017.11] targetbb = mtransforms.Bbox.from_bounds(*target) @@ -51,7 +63,7 @@ index 6c5dd712b7..0a70c37891 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_backend_pgf.py b/lib/matplotlib/tests/test_backend_pgf.py -index a866916c58..a746cc2ca9 100644 +index e218a81cdc..839ad724e1 100644 --- a/lib/matplotlib/tests/test_backend_pgf.py +++ b/lib/matplotlib/tests/test_backend_pgf.py @@ -165,7 +165,7 @@ def test_pathclip(): @@ -63,49 +75,29 @@ index a866916c58..a746cc2ca9 100644 def test_mixedmode(): mpl.rcParams.update({'font.family': 'serif', 'pgf.rcfonts': False}) Y, X = np.ogrid[-1:1:40j, -1:1:40j] -diff --git a/lib/matplotlib/tests/test_constrainedlayout.py b/lib/matplotlib/tests/test_constrainedlayout.py -index 6703dfe315..ea6a8d9630 100644 ---- a/lib/matplotlib/tests/test_constrainedlayout.py -+++ b/lib/matplotlib/tests/test_constrainedlayout.py -@@ -432,7 +432,7 @@ def test_hidden_axes(): - extents1 = np.copy(axs[0, 0].get_position().extents) - - np.testing.assert_allclose( -- 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(): -@@ -638,9 +638,9 @@ def test_compressed1(): - 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) -+ np.testing.assert_allclose(pos.x1, 0.7024, atol=1e-2) - - # wider than tall - fig, axs = plt.subplots(2, 3, layout='compressed', -@@ -653,10 +653,10 @@ def test_compressed1(): - - 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) -- 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_ft2font.py b/lib/matplotlib/tests/test_ft2font.py +index 6ba23bab34..0aee3222f1 100644 +--- a/lib/matplotlib/tests/test_ft2font.py ++++ b/lib/matplotlib/tests/test_ft2font.py +@@ -706,10 +706,10 @@ def test_ft2font_get_sfnt_table(font_name, header): + + @pytest.mark.parametrize('left, right, unscaled, unfitted, default', [ + # These are all the same class. +- ('A', 'A', 57, 248, 256), ('A', 'À', 57, 248, 256), ('A', 'Á', 57, 248, 256), +- ('A', 'Â', 57, 248, 256), ('A', 'Ã', 57, 248, 256), ('A', 'Ä', 57, 248, 256), ++ ('A', 'A', 57, 247, 256), ('A', 'À', 57, 247, 256), ('A', 'Á', 57, 247, 256), ++ ('A', 'Â', 57, 247, 256), ('A', 'Ã', 57, 247, 256), ('A', 'Ä', 57, 247, 256), + # And a few other random ones. +- ('D', 'A', -36, -156, -128), ('T', '.', -243, -1056, -1024), ++ ('D', 'A', -36, -156, -128), ('T', '.', -243, -1055, -1024), + ('X', 'C', -149, -647, -640), ('-', 'J', 114, 495, 512), + ]) + def test_ft2font_get_kerning(left, right, unscaled, unfitted, default): diff --git a/lib/matplotlib/tests/test_legend.py b/lib/matplotlib/tests/test_legend.py -index 759ac6aada..8140d4d69f 100644 +index 5e69044866..0b6413e97f 100644 --- a/lib/matplotlib/tests/test_legend.py +++ b/lib/matplotlib/tests/test_legend.py -@@ -516,9 +516,9 @@ def test_figure_legend_outside(): +@@ -508,9 +508,9 @@ def test_figure_legend_outside(): fig.draw_without_rendering() assert_allclose(axs.get_window_extent().extents, @@ -116,12 +108,12 @@ index 759ac6aada..8140d4d69f 100644 + legbb[nn], rtol=1) - @image_comparison(['legend_stackplot.png']) + @image_comparison(['legend_stackplot.png'], diff --git a/lib/matplotlib/tests/test_polar.py b/lib/matplotlib/tests/test_polar.py -index 9d6e78da2c..5f6ed538d1 100644 +index 87c8efe304..af5f2d2c6a 100644 --- a/lib/matplotlib/tests/test_polar.py +++ b/lib/matplotlib/tests/test_polar.py -@@ -321,7 +321,7 @@ def test_get_tightbbox_polar(): +@@ -328,7 +328,7 @@ def test_get_tightbbox_polar(): fig.canvas.draw() bb = ax.get_tightbbox(fig.canvas.get_renderer()) assert_allclose( @@ -130,72 +122,6 @@ index 9d6e78da2c..5f6ed538d1 100644 @check_figures_equal(extensions=["png"]) -diff --git a/lib/matplotlib/tests/test_tightlayout.py b/lib/matplotlib/tests/test_tightlayout.py -index 968f0da7b5..89caa81b98 100644 ---- a/lib/matplotlib/tests/test_tightlayout.py -+++ b/lib/matplotlib/tests/test_tightlayout.py -@@ -173,12 +173,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 9f78d88c87..6dc740e8f7 100644 ---- a/setupext.py -+++ b/setupext.py -@@ -176,14 +176,30 @@ _freetype_hashes = { - '955e17244e9b38adb0c98df66abb50467312e6bb70eac07e49ce6bd1a20e809a', - '2.10.1': - '3a60d391fd579440561bf0e7f31af2222bc610ad6ce4d9d7bd2165bca8669110', -+ '2.10.2': -+ 'e09aa914e4f7a5d723ac381420949c55c0b90b15744adce5d1406046022186ab', -+ '2.10.3': -+ '9dfb4e11efd6e460a87b1991a64bc69344ee7dc219d9b29e7faabc1c168ce8b0', -+ '2.10.4': -+ '5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01b2c953269f658dac', -+ '2.11.0': -+ 'a45c6b403413abd5706f3582f04c8339d26397c4304b78fa552f2215df64101f', - '2.11.1': -- 'f8db94d307e9c54961b39a1cc799a67d46681480696ed72ecf78d4473770f09b' -+ 'f8db94d307e9c54961b39a1cc799a67d46681480696ed72ecf78d4473770f09b', -+ '2.12.0': -+ '7940a46eeb0255baaa87c553d72778c4f8daa2b8888c8e2a05766a2a8686740c', -+ '2.12.1': -+ 'efe71fd4b8246f1b0b1b9bfca13cfff1c9ad85930340c27df469733bbb620938', -+ '2.13.0': -+ 'a7aca0e532a276ea8d85bd31149f0a74c33d19c8d287116ef8f5f8357b4f1f80', -+ '2.13.1': -+ '0b109c59914f25b4411a8de2a506fdd18fa8457eb86eca6c7b15c19110a92fa5', - } - # This is the version of FreeType to use when building a local version. It - # must match the value in lib/matplotlib.__init__.py, and the cache path in - # `.circleci/config.yml`. Also update the docs in - # `docs/devel/dependencies.rst`. --TESTING_VERSION_OF_FREETYPE = '2.6.1' -+TESTING_VERSION_OF_FREETYPE = '2.13.1' - if sys.platform.startswith('win') and platform.machine() == 'ARM64': - # older versions of freetype are not supported for win/arm64 - # Matplotlib tests will not pass -@@ -599,6 +615,7 @@ class FreeType(SetupPackage): - name = ext.name.split('.')[-1] - ext.extra_link_args.append( - f'-Wl,-exported_symbol,_PyInit_{name}') -+ ext.libraries.append('brotlidec') - - def do_custom_build(self, env): - # We're using a system freetype -- -2.41.0 +2.49.0 + diff --git a/matplotlib-3.10.3-with-freetype-2.13.1.tar.gz b/matplotlib-3.10.3-with-freetype-2.13.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b73d4fad1f9b2c3e458a0d132fdea708200fefdf --- /dev/null +++ b/matplotlib-3.10.3-with-freetype-2.13.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:780a47ca5032dace4323475418b3573a953c8b75c351d3a00becdaf72dc626b6 +size 23939325 diff --git a/matplotlib-3.10.3.tar.gz b/matplotlib-3.10.3.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..9ec6855eeea8720247f13d5d3c8b4be7cfa20876 --- /dev/null +++ b/matplotlib-3.10.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f82d2c5bb7ae93aaaa4cd42aca65d76ce6376f83304fa3a630b569aca274df0 +size 34799811 diff --git a/matplotlib-3.8.1-with-freetype-2.13.1.tar.gz b/matplotlib-3.8.1-with-freetype-2.13.1.tar.gz deleted file mode 100644 index 8e0f72ee1c95891e0ada73fad3ee6051d6735c43..0000000000000000000000000000000000000000 Binary files a/matplotlib-3.8.1-with-freetype-2.13.1.tar.gz and /dev/null differ diff --git a/matplotlib-3.8.2.tar.gz b/matplotlib-3.8.2.tar.gz deleted file mode 100644 index 0767af6d9ee13884078931295b19b9a334fc73b7..0000000000000000000000000000000000000000 Binary files a/matplotlib-3.8.2.tar.gz and /dev/null differ diff --git a/mplsetup.cfg b/mplsetup.cfg deleted file mode 100644 index 362e6ab90332a4e2f80601d0e5702f7202ac95e8..0000000000000000000000000000000000000000 --- a/mplsetup.cfg +++ /dev/null @@ -1,8 +0,0 @@ -[libs] -system_freetype = True -system_qhull = True - -[packages] -tests = True -toolkits = True -toolkits_tests = True diff --git a/python-matplotlib.spec b/python-matplotlib.spec index 86a402b28cb8c917285e04c7379fcff301fd47ba..4f6c674c723eeeb26ac8c8caf660b7eddc31809c 100644 --- a/python-matplotlib.spec +++ b/python-matplotlib.spec @@ -1,18 +1,18 @@ +%global build_backend_args -Csetup-args="-Dsystem-freetype=true" -Csetup-args="-Dsystem-qhull=true" -Cinstall-args="--tags=data,python-runtime,runtime,tests" + Name: python-matplotlib -Version: 3.8.2 +Version: 3.10.3 Release: 1 Summary: A comprehensive library for creating static, animated, and interactive visualizations -License: Python and MIT and OFL-1.1 and Public Domain +License: PSF-2.0 AND MIT AND CC0-1.0 URL: https://github.com/matplotlib/matplotlib Source0: https://github.com/matplotlib/matplotlib/archive/v%{version}/matplotlib-%{version}.tar.gz -# The config file for python-matplotlib -Source1: mplsetup.cfg -Source1000: https://github.com/QuLogic/mpl-images/archive/v3.8.1-with-freetype-2.13.1/matplotlib-3.8.1-with-freetype-2.13.1.tar.gz +Source1000: https://github.com/QuLogic/mpl-images/archive/v3.10.3-with-freetype-2.13.1/matplotlib-3.10.3-with-freetype-2.13.1.tar.gz Patch0001: 0001-matplotlibrc-path-search-fix.patch Patch0002: 0002-Set-FreeType-version-to-2.13.1-and-update-tolerances.patch BuildRequires: freetype-devel libpng-devel qhull-devel texlive-cm xorg-x11-server-Xvfb zlib-devel BuildRequires: python3-certifi python3-pybind11 gcc-c++ python3-setuptools_scm - +BuildRequires: pyproject-rpm-macros %description The package produces publication-quality figures in a variety of hardcopy formats and interactive environments @@ -41,6 +41,7 @@ Summary: Plotting with Python BuildRequires: python3-cairo python3-cycler >= 0.10.0 python3-dateutil python3-devel BuildRequires: python3-setuptools python3-gobject python3-kiwisolver python3-numpy BuildRequires: python3-pillow python3-pyparsing python3-pytz python3-six python3-sphinx +BuildRequires: python3-pip python3-wheel python3-meson-python Requires: dejavu-sans-fonts dvipng python-matplotlib-data = %{version}-%{release} Requires: python3-cairo python3-cycler >= 0.10.0 python3-dateutil python3-kiwisolver Requires: python3-matplotlib-tk = %{version}-%{release} python3-numpy @@ -89,24 +90,20 @@ Requires: python3-matplotlib = %{version}-%{release} Test data for python3-matplotlib. %prep -%autosetup -n matplotlib-%{version} -N -%patch0001 -p1 -%patch0002 -p1 -gzip -dc %SOURCE1000 | tar xvf - --transform='s~^mpl-images-3.8.1-with-freetype-2.13.1/\([^/]\+\)/~lib/\1/tests/baseline_images/~' - -# Copy setup.cfg to the builddir -cp -p %{SOURCE1} mplsetup.cfg +%autosetup -n matplotlib-%{version} -p1 +gzip -dc %SOURCE1000 | tar xvf - --transform='s~^mpl-images-3.10.3-with-freetype-2.13.1/\([^/]\+\)/~lib/\1/tests/baseline_images/~' %build +%set_build_flags export http_proxy=http://127.0.0.1/ find galleries -name '*.py' -exec chmod a-x '{}' \; -PLCONFIGDIR=$PWD %py3_build +MPLCONFIGDIR=$PWD %pyproject_wheel %build_backend_args %install export http_proxy=http://127.0.0.1/ -MPLCONFIGDIR=$PWD %py3_install +MPLCONFIGDIR=$PWD %pyproject3_install mkdir -p %{buildroot}%{_sysconfdir} %{buildroot}%{_datadir}/matplotlib mv %{buildroot}%{python3_sitearch}/matplotlib/mpl-data %{buildroot}%{_datadir}/matplotlib @@ -120,8 +117,9 @@ mv %{buildroot}%{python3_sitearch}/matplotlib/mpl-data %{buildroot}%{_datadir}/m %files -n python3-matplotlib -%doc README.md LICENSE/ -%{python3_sitearch}/{*egg-info,matplotlib-*-nspkg.pth,matplotlib/} +%doc README.md +%license LICENSE +%{python3_sitearch}/{matplotlib-*.dist-info/,matplotlib-*-nspkg.pth,matplotlib/} %{python3_sitearch}/mpl_toolkits/ %{python3_sitearch}/{pylab.py*,__pycache__/*} %exclude %{python3_sitearch}/matplotlib/tests/baseline_images/* @@ -147,6 +145,18 @@ mv %{buildroot}%{python3_sitearch}/matplotlib/mpl-data %{buildroot}%{_datadir}/m %{python3_sitearch}/matplotlib/backends/{tkagg.*,__pycache__/tkagg.*,_tkagg.*} %changelog +* Mon May 19 2025 yaoxin <1024769339@qq.com> - 3.10.3-1 +- Update to 3.10.3: + * Ensure text metric calculation always uses the text cache + * Improve layout of cheatsheets in sidebar + * Respect array alpha with interpolation_stage='rgba' in _Imagebase::_make_image + * Remove md5 usage to prevent issues on FIPS enabled systems + * Fix pyplot.matshow figure handling + * Fix modifying Axes' position also alters the original Bbox object used for initialization + * Fix title position for polar plots + * Add version gate to GTK4 calls when necessary + * Raise warning if both c and facecolors are used in scatter plot + * Tue Mar 12 2024 xu_ping <707078654@qq.com> - 3.8.2-1 - Upgrade version to 3.8.2