From 76e50b9ad7c741c3f4476349b792980521df6c43 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 24 Aug 2021 05:06:29 -0400 Subject: [PATCH] Fix a broken test. --- 0001-matplotlibrc-path-search-fix.patch | 2 +- ...sion-to-2.11.0-and-update-tolerances.patch | 2 +- ...-increase-tolerance-on-rcupdate-test.patch | 2 +- ...vironment-is-passed-to-headless-test.patch | 2 +- ...a-few-test-tolerances-on-some-arches.patch | 2 +- ...x-broken-QApplication-init-in-a-test.patch | 26 +++++++++++++++++++ python-matplotlib.spec | 3 +++ 7 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 0006-Fix-broken-QApplication-init-in-a-test.patch diff --git a/0001-matplotlibrc-path-search-fix.patch b/0001-matplotlibrc-path-search-fix.patch index 84455fc..5746098 100644 --- a/0001-matplotlibrc-path-search-fix.patch +++ b/0001-matplotlibrc-path-search-fix.patch @@ -1,7 +1,7 @@ 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/5] matplotlibrc path search fix +Subject: [PATCH 1/6] matplotlibrc path search fix Signed-off-by: Elliott Sales de Andrade --- 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 e7c781f..94c664e 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,7 +1,7 @@ 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/5] Set FreeType version to 2.11.0 and update tolerances. +Subject: [PATCH 2/6] Set FreeType version to 2.11.0 and update tolerances. Signed-off-by: Elliott Sales de Andrade --- diff --git a/0003-Slightly-increase-tolerance-on-rcupdate-test.patch b/0003-Slightly-increase-tolerance-on-rcupdate-test.patch index 4d6e8da..406b9f8 100644 --- a/0003-Slightly-increase-tolerance-on-rcupdate-test.patch +++ b/0003-Slightly-increase-tolerance-on-rcupdate-test.patch @@ -1,7 +1,7 @@ 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/5] Slightly increase tolerance on rcupdate test. +Subject: [PATCH 3/6] Slightly increase tolerance on rcupdate test. Signed-off-by: Elliott Sales de Andrade --- diff --git a/0004-Ensure-full-environment-is-passed-to-headless-test.patch b/0004-Ensure-full-environment-is-passed-to-headless-test.patch index f2c2b6e..1005982 100644 --- a/0004-Ensure-full-environment-is-passed-to-headless-test.patch +++ b/0004-Ensure-full-environment-is-passed-to-headless-test.patch @@ -1,7 +1,7 @@ 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/5] Ensure full environment is passed to headless test. +Subject: [PATCH 4/6] Ensure full environment is passed to headless test. Otherwise, e.g., `PYTHONPATH` is not available. diff --git a/0005-Increase-a-few-test-tolerances-on-some-arches.patch b/0005-Increase-a-few-test-tolerances-on-some-arches.patch index 91a20e5..7e73dd0 100644 --- a/0005-Increase-a-few-test-tolerances-on-some-arches.patch +++ b/0005-Increase-a-few-test-tolerances-on-some-arches.patch @@ -1,7 +1,7 @@ From 6279bb6519e33fa875a30fab4fcf86d4f05adafd Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 24 Aug 2021 04:47:50 -0400 -Subject: [PATCH 5/5] Increase a few test tolerances on some arches. +Subject: [PATCH 5/6] Increase a few test tolerances on some arches. Signed-off-by: Elliott Sales de Andrade --- diff --git a/0006-Fix-broken-QApplication-init-in-a-test.patch b/0006-Fix-broken-QApplication-init-in-a-test.patch new file mode 100644 index 0000000..5455e01 --- /dev/null +++ b/0006-Fix-broken-QApplication-init-in-a-test.patch @@ -0,0 +1,26 @@ +From 05a681ce00edf6c2400d1989b68a7607c539f3a8 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Tue, 24 Aug 2021 05:03:15 -0400 +Subject: [PATCH 6/6] Fix broken QApplication init in a test. + +Signed-off-by: Elliott Sales de Andrade +--- + lib/matplotlib/tests/test_backend_qt.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/matplotlib/tests/test_backend_qt.py b/lib/matplotlib/tests/test_backend_qt.py +index b7fb708bee..2ee03939a6 100644 +--- a/lib/matplotlib/tests/test_backend_qt.py ++++ b/lib/matplotlib/tests/test_backend_qt.py +@@ -380,7 +380,7 @@ def test_canvas_reinit(): + @pytest.mark.backend('Qt5Agg', skip_on_importerror=True) + def test_form_widget_get_with_datetime_and_date_fields(): + if not QtWidgets.QApplication.instance(): +- QtWidgets.QApplication() ++ QtWidgets.QApplication([]) + form = [ + ("Datetime field", datetime(year=2021, month=3, day=11)), + ("Date field", date(year=2021, month=3, day=11)) +-- +2.31.1 + diff --git a/python-matplotlib.spec b/python-matplotlib.spec index 6394426..55d8266 100644 --- a/python-matplotlib.spec +++ b/python-matplotlib.spec @@ -60,6 +60,8 @@ Patch1003: 0003-Slightly-increase-tolerance-on-rcupdate-test.patch # https://github.com/matplotlib/matplotlib/pull/20884 Patch1004: 0004-Ensure-full-environment-is-passed-to-headless-test.patch Patch1005: 0005-Increase-a-few-test-tolerances-on-some-arches.patch +# https://github.com/matplotlib/matplotlib/pull/20885 +Patch1006: 0006-Fix-broken-QApplication-init-in-a-test.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -285,6 +287,7 @@ cp -p %{SOURCE1} mplsetup.cfg %patch1003 -p1 %patch1004 -p1 %patch1005 -p1 +%patch1006 -p1 %generate_buildrequires