extra/python-matplotlib to 3.9.2-1

This commit is contained in:
David Beauchamp 2024-08-28 13:04:53 -04:00
parent cc54d32522
commit 2ac9f36ab1
4 changed files with 115 additions and 109 deletions

View file

@ -1,7 +1,7 @@
pkgbase = python-matplotlib
pkgdesc = A python plotting library, making publication quality plots
pkgver = 3.8.4
pkgrel = 2
pkgver = 3.9.2
pkgrel = 1
url = https://matplotlib.org
arch = x86_64
license = custom
@ -74,13 +74,13 @@ pkgbase = python-matplotlib
optdepends = texlive-fontsrecommended: usetex dependencies
optdepends = texlive-latexrecommended: usetex usage with pdflatex
optdepends = python-certifi: https support
source = git+https://github.com/matplotlib/matplotlib.git#tag=v3.8.4?signed
source = https://github.com/QuLogic/mpl-images/archive/v3.8.3-with-freetype-2.13.1/mpl-images-3.8.3-ft2.13.1.tar.gz
source = git+https://github.com/matplotlib/matplotlib.git#tag=v3.9.2?signed
source = https://github.com/QuLogic/mpl-images/archive/v3.9.1-with-freetype-2.13.1/mpl-images-3.9.1-ft2.13.1.tar.gz
source = freetype.patch
validpgpkeys = 23CAB59E3332F94D26BEF0378D86E7FAE5EB0C10
validpgpkeys = EB8322187FD451192E430A7279B3FEC456F12599
b2sums = bd245e0bdac7f096b01b187b74c4aa3947cd14d25ef6fefccf25a079171460bc4da02fb00ae2b8c62c6fd44039a2f8cbad2fe034945418fcc5b0e3caf85cc26b
b2sums = dabc8af36c6a489fa64ffe341801b8c82e578b6c864745885e18f39c531193187cf5d8030bb25f81abd9ec3f37a890da3ca6a2e30772b61906a80ac1ca53b140
b2sums = ccc679b9108342a9c0ceb67ccb1158c7409c7033e5b6ce3cb4ca53b9351b3aa8557a95f8a823ee5f1cd60be4b901230ba993e06db6977a8c7db1419ba0fe4983
b2sums = 32d283d87c52608bd9ef61ee9fbeb15ced4e0fd575395a8d1eeeeaddb18ed07530cf30cb791709ad74c381e2f4efe93da5af4970a88ac64d0b2ec4c3166e37f5
b2sums = 91726a2a3e76cb46f9fec612f6193b4c55f0b4b21f0089520c3733521887f083b4ec16d17906f9eba57dcde3d2015e429de7b7a236de2ab58eebd88187f6bf5c
b2sums = 824c69807b13853ad8be20ded60eca18260af50b652a317dc8235d5828c060982363d2aa6feb98d5340e86dab5b87c7f6e7dd1f4c050e2e3613266209e633a60
pkgname = python-matplotlib

View file

@ -0,0 +1,4 @@
[python-matplotlib]
source = "git"
git = "https://github.com/matplotlib/matplotlib.git"
prefix = "v"

View file

