From c9814b3833f554fe0912db11b7317360c9599533 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Aug 10 2021 05:34:04 +0000 Subject: Make a test more robust. --- diff --git a/0001-matplotlibrc-path-search-fix.patch b/0001-matplotlibrc-path-search-fix.patch index 05d963c..bf7ebec 100644 --- a/0001-matplotlibrc-path-search-fix.patch +++ b/0001-matplotlibrc-path-search-fix.patch @@ -1,7 +1,7 @@ From 6277ea0c008b02cd2abe017d041b43a35a407c6c Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 27 Sep 2017 19:35:59 -0400 -Subject: [PATCH 1/6] matplotlibrc path search fix +Subject: [PATCH 1/7] 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 29ac7fc..2454429 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 322fe366ece11ae948c7f6ba0191f7dbc5db444b Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 14 Feb 2020 06:05:42 -0500 -Subject: [PATCH 2/6] Set FreeType version to 2.11.0 and update tolerances. +Subject: [PATCH 2/7] 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 0c639f6..39485c6 100644 --- a/0003-Slightly-increase-tolerance-on-rcupdate-test.patch +++ b/0003-Slightly-increase-tolerance-on-rcupdate-test.patch @@ -1,7 +1,7 @@ From d807e4e108073ee0fbda02340b206bf3766d9c7c Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 4 Jun 2021 02:32:31 -0400 -Subject: [PATCH 3/6] Slightly increase tolerance on rcupdate test. +Subject: [PATCH 3/7] Slightly increase tolerance on rcupdate test. Signed-off-by: Elliott Sales de Andrade --- diff --git a/0004-Use-new-style-for-test_text_urls_tex.patch b/0004-Use-new-style-for-test_text_urls_tex.patch index c973f2f..41ae771 100644 --- a/0004-Use-new-style-for-test_text_urls_tex.patch +++ b/0004-Use-new-style-for-test_text_urls_tex.patch @@ -1,7 +1,7 @@ From ea96e5684af98e28e704dc26f12b793c6032ada6 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 4 Jun 2021 03:20:38 -0400 -Subject: [PATCH 4/6] Use new style for test_text_urls_tex. +Subject: [PATCH 4/7] Use new style for test_text_urls_tex. This test does not depend on the font style, just that the annotation appears over it. Switching to mpl20 style stops using Helvetica, and diff --git a/0005-Backport-PR-20488-FIX-Include-0-when-checking-lognor.patch b/0005-Backport-PR-20488-FIX-Include-0-when-checking-lognor.patch index 5599761..8074b1c 100644 --- a/0005-Backport-PR-20488-FIX-Include-0-when-checking-lognor.patch +++ b/0005-Backport-PR-20488-FIX-Include-0-when-checking-lognor.patch @@ -1,7 +1,7 @@ From 982f5255e5da9c5023ca9997aff78c86eb0e8000 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 24 Jun 2021 01:45:04 -0400 -Subject: [PATCH 5/6] Backport PR #20488: FIX: Include 0 when checking lognorm +Subject: [PATCH 5/7] Backport PR #20488: FIX: Include 0 when checking lognorm vmin Signed-off-by: Elliott Sales de Andrade diff --git a/0006-Increase-mathfont-test-tolerance-on-some-systems.patch b/0006-Increase-mathfont-test-tolerance-on-some-systems.patch index 473e5f9..2f8652e 100644 --- a/0006-Increase-mathfont-test-tolerance-on-some-systems.patch +++ b/0006-Increase-mathfont-test-tolerance-on-some-systems.patch @@ -1,7 +1,7 @@ From 28753e5db82bba5898ee302d687d201ae2a96cd6 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 9 Aug 2021 21:38:15 -0400 -Subject: [PATCH 6/6] Increase mathfont test tolerance on some systems. +Subject: [PATCH 6/7] Increase mathfont test tolerance on some systems. Signed-off-by: Elliott Sales de Andrade --- diff --git a/0007-Make-test_change_epoch-more-robust.patch b/0007-Make-test_change_epoch-more-robust.patch new file mode 100644 index 0000000..898e27b --- /dev/null +++ b/0007-Make-test_change_epoch-more-robust.patch @@ -0,0 +1,42 @@ +From 227aacf576f6fce253673ce05365db11dfa6df7d Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Tue, 10 Aug 2021 00:45:07 -0400 +Subject: [PATCH 7/7] Make test_change_epoch more robust. + +The epoch is set by explicitly calling `mdates.set_epoch`, or implicitly +set to the default by `mdates.get_epoch` (which is also called when +converting datetimes.) + +However, when running tests in parallel, there is no guarantee that any +other call to `[gs]et_epoch` might have been made to lock it in, so we +need to do that explicitly. + +Signed-off-by: Elliott Sales de Andrade +--- + lib/matplotlib/tests/test_dates.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/lib/matplotlib/tests/test_dates.py b/lib/matplotlib/tests/test_dates.py +index 8c821c0da5..36449e44aa 100644 +--- a/lib/matplotlib/tests/test_dates.py ++++ b/lib/matplotlib/tests/test_dates.py +@@ -1004,12 +1004,15 @@ def test_datetime64_in_list(): + def test_change_epoch(): + date = np.datetime64('2000-01-01') + ++ # use private method to clear the epoch and allow it to be set... ++ mdates._reset_epoch_test_example() ++ mdates.get_epoch() # Set default. ++ + with pytest.raises(RuntimeError): + # this should fail here because there is a sentinel on the epoch + # if the epoch has been used then it cannot be set. + mdates.set_epoch('0000-01-01') + +- # use private method to clear the epoch and allow it to be set... + mdates._reset_epoch_test_example() + mdates.set_epoch('1970-01-01') + dt = (date - np.datetime64('1970-01-01')).astype('datetime64[D]') +-- +2.31.1 + diff --git a/python-matplotlib.spec b/python-matplotlib.spec index 720408b..9b0d9c3 100644 --- a/python-matplotlib.spec +++ b/python-matplotlib.spec @@ -73,6 +73,8 @@ Patch1004: 0004-Use-new-style-for-test_text_urls_tex.patch Patch1005: 0005-Backport-PR-20488-FIX-Include-0-when-checking-lognor.patch # Tweak tolerances a bit. Patch1006: 0006-Increase-mathfont-test-tolerance-on-some-systems.patch +# https://github.com/matplotlib/matplotlib/pull/20817 +Patch1007: 0007-Make-test_change_epoch-more-robust.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -332,6 +334,7 @@ cp -p %{SOURCE1} setup.cfg %patch1004 -p1 %patch1005 -p1 %patch1006 -p1 +%patch1007 -p1 %build