From de2e44cdf6283c66ddbce1258c959ec582862094 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 28 Feb 2023 20:30:45 -0500 Subject: [PATCH] Backport fix for Matplotlib 3.7 --- ...72ba1a8a877f28e25dfe9559c14b7a565958.patch | 36 +++++++++++++++++++ python-cartopy.spec | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 6b4572ba1a8a877f28e25dfe9559c14b7a565958.patch diff --git a/6b4572ba1a8a877f28e25dfe9559c14b7a565958.patch b/6b4572ba1a8a877f28e25dfe9559c14b7a565958.patch new file mode 100644 index 0000000..53256ab --- /dev/null +++ b/6b4572ba1a8a877f28e25dfe9559c14b7a565958.patch @@ -0,0 +1,36 @@ +From 6b4572ba1a8a877f28e25dfe9559c14b7a565958 Mon Sep 17 00:00:00 2001 +From: Greg Lucas +Date: Thu, 26 Jan 2023 08:51:54 -0700 +Subject: [PATCH] TST/FIX: Test for instance rather than string in class + representation + +Matplotlib has merged SubplotBase into AxesBase now, which makes the +class string representation here GeoAxes now, even though we are +still an _instance_ of GeoAxesSubplot +--- + lib/cartopy/tests/mpl/test_axes.py | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/lib/cartopy/tests/mpl/test_axes.py b/lib/cartopy/tests/mpl/test_axes.py +index eaf5904b0..d4e37a113 100644 +--- a/lib/cartopy/tests/mpl/test_axes.py ++++ b/lib/cartopy/tests/mpl/test_axes.py +@@ -13,7 +13,8 @@ + + import cartopy.crs as ccrs + import cartopy.feature as cfeature +-from cartopy.mpl.geoaxes import InterProjectionTransform, GeoAxes ++from cartopy.mpl.geoaxes import ( ++ InterProjectionTransform, GeoAxes, GeoAxesSubplot) + + + class TestNoSpherical: +@@ -119,7 +120,7 @@ def test_single_geometry(self): + + def test_geoaxes_subplot(): + ax = plt.subplot(1, 1, 1, projection=ccrs.PlateCarree()) +- assert str(ax.__class__) == "" ++ assert isinstance(ax, GeoAxesSubplot) + + + @pytest.mark.mpl_image_compare(filename='geoaxes_subslice.png') diff --git a/python-cartopy.spec b/python-cartopy.spec index df04fee..31257b5 100644 --- a/python-cartopy.spec +++ b/python-cartopy.spec @@ -22,6 +22,8 @@ Patch0002: 0002-Use-pkg-config-to-find-GEOS-instead-of-geos-config.patch Patch0003: 0003-Remove-extraneous-insertion-of-default-compiler-path.patch # We don't need to worry about the bugs with setuptools-scm < 7. Patch0004: 0004-Allow-older-setuptools-scm.patch +# Fix build with Matplotlib 3.7 +Patch0005: https://github.com/SciTools/cartopy/commit/6b4572ba1a8a877f28e25dfe9559c14b7a565958.patch BuildRequires: gcc-c++ BuildRequires: geos-devel >= 3.7.2