@ -10,9 +10,9 @@
# - disable lto via setup.cfg
pkgname=python-matplotlib
pkgver=3.8.4
pkgrel=2
_mpl_images_ver=3.8.3
pkgver=3.9.2
pkgrel=1
_mpl_images_ver=3.9.1
pkgdesc="A python plotting library, making publication quality plots"
arch=(x86_64)
url="https://matplotlib.org"
@ -47,9 +47,9 @@ _ftver=2.13.1
source=(git+https://github.com/matplotlib/matplotlib.git#tag=v${pkgver}?signed
https://github.com/QuLogic/mpl-images/archive/v${_mpl_images_ver}-with-freetype-${_ftver}/mpl-images-${_mpl_images_ver}-ft${_ftver}.tar.gz
freetype.patch)
b2sums=('bd245e0bdac7f096b01b187b74c4aa3947cd14d25ef6fefccf25a079171460bc4da02fb00ae2b8c62c6fd44039a2f8cbad2fe034945418fcc5b0e3caf85cc26b'
'dabc8af36c6a489fa64ffe341801b8c82e578b6c864745885e18f39c531193187cf5d8030bb25f81abd9ec3f37a890da3ca6a2e30772b61906a80ac1ca53b140'
'ccc679b9108342a9c0ceb67ccb1158c7409c7033e5b6ce3cb4ca53b9351b3aa8557a95f8a823ee5f1cd60be4b901230ba993e06db6977a8c7db1419ba0fe4983')
b2sums=('32d283d87c52608bd9ef61ee9fbeb15ced4e0fd575395a8d1eeeeaddb18ed07530cf30cb791709ad74c381e2f4efe93da5af4970a88ac64d0b2ec4c3166e37f5'
'91726a2a3e76cb46f9fec612f6193b4c55f0b4b21f0089520c3733521887f083b4ec16d17906f9eba57dcde3d2015e429de7b7a236de2ab58eebd88187f6bf5c'
'824c69807b13853ad8be20ded60eca18260af50b652a317dc8235d5828c060982363d2aa6feb98d5340e86dab5b87c7f6e7dd1f4c050e2e3613266209e633a60')
validpgpkeys=(23CAB59E3332F94D26BEF0378D86E7FAE5EB0C10 # Elliott Sales de Andrade <quantum.analyst@gmail.com>
EB8322187FD451192E430A7279B3FEC456F12599) # Kyle Sunden <contact@ksunden.space>
@ -59,12 +59,8 @@ prepare() {
rm -r .git
# Don't require oldest-supported-numpy
sed -e 's|oldest-supported-numpy|numpy|' -i pyproject.toml
# Use system freetype and qhull
sed -e 's|#system_freetype = False|system_freetype = True|' -e 's|#system_qhull = False|system_qhull = True|' mplsetup.cfg.template > mplsetup.cfg
patch -p1 < ../freetype.patch # From Fedora/upstream
sed -e 's|2_000_000|2_500_000|' -i lib/matplotlib/tests/test_backends_interactive.py
# Install tests for check()
sed -i 's|#tests = False|tests = True|' mplsetup.cfg
# Use appropriate baseline images for tests
for _module in matplotlib mpl_toolkits
do
@ -75,7 +71,9 @@ prepare() {
build() {
cd matplotlib
export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
python -m build --wheel --no-isolation
python -m build --wheel --no-isolation \
-C setup-args=-Dsystem-freetype=true \
-C setup-args=-Dsystem-qhull=true
}
check() {
@ -83,9 +81,17 @@ check() {
export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
python -m venv --system-site-packages test-env
test-env/bin/python -m installer dist/*.whl
# Use appropriate baseline images for tests
local python_version=`python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))'`
for _module in matplotlib mpl_toolkits
do
cp -r lib/${_module}/* test-env/lib/python${python_version}/site-packages/${_module}
cp -r ../mpl-images-${_mpl_images_ver}-with-freetype-${_ftver}/lib/${_module}/* test-env/lib/python${python_version}/site-packages/${_module}
done
# test_ipynb: https://github.com/matplotlib/matplotlib/issues/21654 fixed but `ModuleNotFoundError: No module named 'matplotlib'`
# test_compressed1: https://github.com/QuLogic/mpl-images/issues/4
XDG_RUNTIME_DIR=/tmp/runtime-build \
PYTHONPATH=test-env/lib/python${python_version}/site-packages \
xvfb-run -a -s "-screen 0 640x480x24" \
test-env/bin/python -m pytest -ra -n auto -v --color=yes --pyargs matplotlib mpl_toolkits.{axes_grid1,axisartist,mplot3d} \
-k 'not test_ipynb and not test_compressed1 and not test_multi_font_type3 and not test_multi_font_type42 and not test_figure_legend_outside'
@ -95,7 +101,7 @@ package() {
cd matplotlib
export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
python -m installer --destdir="${pkgdir}" dist/*.whl
install -Dm644 doc/users/project/license.rst -t "${pkgdir}"/usr/share/licenses/${pkgname}/
install -Dm644 doc/devel/license.rst -t "${pkgdir}"/usr/share/licenses/${pkgname}/
# Remove tests
rm -r "${pkgdir}"$(python -c "import site; print(site.getsitepackages()[0])")/{matplotlib,mpl_toolkits/*}/tests/
}

View file

@ -1,36 +1,51 @@
From 00c02f0c02e9927d5bf9cab6f7d276d03afad558 Mon Sep 17 00:00:00 2001
From d2ce17b7096e9f83f9ba4ac37052fe5d2e07f223 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Fri, 14 Feb 2020 06:05:42 -0500
Subject: [PATCH 2/4] Set FreeType version to 2.12.1 and update tolerances.
Subject: [PATCH 3/4] Set FreeType version to 2.13.1 and update tolerances
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
extern/meson.build | 2 +-
lib/matplotlib/__init__.py | 2 +-
lib/matplotlib/tests/test_axes.py | 4 ++--
lib/matplotlib/tests/test_constrainedlayout.py | 6 +++---
lib/matplotlib/tests/test_backend_pgf.py | 2 +-
lib/matplotlib/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 | 15 +++++++++++++--
6 files changed, 25 insertions(+), 14 deletions(-)
8 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/extern/meson.build b/extern/meson.build
index 662feb7872..df42b908af 100644
--- a/extern/meson.build
+++ b/extern/meson.build
@@ -14,7 +14,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 5eae4b50e2..1e68e9b991 100644
index 346e3d3454..ebf5818417 100644
--- a/lib/matplotlib/__init__.py
+++ b/lib/matplotlib/__init__.py
@@ -1212,7 +1212,7 @@ default_test_modules = [
@@ -1313,7 +1313,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.12.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 a230af2ac1..9cadbd7975 100644
index 0ed5a11c13..ee220f1854 100644
--- a/lib/matplotlib/tests/test_axes.py
+++ b/lib/matplotlib/tests/test_axes.py
@@ -7203,7 +7203,7 @@ def test_normal_axes():
@@ -7714,7 +7714,7 @@ def test_normal_axes():
]
for nn, b in enumerate(bbaxis):
targetbb = mtransforms.Bbox.from_bounds(*target[nn])
@ -39,7 +54,7 @@ index a230af2ac1..9cadbd7975 100644
target = [
[150.0, 119.999, 930.0, 11.111],
@@ -7221,7 +7221,7 @@ def test_normal_axes():
@@ -7732,7 +7732,7 @@ def test_normal_axes():
target = [85.5138, 75.88888, 1021.11, 1017.11]
targetbb = mtransforms.Bbox.from_bounds(*target)
@ -48,24 +63,24 @@ index a230af2ac1..9cadbd7975 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_svg.py b/lib/matplotlib/tests/test_backend_svg.py
index 680efd6737..1c1900a443 100644
--- a/lib/matplotlib/tests/test_backend_svg.py
+++ b/lib/matplotlib/tests/test_backend_svg.py
@@ -74,7 +74,7 @@ def test_bold_font_output():
ax.set_title('bold-title', fontweight='bold')
-@image_comparison(['bold_font_output_with_none_fonttype.svg'])
+@image_comparison(['bold_font_output_with_none_fonttype.svg'], tol=15)
def test_bold_font_output_with_none_fonttype():
plt.rcParams['svg.fonttype'] = 'none'
fig, ax = plt.subplots()
diff --git a/lib/matplotlib/tests/test_backend_pgf.py b/lib/matplotlib/tests/test_backend_pgf.py
index 8a83515f16..26bc9d6c48 100644
--- a/lib/matplotlib/tests/test_backend_pgf.py
+++ b/lib/matplotlib/tests/test_backend_pgf.py
@@ -165,7 +165,7 @@ def test_pathclip():
# test mixed mode rendering
@needs_pgf_xelatex
@pytest.mark.backend('pgf')
-@image_comparison(['pgf_mixedmode.pdf'], style='default')
+@image_comparison(['pgf_mixedmode.pdf'], style='default', tol=0.87)
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 35eb850fcd..31086ae5b7 100644
index 4dc4d9501e..47a4e80bb5 100644
--- a/lib/matplotlib/tests/test_constrainedlayout.py
+++ b/lib/matplotlib/tests/test_constrainedlayout.py
@@ -431,7 +431,7 @@ def test_hidden_axes():
@@ -435,7 +435,7 @@ def test_hidden_axes():
extents1 = np.copy(axs[0, 0].get_position().extents)
np.testing.assert_allclose(
@ -74,16 +89,19 @@ index 35eb850fcd..31086ae5b7 100644
def test_colorbar_align():
@@ -637,7 +637,7 @@ def test_compressed1():
@@ -641,9 +641,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-3)
+ np.testing.assert_allclose(pos.x1, 0.7024, atol=1e-2)
@@ -652,7 +652,7 @@ def test_compressed1():
# wider than tall
fig, axs = plt.subplots(2, 3, layout='compressed',
@@ -656,10 +656,10 @@ def test_compressed1():
pos = axs[0, 0].get_position()
np.testing.assert_allclose(pos.x0, 0.06195, atol=1e-3)
@ -91,12 +109,32 @@ index 35eb850fcd..31086ae5b7 100644
+ 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-3)
+ np.testing.assert_allclose(pos.y0, 0.1934, atol=1e-2)
@pytest.mark.parametrize('arg, state', [
diff --git a/lib/matplotlib/tests/test_legend.py b/lib/matplotlib/tests/test_legend.py
index 0353f1408b..f5b341daaa 100644
--- a/lib/matplotlib/tests/test_legend.py
+++ b/lib/matplotlib/tests/test_legend.py
@@ -520,9 +520,9 @@ def test_figure_legend_outside():
fig.draw_without_rendering()
assert_allclose(axs.get_window_extent().extents,
- axbb[nn])
+ axbb[nn], rtol=1)
assert_allclose(leg.get_window_extent().extents,
- legbb[nn])
+ legbb[nn], rtol=1)
@image_comparison(['legend_stackplot.png'],
diff --git a/lib/matplotlib/tests/test_polar.py b/lib/matplotlib/tests/test_polar.py
index c51508ae22..942ffcb521 100644
index 6b3c08d2eb..5160112e37 100644
--- a/lib/matplotlib/tests/test_polar.py
+++ b/lib/matplotlib/tests/test_polar.py
@@ -314,7 +314,7 @@ def test_get_tightbbox_polar():
@@ -321,7 +321,7 @@ def test_get_tightbbox_polar():
fig.canvas.draw()
bb = ax.get_tightbbox(fig.canvas.get_renderer())
assert_allclose(
@ -106,70 +144,28 @@ index c51508ae22..942ffcb521 100644
@check_figures_equal(extensions=["png"])
diff --git a/lib/matplotlib/tests/test_tightlayout.py b/lib/matplotlib/tests/test_tightlayout.py
index 1eb7b4b453..697eba3211 100644
index 9c654f4d1f..9678e34a80 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()
@@ -174,13 +174,13 @@ def test_outward_ticks():
# 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]]]
expected = [
- [[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]],
+ [[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])
expected[nn])
diff --git a/setupext.py b/setupext.py
index 69835c12f7..79ee6174e1 100644
--- a/setupext.py
+++ b/setupext.py
@@ -168,14 +168,28 @@ _freetype_hashes = {
'955e17244e9b38adb0c98df66abb50467312e6bb70eac07e49ce6bd1a20e809a',
'2.10.1':
'3a60d391fd579440561bf0e7f31af2222bc610ad6ce4d9d7bd2165bca8669110',
+ '2.10.2':
+ 'e09aa914e4f7a5d723ac381420949c55c0b90b15744adce5d1406046022186ab',
+ '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.36.1
2.44.0