From ac90935ea5afd6f3f27d133946f443e5ef360657 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 25 Jun 2024 19:06:23 -0400 Subject: [PATCH] Update to latest version (#2274386) --- .gitignore | 1 + 0001-Reduce-numpy-build-dependency.patch | 26 +++++ ...-Increase-tolerance-for-new-FreeType.patch | 85 +++++++++------ ...quest-2369-from-rcomer-ne-test-fixes.patch | 100 ++++++++++++++++++ python-cartopy.spec | 13 +-- sources | 2 +- 6 files changed, 190 insertions(+), 37 deletions(-) create mode 100644 0001-Reduce-numpy-build-dependency.patch rename 0001-Increase-tolerance-for-new-FreeType.patch => 0002-Increase-tolerance-for-new-FreeType.patch (66%) create mode 100644 0003-Merge-pull-request-2369-from-rcomer-ne-test-fixes.patch diff --git a/.gitignore b/.gitignore index 15b95fe..144b794 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ /Cartopy-0.21.0.tar.gz /Cartopy-0.21.1.tar.gz /Cartopy-0.22.0.tar.gz +/Cartopy-0.23.0.tar.gz diff --git a/0001-Reduce-numpy-build-dependency.patch b/0001-Reduce-numpy-build-dependency.patch new file mode 100644 index 0000000..a8edd29 --- /dev/null +++ b/0001-Reduce-numpy-build-dependency.patch @@ -0,0 +1,26 @@ +From 063ce2909f8468ad4bc33235f23ae31a2b41a382 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Thu, 25 Apr 2024 16:35:29 -0400 +Subject: [PATCH 1/3] Reduce numpy build dependency + +Signed-off-by: Elliott Sales de Andrade +--- + pyproject.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pyproject.toml b/pyproject.toml +index 862805ff..e9ddc41e 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -9,7 +9,7 @@ requires = [ + # Note that building against numpy 1.x works fine too - users and + # redistributors can do this by installing the numpy version they like and + # disabling build isolation. +- "numpy>=2.0.0rc1", ++ "numpy>=1.21", + "setuptools_scm >= 7.0.0", + ] + build-backend = "setuptools.build_meta" +-- +2.45.2 + diff --git a/0001-Increase-tolerance-for-new-FreeType.patch b/0002-Increase-tolerance-for-new-FreeType.patch similarity index 66% rename from 0001-Increase-tolerance-for-new-FreeType.patch rename to 0002-Increase-tolerance-for-new-FreeType.patch index 8ad03d8..eecc085 100644 --- a/0001-Increase-tolerance-for-new-FreeType.patch +++ b/0002-Increase-tolerance-for-new-FreeType.patch @@ -1,53 +1,69 @@ -From 09ea43429f1cce6dbd67f17f29cdba22414886c5 Mon Sep 17 00:00:00 2001 +From f7bb83e3ae29a7d0b0ba6b72c67dd97a755eb56b Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 26 Feb 2018 02:42:50 -0500 -Subject: [PATCH] Increase tolerance for new FreeType. +Subject: [PATCH 2/3] Increase tolerance for new FreeType Signed-off-by: Elliott Sales de Andrade --- lib/cartopy/tests/mpl/test_examples.py | 2 +- - lib/cartopy/tests/mpl/test_gridliner.py | 11 +++++++---- + lib/cartopy/tests/mpl/test_gridliner.py | 19 +++++++------------ lib/cartopy/tests/mpl/test_mpl_integration.py | 2 +- lib/cartopy/tests/mpl/test_ticks.py | 14 +++++++++----- - 4 files changed, 18 insertions(+), 11 deletions(-) + 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/lib/cartopy/tests/mpl/test_examples.py b/lib/cartopy/tests/mpl/test_examples.py -index 76f76d29..e92035ca 100644 +index a7f64ac9..404d3d83 100644 --- a/lib/cartopy/tests/mpl/test_examples.py +++ b/lib/cartopy/tests/mpl/test_examples.py -@@ -34,7 +34,7 @@ def test_global_map(): +@@ -37,7 +37,7 @@ def test_global_map(): + @pytest.mark.natural_earth @pytest.mark.mpl_image_compare( - filename='contour_label.png', -- tolerance=3.9 if MPL_VERSION.release[:2] >= (3, 8) else 0.5) -+ tolerance=11.1 if MPL_VERSION.release[:2] >= (3, 8) else 10.4) +- filename='contour_label.png', tolerance=3.9 if _MPL_38 else 0.5) ++ filename='contour_label.png', tolerance=11.2 if _MPL_38 else 0.5) def test_contour_label(): from cartopy.tests.mpl.test_caching import sample_data fig = plt.figure() diff --git a/lib/cartopy/tests/mpl/test_gridliner.py b/lib/cartopy/tests/mpl/test_gridliner.py -index 120295c4..f855e0a0 100644 +index 7d82178a..16510f8b 100644 --- a/lib/cartopy/tests/mpl/test_gridliner.py +++ b/lib/cartopy/tests/mpl/test_gridliner.py -@@ -126,6 +126,9 @@ def test_gridliner_specified_lines(): - # of text objects. A new testing strategy is needed for this kind of test. - grid_label_tol = 3.9 +@@ -131,15 +131,10 @@ def test_gridliner_specified_lines(): + assert gl.ylocator.tick_values(None, None).tolist() == parallels -+# Force higher tolerance due to new FreeType on Fedora. -+grid_label_tol = 15.2 -+ +-# The tolerance on these tests are particularly high because of the high number +-# of text objects. A new testing strategy is needed for this kind of test. +-grid_label_tol = 3.9 +- +- @pytest.mark.skipif(geos_version == (3, 9, 0), reason="GEOS intersection bug") @pytest.mark.natural_earth -@@ -207,7 +210,7 @@ def test_grid_labels(): + @pytest.mark.mpl_image_compare(filename='gridliner_labels.png', +- tolerance=grid_label_tol) ++ tolerance=15.2) + def test_grid_labels(): + fig = plt.figure(figsize=(10, 10)) + +@@ -216,7 +211,7 @@ def test_grid_labels(): @pytest.mark.skipif(geos_version == (3, 9, 0), reason="GEOS intersection bug") @pytest.mark.natural_earth @pytest.mark.mpl_image_compare(filename='gridliner_labels_tight.png', -- tolerance=2.92) +- tolerance=2.9) + tolerance=47.1) def test_grid_labels_tight(): # Ensure tight layout accounts for gridlines fig = plt.figure(figsize=(7, 5)) -@@ -251,7 +254,7 @@ def test_grid_labels_tight(): +@@ -264,7 +259,7 @@ def test_grid_labels_tight(): + + @pytest.mark.mpl_image_compare( + filename='gridliner_constrained_adjust_datalim.png', +- tolerance=grid_label_tol) ++ tolerance=46.5) + def test_gridliner_constrained_adjust_datalim(): + fig = plt.figure(figsize=(8, 4), layout="constrained") + +@@ -298,7 +293,7 @@ def test_gridliner_constrained_adjust_datalim(): @pytest.mark.skipif(geos_version == (3, 9, 0), reason="GEOS intersection bug") @pytest.mark.natural_earth @pytest.mark.parametrize('proj', TEST_PROJS) @@ -56,7 +72,7 @@ index 120295c4..f855e0a0 100644 def test_grid_labels_inline(proj): fig = plt.figure() if isinstance(proj, tuple): -@@ -267,7 +270,7 @@ def test_grid_labels_inline(proj): +@@ -314,7 +309,7 @@ def test_grid_labels_inline(proj): @pytest.mark.skipif(geos_version == (3, 9, 0), reason="GEOS intersection bug") @pytest.mark.natural_earth @pytest.mark.parametrize('proj', TEST_PROJS) @@ -65,7 +81,7 @@ index 120295c4..f855e0a0 100644 def test_grid_labels_inline_usa(proj): top = 49.3457868 # north lat left = -124.7844079 # west long -@@ -291,7 +294,7 @@ def test_grid_labels_inline_usa(proj): +@@ -338,7 +333,7 @@ def test_grid_labels_inline_usa(proj): @pytest.mark.skipif(geos_version == (3, 9, 0), reason="GEOS intersection bug") @pytest.mark.mpl_image_compare(filename='gridliner_labels_bbox_style.png', @@ -74,11 +90,20 @@ index 120295c4..f855e0a0 100644 def test_gridliner_labels_bbox_style(): top = 49.3457868 # north lat left = -124.7844079 # west long +@@ -523,7 +518,7 @@ def test_gridliner_save_tight_bbox(): + + + @pytest.mark.mpl_image_compare(filename='gridliner_labels_title_adjust.png', +- tolerance=grid_label_tol) ++ tolerance=61.3) + def test_gridliner_title_adjust(): + # Test that title do not overlap labels + projs = [ccrs.Mercator(), ccrs.AlbersEqualArea(), ccrs.LambertConformal(), diff --git a/lib/cartopy/tests/mpl/test_mpl_integration.py b/lib/cartopy/tests/mpl/test_mpl_integration.py -index 8a60b6d9..ab84bae9 100644 +index 2e65d63d..1a4f5764 100644 --- a/lib/cartopy/tests/mpl/test_mpl_integration.py +++ b/lib/cartopy/tests/mpl/test_mpl_integration.py -@@ -980,7 +980,7 @@ def test_streamplot(): +@@ -981,7 +981,7 @@ def test_streamplot(): @pytest.mark.natural_earth @@ -88,10 +113,10 @@ index 8a60b6d9..ab84bae9 100644 """ test a variety of annotate options on multiple projections diff --git a/lib/cartopy/tests/mpl/test_ticks.py b/lib/cartopy/tests/mpl/test_ticks.py -index bb54b631..e9ef89fc 100644 +index f75ad2d2..bc0ba0b7 100644 --- a/lib/cartopy/tests/mpl/test_ticks.py +++ b/lib/cartopy/tests/mpl/test_ticks.py -@@ -11,7 +11,8 @@ from cartopy.mpl.ticker import LatitudeFormatter, LongitudeFormatter +@@ -10,7 +10,8 @@ from cartopy.mpl.ticker import LatitudeFormatter, LongitudeFormatter @pytest.mark.natural_earth @@ -101,7 +126,7 @@ index bb54b631..e9ef89fc 100644 def test_set_xticks_no_transform(): ax = plt.axes(projection=ccrs.PlateCarree()) ax.coastlines('110m') -@@ -22,7 +23,8 @@ def test_set_xticks_no_transform(): +@@ -21,7 +22,8 @@ def test_set_xticks_no_transform(): @pytest.mark.natural_earth @@ -111,7 +136,7 @@ index bb54b631..e9ef89fc 100644 def test_set_xticks_cylindrical(): ax = plt.axes(projection=ccrs.Mercator(min_latitude=-85, max_latitude=85)) ax.coastlines('110m') -@@ -41,7 +43,8 @@ def test_set_xticks_non_cylindrical(): +@@ -40,7 +42,8 @@ def test_set_xticks_non_cylindrical(): @pytest.mark.natural_earth @@ -121,7 +146,7 @@ index bb54b631..e9ef89fc 100644 def test_set_yticks_no_transform(): ax = plt.axes(projection=ccrs.PlateCarree()) ax.coastlines('110m') -@@ -52,7 +55,8 @@ def test_set_yticks_no_transform(): +@@ -51,7 +54,8 @@ def test_set_yticks_no_transform(): @pytest.mark.natural_earth @@ -131,7 +156,7 @@ index bb54b631..e9ef89fc 100644 def test_set_yticks_cylindrical(): ax = plt.axes(projection=ccrs.Mercator(min_latitude=-85, max_latitude=85)) ax.coastlines('110m') -@@ -73,7 +77,7 @@ def test_set_yticks_non_cylindrical(): +@@ -72,7 +76,7 @@ def test_set_yticks_non_cylindrical(): @pytest.mark.natural_earth @@ -141,5 +166,5 @@ index bb54b631..e9ef89fc 100644 fig = plt.figure(figsize=(10, 10)) projections = (ccrs.PlateCarree(), -- -2.41.0 +2.45.2 diff --git a/0003-Merge-pull-request-2369-from-rcomer-ne-test-fixes.patch b/0003-Merge-pull-request-2369-from-rcomer-ne-test-fixes.patch new file mode 100644 index 0000000..08ca24c --- /dev/null +++ b/0003-Merge-pull-request-2369-from-rcomer-ne-test-fixes.patch @@ -0,0 +1,100 @@ +From 72c5667d218c266332470bddaba83d93dceb963c Mon Sep 17 00:00:00 2001 +From: Greg Lucas +Date: Fri, 12 Apr 2024 06:46:25 -0600 +Subject: [PATCH 3/3] Merge pull request #2369 from rcomer/ne-test-fixes + +MNT: add missing 'needs network' markers +Signed-off-by: Elliott Sales de Andrade +--- + lib/cartopy/tests/mpl/test_feature_artist.py | 5 +++++ + lib/cartopy/tests/mpl/test_features.py | 1 + + lib/cartopy/tests/mpl/test_gridliner.py | 3 +++ + 3 files changed, 9 insertions(+) + +diff --git a/lib/cartopy/tests/mpl/test_feature_artist.py b/lib/cartopy/tests/mpl/test_feature_artist.py +index 1d243092..b7484287 100644 +--- a/lib/cartopy/tests/mpl/test_feature_artist.py ++++ b/lib/cartopy/tests/mpl/test_feature_artist.py +@@ -61,6 +61,7 @@ def cached_paths(geom, target_projection): + return geom_cache.get(target_projection, None) + + ++@pytest.mark.natural_earth + @pytest.mark.mpl_image_compare(filename='feature_artist.png') + def test_feature_artist_draw(feature): + fig, ax = robinson_map() +@@ -69,6 +70,7 @@ def test_feature_artist_draw(feature): + return fig + + ++@pytest.mark.natural_earth + @pytest.mark.mpl_image_compare(filename='feature_artist.png') + def test_feature_artist_draw_facecolor_list(feature): + fig, ax = robinson_map() +@@ -77,6 +79,7 @@ def test_feature_artist_draw_facecolor_list(feature): + return fig + + ++@pytest.mark.natural_earth + @pytest.mark.mpl_image_compare(filename='feature_artist.png') + def test_feature_artist_draw_cmap(feature): + fig, ax = robinson_map() +@@ -87,6 +90,7 @@ def test_feature_artist_draw_cmap(feature): + return fig + + ++@pytest.mark.natural_earth + @pytest.mark.mpl_image_compare(filename='feature_artist.png') + def test_feature_artist_draw_styled_feature(feature): + geoms = list(feature.geometries()) +@@ -98,6 +102,7 @@ def test_feature_artist_draw_styled_feature(feature): + return fig + + ++@pytest.mark.natural_earth + @pytest.mark.mpl_image_compare(filename='feature_artist.png') + def test_feature_artist_draw_styler(feature): + geoms = list(feature.geometries()) +diff --git a/lib/cartopy/tests/mpl/test_features.py b/lib/cartopy/tests/mpl/test_features.py +index 1b1b7fea..8f34ac40 100644 +--- a/lib/cartopy/tests/mpl/test_features.py ++++ b/lib/cartopy/tests/mpl/test_features.py +@@ -46,6 +46,7 @@ def test_natural_earth_custom(): + return ax.figure + + ++@pytest.mark.network + @pytest.mark.skipif(not _HAS_PYKDTREE_OR_SCIPY, reason='pykdtree or scipy is required') + @pytest.mark.mpl_image_compare(filename='gshhs_coastlines.png', tolerance=0.95) + def test_gshhs(): +diff --git a/lib/cartopy/tests/mpl/test_gridliner.py b/lib/cartopy/tests/mpl/test_gridliner.py +index 16510f8b..04ca8d79 100644 +--- a/lib/cartopy/tests/mpl/test_gridliner.py ++++ b/lib/cartopy/tests/mpl/test_gridliner.py +@@ -331,6 +331,7 @@ def test_grid_labels_inline_usa(proj): + return fig + + ++@pytest.mark.natural_earth + @pytest.mark.skipif(geos_version == (3, 9, 0), reason="GEOS intersection bug") + @pytest.mark.mpl_image_compare(filename='gridliner_labels_bbox_style.png', + tolerance=41.5) +@@ -491,6 +492,7 @@ def test_gridliner_count_draws(): + mocked.assert_called_once() + + ++@pytest.mark.natural_earth + @pytest.mark.mpl_image_compare( + baseline_dir='baseline_images/mpl/test_mpl_integration', + filename='simple_global.png') +@@ -517,6 +519,7 @@ def test_gridliner_save_tight_bbox(): + fig.savefig(io.BytesIO(), bbox_inches='tight') + + ++@pytest.mark.natural_earth + @pytest.mark.mpl_image_compare(filename='gridliner_labels_title_adjust.png', + tolerance=61.3) + def test_gridliner_title_adjust(): +-- +2.45.2 + diff --git a/python-cartopy.spec b/python-cartopy.spec index 9d06b3c..6acbdc5 100644 --- a/python-cartopy.spec +++ b/python-cartopy.spec @@ -5,7 +5,7 @@ %bcond_with network Name: python-%{srcname} -Version: 0.22.0 +Version: 0.23.0 Release: %autorelease Summary: Cartographic Python library with Matplotlib visualisations @@ -15,8 +15,12 @@ Source0: %pypi_source %{Srcname} # Set location of Fedora-provided pre-existing data. Source1: siteconfig.py +# Fedora specific. +Patch: 0001-Reduce-numpy-build-dependency.patch # Might not go upstream in current form. -Patch: 0001-Increase-tolerance-for-new-FreeType.patch +Patch: 0002-Increase-tolerance-for-new-FreeType.patch +# https://github.com/SciTools/cartopy/pull/2369 +Patch: 0003-Merge-pull-request-2369-from-rcomer-ne-test-fixes.patch BuildRequires: gcc-c++ BuildRequires: proj-data-uk @@ -97,7 +101,7 @@ export FORCE_CYTHON=1 SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %install %pyproject_install -%pyproject_save_files %{srcname} +%pyproject_save_files -l %{srcname} mkdir -p %{buildroot}%{_datadir}/cartopy/shapefiles/natural_earth/ for theme in physical cultural; do @@ -105,8 +109,6 @@ for theme in physical cultural; do %{buildroot}%{_datadir}/cartopy/shapefiles/natural_earth/${theme} done -mv %{buildroot}%{_bindir}/feature_download %{buildroot}%{_bindir}/cartopy_feature_download - %check MPLBACKEND=Agg \ @@ -120,7 +122,6 @@ MPLBACKEND=Agg \ %files -n python-%{srcname}-common %doc README.md -%license COPYING COPYING.LESSER lib/cartopy/data/LICENSE %{_datadir}/cartopy/ %files -n python3-%{srcname} -f %{pyproject_files} diff --git a/sources b/sources index c21cdcd..262538c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Cartopy-0.22.0.tar.gz) = fed45427e8bbd4c98c9abcee80f9148bf7dd5dc310adddb78384681da6ed9583c8daaed293ef3a27fdf3f72257f8ead7532c85d2b5e4fdf8119483625fb7a585 +SHA512 (Cartopy-0.23.0.tar.gz) = 0614b16b22ff3af752f8fd0c71ebc02ea07d3a3e07b492a80b53aae1382d53571ef6ce5ab1836ed89c4a950a6aa144f8812368d96c2606363bb41c6e37503c2c