Update to latest version (#2220649)

This commit is contained in:
Elliott Sales de Andrade 2023-07-06 21:01:14 -04:00
parent bca414e4f1
commit 05ffcff315
11 changed files with 51 additions and 380 deletions

2
.gitignore vendored
View File

@ -98,3 +98,5 @@ matplotlib-1.0.0-without-gpc.tar.gz
/matplotlib-3.7.0-with-freetype-2.12.1.tar.gz
/matplotlib-3.7.1.tar.gz
/matplotlib-3.7.1-with-freetype-2.12.1.tar.gz
/matplotlib-3.7.2.tar.gz
/matplotlib-3.7.2-with-freetype-2.13.1.tar.gz

View File

@ -1,7 +1,7 @@
From e5fc2dc6299a3965fae77246f088a10633e6ba03 Mon Sep 17 00:00:00 2001
From 7f525ad4de95f9e9ec90a39498eefd22aadcedda Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Wed, 27 Sep 2017 19:35:59 -0400
Subject: [PATCH 1/8] matplotlibrc path search fix
Subject: [PATCH 1/4] matplotlibrc path search fix
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
@ -9,10 +9,10 @@ Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py
index b279c46516..27de76f0c4 100644
index ae68094000..06fb76827d 100644
--- a/lib/matplotlib/__init__.py
+++ b/lib/matplotlib/__init__.py
@@ -566,7 +566,8 @@ def get_cachedir():
@@ -570,7 +570,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 b279c46516..27de76f0c4 100644
def matplotlib_fname():
@@ -586,6 +587,7 @@ def matplotlib_fname():
@@ -590,6 +591,7 @@ def matplotlib_fname():
is not defined)
- On other platforms,
- ``$HOME/.matplotlib/matplotlibrc`` if ``$HOME`` is defined
@ -30,7 +30,7 @@ index b279c46516..27de76f0c4 100644
- Lastly, it looks in ``$MATPLOTLIBDATA/matplotlibrc``, which should always
exist.
"""
@@ -604,6 +606,7 @@ def matplotlib_fname():
@@ -608,6 +610,7 @@ def matplotlib_fname():
yield matplotlibrc
yield os.path.join(matplotlibrc, 'matplotlibrc')
yield os.path.join(get_configdir(), 'matplotlibrc')

View File

@ -1,7 +1,7 @@
From 42ccc6269120bea873873e3479f549b30004680b Mon Sep 17 00:00:00 2001
From 4fc7594b7f3eb3a9b8c9b2ea53aa7230cc7305a9 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Thu, 26 Jan 2023 06:40:06 -0500
Subject: [PATCH 2/8] Don't require oldest-supported-numpy
Subject: [PATCH 2/4] Don't require oldest-supported-numpy
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
@ -9,7 +9,7 @@ Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyproject.toml b/pyproject.toml
index 907b05a39b..81e3d80035 100644
index e887bd0975..673981f236 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -2,7 +2,7 @@
@ -19,8 +19,8 @@ index 907b05a39b..81e3d80035 100644
- "oldest-supported-numpy",
+ "numpy",
"pybind11>=2.6",
"setuptools>=42",
"setuptools_scm>=7",
]
--
2.41.0

View File

@ -1,37 +1,37 @@
From c00966e628018f2b1edc103c2c24e4296a6f24e3 Mon Sep 17 00:00:00 2001
From 3701d77ac6d708557ccc12dbbfe1ab114d36c319 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 3/8] 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>
---
lib/matplotlib/__init__.py | 2 +-
lib/matplotlib/tests/test_axes.py | 4 ++--
lib/matplotlib/tests/test_constrainedlayout.py | 8 ++++----
lib/matplotlib/tests/test_legend.py | 4 ++--
lib/matplotlib/tests/test_polar.py | 2 +-
lib/matplotlib/tests/test_tightlayout.py | 10 +++++-----
setupext.py | 15 +++++++++++++--
7 files changed, 28 insertions(+), 17 deletions(-)
lib/matplotlib/__init__.py | 2 +-
lib/matplotlib/tests/test_axes.py | 4 ++--
.../tests/test_constrainedlayout.py | 8 +++----
lib/matplotlib/tests/test_legend.py | 4 ++--
lib/matplotlib/tests/test_polar.py | 2 +-
lib/matplotlib/tests/test_tightlayout.py | 10 ++++-----
setupext.py | 21 +++++++++++++++++--
7 files changed, 34 insertions(+), 17 deletions(-)
diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py
index 27de76f0c4..179d7ed1ff 100644
index 06fb76827d..0760141c77 100644
--- a/lib/matplotlib/__init__.py
+++ b/lib/matplotlib/__init__.py
@@ -1284,7 +1284,7 @@ def is_interactive():
@@ -1288,7 +1288,7 @@ def is_interactive():
def _init_tests():
# The version of FreeType to install locally for running the
# tests. This must match the value in `setupext.py`
- 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 004f6320de..bbc3880a49 100644
index cef1c76af6..f1b7a0e884 100644
--- a/lib/matplotlib/tests/test_axes.py
+++ b/lib/matplotlib/tests/test_axes.py
@@ -7388,7 +7388,7 @@ def test_normal_axes():
@@ -7433,7 +7433,7 @@ def test_normal_axes():
]
for nn, b in enumerate(bbaxis):
targetbb = mtransforms.Bbox.from_bounds(*target[nn])
@ -40,7 +40,7 @@ index 004f6320de..bbc3880a49 100644
target = [
[150.0, 119.999, 930.0, 11.111],
@@ -7406,7 +7406,7 @@ def test_normal_axes():
@@ -7451,7 +7451,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 004f6320de..bbc3880a49 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 b0833052ad..c087baa0d5 100644
index ee08c375c7..8d72db556b 100644
--- a/lib/matplotlib/tests/test_constrainedlayout.py
+++ b/lib/matplotlib/tests/test_constrainedlayout.py
@@ -431,7 +431,7 @@ def test_hidden_axes():
@@ -432,7 +432,7 @@ def test_hidden_axes():
extents1 = np.copy(axs[0, 0].get_position().extents)
np.testing.assert_allclose(
@ -62,7 +62,7 @@ index b0833052ad..c087baa0d5 100644
def test_colorbar_align():
@@ -637,7 +637,7 @@ def test_compressed1():
@@ -638,7 +638,7 @@ def test_compressed1():
fig.draw_without_rendering()
pos = axs[0, 0].get_position()
@ -71,7 +71,7 @@ index b0833052ad..c087baa0d5 100644
pos = axs[0, 1].get_position()
np.testing.assert_allclose(pos.x1, 0.7024, atol=1e-3)
@@ -652,10 +652,10 @@ def test_compressed1():
@@ -653,10 +653,10 @@ def test_compressed1():
pos = axs[0, 0].get_position()
np.testing.assert_allclose(pos.x0, 0.06195, atol=1e-3)
@ -101,7 +101,7 @@ index a8d7fd107d..cbca9e93e9 100644
@image_comparison(['legend_stackplot.png'])
diff --git a/lib/matplotlib/tests/test_polar.py b/lib/matplotlib/tests/test_polar.py
index 1f8e6a75ba..ace40f5526 100644
index 9d6e78da2c..5f6ed538d1 100644
--- a/lib/matplotlib/tests/test_polar.py
+++ b/lib/matplotlib/tests/test_polar.py
@@ -321,7 +321,7 @@ def test_get_tightbbox_polar():
@ -136,15 +136,17 @@ index 968f0da7b5..89caa81b98 100644
diff --git a/setupext.py b/setupext.py
index a898d642d6..26cd6fe277 100644
index a898d642d6..b22d875d6f 100644
--- a/setupext.py
+++ b/setupext.py
@@ -176,13 +176,23 @@ _freetype_hashes = {
@@ -176,13 +176,29 @@ _freetype_hashes = {
'955e17244e9b38adb0c98df66abb50467312e6bb70eac07e49ce6bd1a20e809a',
'2.10.1':
'3a60d391fd579440561bf0e7f31af2222bc610ad6ce4d9d7bd2165bca8669110',
+ '2.10.2':
+ 'e09aa914e4f7a5d723ac381420949c55c0b90b15744adce5d1406046022186ab',
+ '2.10.3':
+ '9dfb4e11efd6e460a87b1991a64bc69344ee7dc219d9b29e7faabc1c168ce8b0',
+ '2.10.4':
+ '5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01b2c953269f658dac',
+ '2.11.0':
@ -156,16 +158,20 @@ index a898d642d6..26cd6fe277 100644
+ '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`.
-TESTING_VERSION_OF_FREETYPE = '2.6.1'
+TESTING_VERSION_OF_FREETYPE = '2.12.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
@@ -597,6 +607,7 @@ class FreeType(SetupPackage):
@@ -597,6 +613,7 @@ class FreeType(SetupPackage):
ext.extra_objects.insert(
0, str(src_path / 'objs' / '.libs' / libfreetype))
ext.define_macros.append(('FREETYPE_BUILD_TYPE', 'local'))

View File

@ -1,7 +1,7 @@
From c00da95dde370d3b04c0134cd10674d226830c67 Mon Sep 17 00:00:00 2001
From 5d12c697908d1103dc7fa2d915ad82d357975709 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Mon, 22 Aug 2022 18:43:28 -0400
Subject: [PATCH 4/8] Use old stride_windows implementation on 32-bit x86
Subject: [PATCH 4/4] Use old stride_windows implementation on 32-bit x86
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---

View File

@ -1,105 +0,0 @@
From c6282abd0b354707755e6f10881a67ed08c82614 Mon Sep 17 00:00:00 2001
From: Smeet nagda <81572407+smeet07@users.noreply.github.com>
Date: Tue, 23 May 2023 18:26:07 +0530
Subject: [PATCH 6/8] migrate from utcfromtimestamp to fromtimestamp (#25918)
closes #25912
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
doc/api/prev_api_changes/api_changes_3.7.0/removals.rst | 2 +-
doc/conf.py | 5 +++--
lib/matplotlib/backends/backend_pdf.py | 3 ++-
lib/matplotlib/backends/backend_ps.py | 5 +++--
lib/matplotlib/backends/backend_svg.py | 2 +-
5 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/doc/api/prev_api_changes/api_changes_3.7.0/removals.rst b/doc/api/prev_api_changes/api_changes_3.7.0/removals.rst
index c8f4996665..76ce9ff718 100644
--- a/doc/api/prev_api_changes/api_changes_3.7.0/removals.rst
+++ b/doc/api/prev_api_changes/api_changes_3.7.0/removals.rst
@@ -7,7 +7,7 @@ Removals
These methods convert from unix timestamps to matplotlib floats, but are not
used internally to Matplotlib, and should not be needed by end users. To
convert a unix timestamp to datetime, simply use
-`datetime.datetime.utcfromtimestamp`, or to use NumPy `~numpy.datetime64`
+`datetime.datetime.fromtimestamp`, or to use NumPy `~numpy.datetime64`
``dt = np.datetime64(e*1e6, 'us')``.
Locator and Formatter wrapper methods
diff --git a/doc/conf.py b/doc/conf.py
index acb36254db..eecd1957fb 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -22,6 +22,7 @@ import warnings
import matplotlib
+from datetime import timezone
from datetime import datetime
import time
@@ -36,8 +37,8 @@ CIRCLECI = 'CIRCLECI' in os.environ
# Parse year using SOURCE_DATE_EPOCH, falling back to current time.
# https://reproducible-builds.org/specs/source-date-epoch/
-sourceyear = datetime.utcfromtimestamp(
- int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))).year
+sourceyear = datetime.fromtimestamp(
+ int(os.environ.get('SOURCE_DATE_EPOCH', time.time())), timezone.utc).year
# If your extensions are in another directory, add it here. If the directory
# is relative to the documentation root, use os.path.abspath to make it
diff --git a/lib/matplotlib/backends/backend_pdf.py b/lib/matplotlib/backends/backend_pdf.py
index 7bd0afc456..bbbca64c7a 100644
--- a/lib/matplotlib/backends/backend_pdf.py
+++ b/lib/matplotlib/backends/backend_pdf.py
@@ -5,6 +5,7 @@ Author: Jouni K Seppänen <jks@iki.fi> and others.
"""
import codecs
+from datetime import timezone
from datetime import datetime
from enum import Enum
from functools import total_ordering
@@ -153,7 +154,7 @@ def _create_pdf_info_dict(backend, metadata):
# See https://reproducible-builds.org/specs/source-date-epoch/
source_date_epoch = os.getenv("SOURCE_DATE_EPOCH")
if source_date_epoch:
- source_date = datetime.utcfromtimestamp(int(source_date_epoch))
+ source_date = datetime.fromtimestamp(int(source_date_epoch), timezone.utc)
source_date = source_date.replace(tzinfo=UTC)
else:
source_date = datetime.today()
diff --git a/lib/matplotlib/backends/backend_ps.py b/lib/matplotlib/backends/backend_ps.py
index 68dd61e6f1..75ed4ff557 100644
--- a/lib/matplotlib/backends/backend_ps.py
+++ b/lib/matplotlib/backends/backend_ps.py
@@ -841,8 +841,9 @@ class FigureCanvasPS(FigureCanvasBase):
# See https://reproducible-builds.org/specs/source-date-epoch/
source_date_epoch = os.getenv("SOURCE_DATE_EPOCH")
dsc_comments["CreationDate"] = (
- datetime.datetime.utcfromtimestamp(
- int(source_date_epoch)).strftime("%a %b %d %H:%M:%S %Y")
+ datetime.datetime.fromtimestamp(
+ int(source_date_epoch),
+ datetime.timezone.utc).strftime("%a %b %d %H:%M:%S %Y")
if source_date_epoch
else time.ctime())
dsc_comments = "\n".join(
diff --git a/lib/matplotlib/backends/backend_svg.py b/lib/matplotlib/backends/backend_svg.py
index df39e620f8..4a6c1bb426 100644
--- a/lib/matplotlib/backends/backend_svg.py
+++ b/lib/matplotlib/backends/backend_svg.py
@@ -410,7 +410,7 @@ class RendererSVG(RendererBase):
# See https://reproducible-builds.org/specs/source-date-epoch/
date = os.getenv("SOURCE_DATE_EPOCH")
if date:
- date = datetime.datetime.utcfromtimestamp(int(date))
+ date = datetime.datetime.fromtimestamp(int(date), datetime.timezone.utc)
metadata['Date'] = date.replace(tzinfo=UTC).isoformat()
else:
metadata['Date'] = datetime.datetime.today().isoformat()
--
2.41.0

View File

@ -1,79 +0,0 @@
From adc9461c316b5e6f693d362140bf5483aa77ad81 Mon Sep 17 00:00:00 2001
From: Thomas A Caswell <tcaswell@gmail.com>
Date: Mon, 19 Jun 2023 21:28:02 -0400
Subject: [PATCH 7/8] MNT: py312 deprecates pickling objects in itertools
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
lib/matplotlib/cbook/__init__.py | 3 +++
lib/matplotlib/figure.py | 11 +++++++++++
lib/matplotlib/tests/test_cbook.py | 7 +++++++
3 files changed, 21 insertions(+)
diff --git a/lib/matplotlib/cbook/__init__.py b/lib/matplotlib/cbook/__init__.py
index 1e51f6a834..b0d06cddf6 100644
--- a/lib/matplotlib/cbook/__init__.py
+++ b/lib/matplotlib/cbook/__init__.py
@@ -206,9 +206,11 @@ class CallbackRegistry:
for s, d in self.callbacks.items()},
# It is simpler to reconstruct this from callbacks in __setstate__.
"_func_cid_map": None,
+ "_cid_gen": next(self._cid_gen)
}
def __setstate__(self, state):
+ cid_count = state.pop('_cid_gen')
vars(self).update(state)
self.callbacks = {
s: {cid: _weak_or_strong_ref(func, self._remove_proxy)
@@ -217,6 +219,7 @@ class CallbackRegistry:
self._func_cid_map = {
s: {proxy: cid for cid, proxy in d.items()}
for s, d in self.callbacks.items()}
+ self._cid_gen = itertools.count(cid_count)
def connect(self, signal, func):
"""Register *func* to be called when signal *signal* is generated."""
diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py
index c6df929e04..b64c677b5d 100644
--- a/lib/matplotlib/figure.py
+++ b/lib/matplotlib/figure.py
@@ -106,6 +106,17 @@ class _AxesStack:
"""Return the active axes, or None if the stack is empty."""
return max(self._axes, key=self._axes.__getitem__, default=None)
+ def __getstate__(self):
+ return {
+ **vars(self),
+ "_counter": max(self._axes.values(), default=0)
+ }
+
+ def __setstate__(self, state):
+ next_counter = state.pop('_counter')
+ vars(self).update(state)
+ self._counter = itertools.count(next_counter)
+
class SubplotParams:
"""
diff --git a/lib/matplotlib/tests/test_cbook.py b/lib/matplotlib/tests/test_cbook.py
index aa5c999b70..da3868b0f8 100644
--- a/lib/matplotlib/tests/test_cbook.py
+++ b/lib/matplotlib/tests/test_cbook.py
@@ -207,6 +207,13 @@ class Test_callback_registry:
assert self.callbacks._func_cid_map != {}
assert self.callbacks.callbacks != {}
+ def test_cid_restore(self):
+ cb = cbook.CallbackRegistry()
+ cb.connect('a', lambda: None)
+ cb2 = pickle.loads(pickle.dumps(cb))
+ cid = cb2.connect('c', lambda: None)
+ assert cid == 1
+
@pytest.mark.parametrize('pickle', [True, False])
def test_callback_complete(self, pickle):
# ensure we start with an empty registry
--
2.41.0

View File

@ -1,79 +0,0 @@
From a74988db693861d86c85a1307d51b9017af3c33e Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Wed, 21 Jun 2023 22:14:27 -0400
Subject: [PATCH 8/8] Avoid Py_VerboseFlag deprecation from Python 3.12
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
lib/matplotlib/tri/_triangulation.py | 4 +++-
src/_qhull_wrapper.cpp | 12 ++++++++----
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/lib/matplotlib/tri/_triangulation.py b/lib/matplotlib/tri/_triangulation.py
index fa03a9c030..15bb1760c5 100644
--- a/lib/matplotlib/tri/_triangulation.py
+++ b/lib/matplotlib/tri/_triangulation.py
@@ -1,3 +1,5 @@
+import sys
+
import numpy as np
from matplotlib import _api
@@ -55,7 +57,7 @@ class Triangulation:
if triangles is None:
# No triangulation specified, so use matplotlib._qhull to obtain
# Delaunay triangulation.
- self.triangles, self._neighbors = _qhull.delaunay(x, y)
+ self.triangles, self._neighbors = _qhull.delaunay(x, y, sys.flags.verbose)
self.is_delaunay = True
else:
# Triangulation specified. Copy, since we may correct triangle
diff --git a/src/_qhull_wrapper.cpp b/src/_qhull_wrapper.cpp
index e27c4215b9..6b8173d3a3 100644
--- a/src/_qhull_wrapper.cpp
+++ b/src/_qhull_wrapper.cpp
@@ -258,10 +258,12 @@ delaunay(PyObject *self, PyObject *args)
npy_intp npoints;
const double* x;
const double* y;
+ int verbose = 0;
- if (!PyArg_ParseTuple(args, "O&O&",
+ if (!PyArg_ParseTuple(args, "O&O&i:delaunay",
&xarray.converter_contiguous, &xarray,
- &yarray.converter_contiguous, &yarray)) {
+ &yarray.converter_contiguous, &yarray,
+ &verbose)) {
return NULL;
}
@@ -288,7 +290,7 @@ delaunay(PyObject *self, PyObject *args)
}
CALL_CPP("qhull.delaunay",
- (ret = delaunay_impl(npoints, x, y, Py_VerboseFlag == 0)));
+ (ret = delaunay_impl(npoints, x, y, verbose == 0)));
return ret;
}
@@ -302,7 +304,7 @@ version(PyObject *self, PyObject *arg)
static PyMethodDef qhull_methods[] = {
{"delaunay", delaunay, METH_VARARGS,
- "delaunay(x, y, /)\n"
+ "delaunay(x, y, verbose, /)\n"
"--\n\n"
"Compute a Delaunay triangulation.\n"
"\n"
@@ -311,6 +313,8 @@ static PyMethodDef qhull_methods[] = {
"x, y : 1d arrays\n"
" The coordinates of the point set, which must consist of at least\n"
" three unique points.\n"
+ "verbose : int\n"
+ " Python's verbosity level.\n"
"\n"
"Returns\n"
"-------\n"
--
2.41.0

View File

@ -1,60 +0,0 @@
From 86d7e391a75838ccdc22b3e98dcf40954e5b25a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <thrnciar@redhat.com>
Date: Tue, 27 Jun 2023 15:34:58 +0200
Subject: [PATCH] Skip tests failing with Python 3.12.0b3+
---
lib/matplotlib/tests/test_backends_interactive.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lib/matplotlib/tests/test_backends_interactive.py b/lib/matplotlib/tests/test_backends_interactive.py
index 24d47bb..4008482 100644
--- a/lib/matplotlib/tests/test_backends_interactive.py
+++ b/lib/matplotlib/tests/test_backends_interactive.py
@@ -193,6 +193,8 @@ def test_interactive_backend(env, toolbar):
pytest.skip("toolmanager is not implemented for macosx.")
if env["MPLBACKEND"] == "wx":
pytest.skip("wx backend is deprecated; tests failed on appveyor")
+ if env["MPLBACKEND"] in ["qtagg", "qtcairo"]:
+ pytest.skip("qtagg and qtcairo backends are failing with Python 3.12")
try:
proc = _run_helper(
_test_interactive_impl,
@@ -272,6 +274,8 @@ for param in _thread_safe_backends:
@pytest.mark.parametrize("env", _thread_safe_backends)
@pytest.mark.flaky(reruns=3)
def test_interactive_thread_safety(env):
+ if env["MPLBACKEND"] in ["qtagg"]:
+ pytest.skip("qtagg backend is failing with Python 3.12")
proc = _run_helper(_test_thread_impl, timeout=_test_timeout, extra_env=env)
assert proc.stdout.count("CloseEvent") == 1
@@ -336,6 +340,7 @@ def _implcore():
matplotlib.backends.backend_qt5.qApp
+@pytest.mark.skip(reason="Failing with Python 3.12")
def test_qt5backends_uses_qt5():
qt5_bindings = [
dep for dep in ['PyQt5', 'pyside2']
@@ -467,6 +472,8 @@ def _lazy_headless():
@pytest.mark.skipif(sys.platform != "linux", reason="this a linux-only test")
@pytest.mark.parametrize("env", _get_testable_interactive_backends())
def test_lazy_linux_headless(env):
+ if env["MPLBACKEND"] in ["qtagg", "qtcairo"]:
+ pytest.skip("qtagg and qtcairo backends are failing with Python 3.12")
proc = _run_helper(
_lazy_headless,
env.pop('MPLBACKEND'), env.pop("BACKEND_DEPS"),
@@ -550,6 +557,8 @@ for param in _blit_backends:
# subprocesses can struggle to get the display, so rerun a few times
@pytest.mark.flaky(reruns=4)
def test_blitting_events(env):
+ if env["MPLBACKEND"] in ["qtagg", "qtcairo"]:
+ pytest.skip("qtagg and qtcairo backends are failing with Python 3.12")
proc = _run_helper(
_test_number_of_draws_script, timeout=_test_timeout, extra_env=env)
# Count the number of draw_events we got. We could count some initial
--
2.40.1

View File

@ -30,14 +30,14 @@
%global _docdir_fmt %{name}
# Updated test images for new FreeType.
%global mpl_images_version 3.7.1
%global mpl_images_version 3.7.2
# The version of FreeType in this Fedora branch.
%global ftver 2.12.1
%global ftver 2.13.1
Name: python-matplotlib
Version: 3.7.1
%global Version 3.7.1
Version: 3.7.2
%global Version 3.7.2
Release: %autorelease
Summary: Python 2D plotting library
# qt_editor backend is MIT
@ -59,16 +59,6 @@ Patch1003: 0003-Set-FreeType-version-to-%{ftver}-and-update-tolerances.patc
# https://github.com/matplotlib/matplotlib/pull/21190#issuecomment-1223271888
Patch0001: 0004-Use-old-stride_windows-implementation-on-32-bit-x86.patch
# https://github.com/matplotlib/matplotlib/pull/25068
Source2000: pgf_pdflatex.pdf
Source2001: pgf_rcupdate2.pdf
# https://github.com/matplotlib/matplotlib/pull/25918
Patch0002: 0006-migrate-from-utcfromtimestamp-to-fromtimestamp-25918.patch
# https://github.com/matplotlib/matplotlib/pull/26154
Patch0003: 0007-MNT-py312-deprecates-pickling-objects-in-itertools.patch
# https://github.com/matplotlib/matplotlib/pull/26165
Patch0004: 0008-Avoid-Py_VerboseFlag-deprecation-from-Python-3.12.patch
Patch0005: 0009-Skip-tests-failing-with-Python-3.12.0b3.patch
BuildRequires: gcc
BuildRequires: gcc-c++
@ -315,8 +305,6 @@ cp -p %{SOURCE1} mplsetup.cfg
# Backports or reported upstream
%autopatch -p1 -M 999
# https://github.com/matplotlib/matplotlib/pull/25068
cp -a %SOURCE2000 %SOURCE2001 lib/matplotlib/tests/baseline_images/test_backend_pgf/
%generate_buildrequires

View File

@ -1,4 +1,2 @@
SHA512 (matplotlib-3.7.1.tar.gz) = d7db4213d5b38eba779ba06ffaa8e67a435192e4a8cf62f8e1cd4b8079cd257b2e83cb79926df012b7084c785c0ce8b03275035f68cfcf0a36b0dda7322f2e67
SHA512 (matplotlib-3.7.1-with-freetype-2.12.1.tar.gz) = 51497948bc4759f5ec4064cb40a2d6cd5214addd62ef3d1a1c887bece6c60e65448c918f2c7b56532db344ac22127c5661bbf324feca09911c5213bdca2f0c14
SHA512 (pgf_pdflatex.pdf) = dc81cc2247f54a2aaf9507ce1db556d91170674796b564d32bfb4c23f38effab6543394cb6caee3c29a32639c9d848517b400d1cac8d20f90678367818a62aa1
SHA512 (pgf_rcupdate2.pdf) = 8c0a71047871a055de01a4f0a90aeda9da27e53338d1e89cb20bd52bc54e40a1180df933de0f27c9116d3e983d03b0c47008bebfcf110cf282f8d1d19c026070
SHA512 (matplotlib-3.7.2.tar.gz) = 3ddb223c869c01cf71ab65a628a3c996eed1ff8b2375c02e3158a5750652a5d8277a55706e50890c15c14c7a104db01f01b01ca8964f85b6ffec104fc273872d
SHA512 (matplotlib-3.7.2-with-freetype-2.13.1.tar.gz) = 1a8bdaa0b6b3ec3d310aff96c04c99d9350534992592d8d3c99530ef63aa8a4289c5195a791139b9d69b8472eb010ee3d8a248fa8e8dc3941403387321db6e14