From a371f7b698a74e9b436af52862e4df0c162771ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 22 Aug 2023 21:05:53 +0200 Subject: [PATCH 001/210] Add template make files for building the documentation --- packages/basemap/doc/Makefile | 19 +++++++++++++++++++ packages/basemap/doc/make.bat | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 packages/basemap/doc/Makefile create mode 100644 packages/basemap/doc/make.bat diff --git a/packages/basemap/doc/Makefile b/packages/basemap/doc/Makefile new file mode 100644 index 000000000..69fe55ecf --- /dev/null +++ b/packages/basemap/doc/Makefile @@ -0,0 +1,19 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/packages/basemap/doc/make.bat b/packages/basemap/doc/make.bat new file mode 100644 index 000000000..4d9eb83d9 --- /dev/null +++ b/packages/basemap/doc/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% + +:end +popd From 894bed19524b5d0a25926b0b4c6fe27c0fe7f80a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 22 Aug 2023 21:08:32 +0200 Subject: [PATCH 002/210] Move doc source files into source folder --- packages/basemap/doc/{ => source}/api/basemap_api.rst | 0 packages/basemap/doc/{ => source}/api/index.rst | 0 packages/basemap/doc/{ => source}/conf.py | 0 packages/basemap/doc/{ => source}/index.rst | 0 packages/basemap/doc/{ => source}/matplotlibrc | 0 packages/basemap/doc/{ => source}/users/aea.rst | 0 packages/basemap/doc/{ => source}/users/aeqd.rst | 0 packages/basemap/doc/{ => source}/users/cass.rst | 0 packages/basemap/doc/{ => source}/users/cea.rst | 0 packages/basemap/doc/{ => source}/users/cyl.rst | 0 packages/basemap/doc/{ => source}/users/download.rst | 0 packages/basemap/doc/{ => source}/users/eck4.rst | 0 packages/basemap/doc/{ => source}/users/eqdc.rst | 0 packages/basemap/doc/{ => source}/users/examples.rst | 0 packages/basemap/doc/{ => source}/users/figures/aea.py | 0 packages/basemap/doc/{ => source}/users/figures/aeqd.py | 0 packages/basemap/doc/{ => source}/users/figures/aeqd_fulldisk.py | 0 packages/basemap/doc/{ => source}/users/figures/azeqd.py | 0 packages/basemap/doc/{ => source}/users/figures/background1.py | 0 packages/basemap/doc/{ => source}/users/figures/background2.py | 0 packages/basemap/doc/{ => source}/users/figures/background3.py | 0 packages/basemap/doc/{ => source}/users/figures/background4.py | 0 packages/basemap/doc/{ => source}/users/figures/background5.py | 0 packages/basemap/doc/{ => source}/users/figures/cass.py | 0 packages/basemap/doc/{ => source}/users/figures/cea.py | 0 packages/basemap/doc/{ => source}/users/figures/contour1.py | 0 packages/basemap/doc/{ => source}/users/figures/cyl.py | 0 packages/basemap/doc/{ => source}/users/figures/eck4.py | 0 packages/basemap/doc/{ => source}/users/figures/eqdc.py | 0 packages/basemap/doc/{ => source}/users/figures/gall.py | 0 packages/basemap/doc/{ => source}/users/figures/geos_full.py | 0 packages/basemap/doc/{ => source}/users/figures/geos_partial.py | 0 packages/basemap/doc/{ => source}/users/figures/gnomon.py | 0 packages/basemap/doc/{ => source}/users/figures/graticule.py | 0 packages/basemap/doc/{ => source}/users/figures/hammer.py | 0 packages/basemap/doc/{ => source}/users/figures/hurrtracks.py | 0 packages/basemap/doc/{ => source}/users/figures/kav7.py | 0 packages/basemap/doc/{ => source}/users/figures/laea.py | 0 packages/basemap/doc/{ => source}/users/figures/lcc.py | 0 packages/basemap/doc/{ => source}/users/figures/mbtfpq.py | 0 packages/basemap/doc/{ => source}/users/figures/merc.py | 0 packages/basemap/doc/{ => source}/users/figures/mill.py | 0 packages/basemap/doc/{ => source}/users/figures/moll.py | 0 packages/basemap/doc/{ => source}/users/figures/npaeqd.py | 0 packages/basemap/doc/{ => source}/users/figures/nplaea.py | 0 packages/basemap/doc/{ => source}/users/figures/npstere.py | 0 packages/basemap/doc/{ => source}/users/figures/nsper_full.py | 0 packages/basemap/doc/{ => source}/users/figures/nsper_partial.py | 0 packages/basemap/doc/{ => source}/users/figures/omerc.py | 0 packages/basemap/doc/{ => source}/users/figures/ortho_full.py | 0 packages/basemap/doc/{ => source}/users/figures/ortho_partial.py | 0 packages/basemap/doc/{ => source}/users/figures/plotargo.py | 0 packages/basemap/doc/{ => source}/users/figures/plotboulder.py | 0 packages/basemap/doc/{ => source}/users/figures/plotdaynight.py | 0 packages/basemap/doc/{ => source}/users/figures/plotetopo5.py | 0 .../basemap/doc/{ => source}/users/figures/plotgreatcircle.py | 0 .../basemap/doc/{ => source}/users/figures/plothighsandlows.py | 0 packages/basemap/doc/{ => source}/users/figures/plotprecip.py | 0 packages/basemap/doc/{ => source}/users/figures/plotsst.py | 0 packages/basemap/doc/{ => source}/users/figures/plotwindvec.py | 0 packages/basemap/doc/{ => source}/users/figures/poly.py | 0 packages/basemap/doc/{ => source}/users/figures/robin.py | 0 packages/basemap/doc/{ => source}/users/figures/sinu.py | 0 packages/basemap/doc/{ => source}/users/figures/spaeqd.py | 0 packages/basemap/doc/{ => source}/users/figures/splaea.py | 0 packages/basemap/doc/{ => source}/users/figures/spstere.py | 0 packages/basemap/doc/{ => source}/users/figures/stere.py | 0 packages/basemap/doc/{ => source}/users/figures/tmerc.py | 0 packages/basemap/doc/{ => source}/users/figures/vandg.py | 0 packages/basemap/doc/{ => source}/users/gall.rst | 0 packages/basemap/doc/{ => source}/users/geography.rst | 0 packages/basemap/doc/{ => source}/users/geos.rst | 0 packages/basemap/doc/{ => source}/users/gnomon.rst | 0 packages/basemap/doc/{ => source}/users/graticule.rst | 0 packages/basemap/doc/{ => source}/users/hammer.rst | 0 packages/basemap/doc/{ => source}/users/index.rst | 0 packages/basemap/doc/{ => source}/users/installing.rst | 0 packages/basemap/doc/{ => source}/users/intro.rst | 0 packages/basemap/doc/{ => source}/users/kav7.rst | 0 packages/basemap/doc/{ => source}/users/laea.rst | 0 packages/basemap/doc/{ => source}/users/lcc.rst | 0 packages/basemap/doc/{ => source}/users/mapcoords.rst | 0 packages/basemap/doc/{ => source}/users/mapsetup.rst | 0 packages/basemap/doc/{ => source}/users/mbtfpq.rst | 0 packages/basemap/doc/{ => source}/users/merc.rst | 0 packages/basemap/doc/{ => source}/users/mill.rst | 0 packages/basemap/doc/{ => source}/users/moll.rst | 0 packages/basemap/doc/{ => source}/users/nsper.rst | 0 packages/basemap/doc/{ => source}/users/omerc.rst | 0 packages/basemap/doc/{ => source}/users/ortho.rst | 0 packages/basemap/doc/{ => source}/users/paeqd.rst | 0 packages/basemap/doc/{ => source}/users/plaea.rst | 0 packages/basemap/doc/{ => source}/users/poly.rst | 0 packages/basemap/doc/{ => source}/users/pstere.rst | 0 packages/basemap/doc/{ => source}/users/robin.rst | 0 packages/basemap/doc/{ => source}/users/sinu.rst | 0 packages/basemap/doc/{ => source}/users/stere.rst | 0 packages/basemap/doc/{ => source}/users/tmerc.rst | 0 packages/basemap/doc/{ => source}/users/vandg.rst | 0 99 files changed, 0 insertions(+), 0 deletions(-) rename packages/basemap/doc/{ => source}/api/basemap_api.rst (100%) rename packages/basemap/doc/{ => source}/api/index.rst (100%) rename packages/basemap/doc/{ => source}/conf.py (100%) rename packages/basemap/doc/{ => source}/index.rst (100%) rename packages/basemap/doc/{ => source}/matplotlibrc (100%) rename packages/basemap/doc/{ => source}/users/aea.rst (100%) rename packages/basemap/doc/{ => source}/users/aeqd.rst (100%) rename packages/basemap/doc/{ => source}/users/cass.rst (100%) rename packages/basemap/doc/{ => source}/users/cea.rst (100%) rename packages/basemap/doc/{ => source}/users/cyl.rst (100%) rename packages/basemap/doc/{ => source}/users/download.rst (100%) rename packages/basemap/doc/{ => source}/users/eck4.rst (100%) rename packages/basemap/doc/{ => source}/users/eqdc.rst (100%) rename packages/basemap/doc/{ => source}/users/examples.rst (100%) rename packages/basemap/doc/{ => source}/users/figures/aea.py (100%) rename packages/basemap/doc/{ => source}/users/figures/aeqd.py (100%) rename packages/basemap/doc/{ => source}/users/figures/aeqd_fulldisk.py (100%) rename packages/basemap/doc/{ => source}/users/figures/azeqd.py (100%) rename packages/basemap/doc/{ => source}/users/figures/background1.py (100%) rename packages/basemap/doc/{ => source}/users/figures/background2.py (100%) rename packages/basemap/doc/{ => source}/users/figures/background3.py (100%) rename packages/basemap/doc/{ => source}/users/figures/background4.py (100%) rename packages/basemap/doc/{ => source}/users/figures/background5.py (100%) rename packages/basemap/doc/{ => source}/users/figures/cass.py (100%) rename packages/basemap/doc/{ => source}/users/figures/cea.py (100%) rename packages/basemap/doc/{ => source}/users/figures/contour1.py (100%) rename packages/basemap/doc/{ => source}/users/figures/cyl.py (100%) rename packages/basemap/doc/{ => source}/users/figures/eck4.py (100%) rename packages/basemap/doc/{ => source}/users/figures/eqdc.py (100%) rename packages/basemap/doc/{ => source}/users/figures/gall.py (100%) rename packages/basemap/doc/{ => source}/users/figures/geos_full.py (100%) rename packages/basemap/doc/{ => source}/users/figures/geos_partial.py (100%) rename packages/basemap/doc/{ => source}/users/figures/gnomon.py (100%) rename packages/basemap/doc/{ => source}/users/figures/graticule.py (100%) rename packages/basemap/doc/{ => source}/users/figures/hammer.py (100%) rename packages/basemap/doc/{ => source}/users/figures/hurrtracks.py (100%) rename packages/basemap/doc/{ => source}/users/figures/kav7.py (100%) rename packages/basemap/doc/{ => source}/users/figures/laea.py (100%) rename packages/basemap/doc/{ => source}/users/figures/lcc.py (100%) rename packages/basemap/doc/{ => source}/users/figures/mbtfpq.py (100%) rename packages/basemap/doc/{ => source}/users/figures/merc.py (100%) rename packages/basemap/doc/{ => source}/users/figures/mill.py (100%) rename packages/basemap/doc/{ => source}/users/figures/moll.py (100%) rename packages/basemap/doc/{ => source}/users/figures/npaeqd.py (100%) rename packages/basemap/doc/{ => source}/users/figures/nplaea.py (100%) rename packages/basemap/doc/{ => source}/users/figures/npstere.py (100%) rename packages/basemap/doc/{ => source}/users/figures/nsper_full.py (100%) rename packages/basemap/doc/{ => source}/users/figures/nsper_partial.py (100%) rename packages/basemap/doc/{ => source}/users/figures/omerc.py (100%) rename packages/basemap/doc/{ => source}/users/figures/ortho_full.py (100%) rename packages/basemap/doc/{ => source}/users/figures/ortho_partial.py (100%) rename packages/basemap/doc/{ => source}/users/figures/plotargo.py (100%) rename packages/basemap/doc/{ => source}/users/figures/plotboulder.py (100%) rename packages/basemap/doc/{ => source}/users/figures/plotdaynight.py (100%) rename packages/basemap/doc/{ => source}/users/figures/plotetopo5.py (100%) rename packages/basemap/doc/{ => source}/users/figures/plotgreatcircle.py (100%) rename packages/basemap/doc/{ => source}/users/figures/plothighsandlows.py (100%) rename packages/basemap/doc/{ => source}/users/figures/plotprecip.py (100%) rename packages/basemap/doc/{ => source}/users/figures/plotsst.py (100%) rename packages/basemap/doc/{ => source}/users/figures/plotwindvec.py (100%) rename packages/basemap/doc/{ => source}/users/figures/poly.py (100%) rename packages/basemap/doc/{ => source}/users/figures/robin.py (100%) rename packages/basemap/doc/{ => source}/users/figures/sinu.py (100%) rename packages/basemap/doc/{ => source}/users/figures/spaeqd.py (100%) rename packages/basemap/doc/{ => source}/users/figures/splaea.py (100%) rename packages/basemap/doc/{ => source}/users/figures/spstere.py (100%) rename packages/basemap/doc/{ => source}/users/figures/stere.py (100%) rename packages/basemap/doc/{ => source}/users/figures/tmerc.py (100%) rename packages/basemap/doc/{ => source}/users/figures/vandg.py (100%) rename packages/basemap/doc/{ => source}/users/gall.rst (100%) rename packages/basemap/doc/{ => source}/users/geography.rst (100%) rename packages/basemap/doc/{ => source}/users/geos.rst (100%) rename packages/basemap/doc/{ => source}/users/gnomon.rst (100%) rename packages/basemap/doc/{ => source}/users/graticule.rst (100%) rename packages/basemap/doc/{ => source}/users/hammer.rst (100%) rename packages/basemap/doc/{ => source}/users/index.rst (100%) rename packages/basemap/doc/{ => source}/users/installing.rst (100%) rename packages/basemap/doc/{ => source}/users/intro.rst (100%) rename packages/basemap/doc/{ => source}/users/kav7.rst (100%) rename packages/basemap/doc/{ => source}/users/laea.rst (100%) rename packages/basemap/doc/{ => source}/users/lcc.rst (100%) rename packages/basemap/doc/{ => source}/users/mapcoords.rst (100%) rename packages/basemap/doc/{ => source}/users/mapsetup.rst (100%) rename packages/basemap/doc/{ => source}/users/mbtfpq.rst (100%) rename packages/basemap/doc/{ => source}/users/merc.rst (100%) rename packages/basemap/doc/{ => source}/users/mill.rst (100%) rename packages/basemap/doc/{ => source}/users/moll.rst (100%) rename packages/basemap/doc/{ => source}/users/nsper.rst (100%) rename packages/basemap/doc/{ => source}/users/omerc.rst (100%) rename packages/basemap/doc/{ => source}/users/ortho.rst (100%) rename packages/basemap/doc/{ => source}/users/paeqd.rst (100%) rename packages/basemap/doc/{ => source}/users/plaea.rst (100%) rename packages/basemap/doc/{ => source}/users/poly.rst (100%) rename packages/basemap/doc/{ => source}/users/pstere.rst (100%) rename packages/basemap/doc/{ => source}/users/robin.rst (100%) rename packages/basemap/doc/{ => source}/users/sinu.rst (100%) rename packages/basemap/doc/{ => source}/users/stere.rst (100%) rename packages/basemap/doc/{ => source}/users/tmerc.rst (100%) rename packages/basemap/doc/{ => source}/users/vandg.rst (100%) diff --git a/packages/basemap/doc/api/basemap_api.rst b/packages/basemap/doc/source/api/basemap_api.rst similarity index 100% rename from packages/basemap/doc/api/basemap_api.rst rename to packages/basemap/doc/source/api/basemap_api.rst diff --git a/packages/basemap/doc/api/index.rst b/packages/basemap/doc/source/api/index.rst similarity index 100% rename from packages/basemap/doc/api/index.rst rename to packages/basemap/doc/source/api/index.rst diff --git a/packages/basemap/doc/conf.py b/packages/basemap/doc/source/conf.py similarity index 100% rename from packages/basemap/doc/conf.py rename to packages/basemap/doc/source/conf.py diff --git a/packages/basemap/doc/index.rst b/packages/basemap/doc/source/index.rst similarity index 100% rename from packages/basemap/doc/index.rst rename to packages/basemap/doc/source/index.rst diff --git a/packages/basemap/doc/matplotlibrc b/packages/basemap/doc/source/matplotlibrc similarity index 100% rename from packages/basemap/doc/matplotlibrc rename to packages/basemap/doc/source/matplotlibrc diff --git a/packages/basemap/doc/users/aea.rst b/packages/basemap/doc/source/users/aea.rst similarity index 100% rename from packages/basemap/doc/users/aea.rst rename to packages/basemap/doc/source/users/aea.rst diff --git a/packages/basemap/doc/users/aeqd.rst b/packages/basemap/doc/source/users/aeqd.rst similarity index 100% rename from packages/basemap/doc/users/aeqd.rst rename to packages/basemap/doc/source/users/aeqd.rst diff --git a/packages/basemap/doc/users/cass.rst b/packages/basemap/doc/source/users/cass.rst similarity index 100% rename from packages/basemap/doc/users/cass.rst rename to packages/basemap/doc/source/users/cass.rst diff --git a/packages/basemap/doc/users/cea.rst b/packages/basemap/doc/source/users/cea.rst similarity index 100% rename from packages/basemap/doc/users/cea.rst rename to packages/basemap/doc/source/users/cea.rst diff --git a/packages/basemap/doc/users/cyl.rst b/packages/basemap/doc/source/users/cyl.rst similarity index 100% rename from packages/basemap/doc/users/cyl.rst rename to packages/basemap/doc/source/users/cyl.rst diff --git a/packages/basemap/doc/users/download.rst b/packages/basemap/doc/source/users/download.rst similarity index 100% rename from packages/basemap/doc/users/download.rst rename to packages/basemap/doc/source/users/download.rst diff --git a/packages/basemap/doc/users/eck4.rst b/packages/basemap/doc/source/users/eck4.rst similarity index 100% rename from packages/basemap/doc/users/eck4.rst rename to packages/basemap/doc/source/users/eck4.rst diff --git a/packages/basemap/doc/users/eqdc.rst b/packages/basemap/doc/source/users/eqdc.rst similarity index 100% rename from packages/basemap/doc/users/eqdc.rst rename to packages/basemap/doc/source/users/eqdc.rst diff --git a/packages/basemap/doc/users/examples.rst b/packages/basemap/doc/source/users/examples.rst similarity index 100% rename from packages/basemap/doc/users/examples.rst rename to packages/basemap/doc/source/users/examples.rst diff --git a/packages/basemap/doc/users/figures/aea.py b/packages/basemap/doc/source/users/figures/aea.py similarity index 100% rename from packages/basemap/doc/users/figures/aea.py rename to packages/basemap/doc/source/users/figures/aea.py diff --git a/packages/basemap/doc/users/figures/aeqd.py b/packages/basemap/doc/source/users/figures/aeqd.py similarity index 100% rename from packages/basemap/doc/users/figures/aeqd.py rename to packages/basemap/doc/source/users/figures/aeqd.py diff --git a/packages/basemap/doc/users/figures/aeqd_fulldisk.py b/packages/basemap/doc/source/users/figures/aeqd_fulldisk.py similarity index 100% rename from packages/basemap/doc/users/figures/aeqd_fulldisk.py rename to packages/basemap/doc/source/users/figures/aeqd_fulldisk.py diff --git a/packages/basemap/doc/users/figures/azeqd.py b/packages/basemap/doc/source/users/figures/azeqd.py similarity index 100% rename from packages/basemap/doc/users/figures/azeqd.py rename to packages/basemap/doc/source/users/figures/azeqd.py diff --git a/packages/basemap/doc/users/figures/background1.py b/packages/basemap/doc/source/users/figures/background1.py similarity index 100% rename from packages/basemap/doc/users/figures/background1.py rename to packages/basemap/doc/source/users/figures/background1.py diff --git a/packages/basemap/doc/users/figures/background2.py b/packages/basemap/doc/source/users/figures/background2.py similarity index 100% rename from packages/basemap/doc/users/figures/background2.py rename to packages/basemap/doc/source/users/figures/background2.py diff --git a/packages/basemap/doc/users/figures/background3.py b/packages/basemap/doc/source/users/figures/background3.py similarity index 100% rename from packages/basemap/doc/users/figures/background3.py rename to packages/basemap/doc/source/users/figures/background3.py diff --git a/packages/basemap/doc/users/figures/background4.py b/packages/basemap/doc/source/users/figures/background4.py similarity index 100% rename from packages/basemap/doc/users/figures/background4.py rename to packages/basemap/doc/source/users/figures/background4.py diff --git a/packages/basemap/doc/users/figures/background5.py b/packages/basemap/doc/source/users/figures/background5.py similarity index 100% rename from packages/basemap/doc/users/figures/background5.py rename to packages/basemap/doc/source/users/figures/background5.py diff --git a/packages/basemap/doc/users/figures/cass.py b/packages/basemap/doc/source/users/figures/cass.py similarity index 100% rename from packages/basemap/doc/users/figures/cass.py rename to packages/basemap/doc/source/users/figures/cass.py diff --git a/packages/basemap/doc/users/figures/cea.py b/packages/basemap/doc/source/users/figures/cea.py similarity index 100% rename from packages/basemap/doc/users/figures/cea.py rename to packages/basemap/doc/source/users/figures/cea.py diff --git a/packages/basemap/doc/users/figures/contour1.py b/packages/basemap/doc/source/users/figures/contour1.py similarity index 100% rename from packages/basemap/doc/users/figures/contour1.py rename to packages/basemap/doc/source/users/figures/contour1.py diff --git a/packages/basemap/doc/users/figures/cyl.py b/packages/basemap/doc/source/users/figures/cyl.py similarity index 100% rename from packages/basemap/doc/users/figures/cyl.py rename to packages/basemap/doc/source/users/figures/cyl.py diff --git a/packages/basemap/doc/users/figures/eck4.py b/packages/basemap/doc/source/users/figures/eck4.py similarity index 100% rename from packages/basemap/doc/users/figures/eck4.py rename to packages/basemap/doc/source/users/figures/eck4.py diff --git a/packages/basemap/doc/users/figures/eqdc.py b/packages/basemap/doc/source/users/figures/eqdc.py similarity index 100% rename from packages/basemap/doc/users/figures/eqdc.py rename to packages/basemap/doc/source/users/figures/eqdc.py diff --git a/packages/basemap/doc/users/figures/gall.py b/packages/basemap/doc/source/users/figures/gall.py similarity index 100% rename from packages/basemap/doc/users/figures/gall.py rename to packages/basemap/doc/source/users/figures/gall.py diff --git a/packages/basemap/doc/users/figures/geos_full.py b/packages/basemap/doc/source/users/figures/geos_full.py similarity index 100% rename from packages/basemap/doc/users/figures/geos_full.py rename to packages/basemap/doc/source/users/figures/geos_full.py diff --git a/packages/basemap/doc/users/figures/geos_partial.py b/packages/basemap/doc/source/users/figures/geos_partial.py similarity index 100% rename from packages/basemap/doc/users/figures/geos_partial.py rename to packages/basemap/doc/source/users/figures/geos_partial.py diff --git a/packages/basemap/doc/users/figures/gnomon.py b/packages/basemap/doc/source/users/figures/gnomon.py similarity index 100% rename from packages/basemap/doc/users/figures/gnomon.py rename to packages/basemap/doc/source/users/figures/gnomon.py diff --git a/packages/basemap/doc/users/figures/graticule.py b/packages/basemap/doc/source/users/figures/graticule.py similarity index 100% rename from packages/basemap/doc/users/figures/graticule.py rename to packages/basemap/doc/source/users/figures/graticule.py diff --git a/packages/basemap/doc/users/figures/hammer.py b/packages/basemap/doc/source/users/figures/hammer.py similarity index 100% rename from packages/basemap/doc/users/figures/hammer.py rename to packages/basemap/doc/source/users/figures/hammer.py diff --git a/packages/basemap/doc/users/figures/hurrtracks.py b/packages/basemap/doc/source/users/figures/hurrtracks.py similarity index 100% rename from packages/basemap/doc/users/figures/hurrtracks.py rename to packages/basemap/doc/source/users/figures/hurrtracks.py diff --git a/packages/basemap/doc/users/figures/kav7.py b/packages/basemap/doc/source/users/figures/kav7.py similarity index 100% rename from packages/basemap/doc/users/figures/kav7.py rename to packages/basemap/doc/source/users/figures/kav7.py diff --git a/packages/basemap/doc/users/figures/laea.py b/packages/basemap/doc/source/users/figures/laea.py similarity index 100% rename from packages/basemap/doc/users/figures/laea.py rename to packages/basemap/doc/source/users/figures/laea.py diff --git a/packages/basemap/doc/users/figures/lcc.py b/packages/basemap/doc/source/users/figures/lcc.py similarity index 100% rename from packages/basemap/doc/users/figures/lcc.py rename to packages/basemap/doc/source/users/figures/lcc.py diff --git a/packages/basemap/doc/users/figures/mbtfpq.py b/packages/basemap/doc/source/users/figures/mbtfpq.py similarity index 100% rename from packages/basemap/doc/users/figures/mbtfpq.py rename to packages/basemap/doc/source/users/figures/mbtfpq.py diff --git a/packages/basemap/doc/users/figures/merc.py b/packages/basemap/doc/source/users/figures/merc.py similarity index 100% rename from packages/basemap/doc/users/figures/merc.py rename to packages/basemap/doc/source/users/figures/merc.py diff --git a/packages/basemap/doc/users/figures/mill.py b/packages/basemap/doc/source/users/figures/mill.py similarity index 100% rename from packages/basemap/doc/users/figures/mill.py rename to packages/basemap/doc/source/users/figures/mill.py diff --git a/packages/basemap/doc/users/figures/moll.py b/packages/basemap/doc/source/users/figures/moll.py similarity index 100% rename from packages/basemap/doc/users/figures/moll.py rename to packages/basemap/doc/source/users/figures/moll.py diff --git a/packages/basemap/doc/users/figures/npaeqd.py b/packages/basemap/doc/source/users/figures/npaeqd.py similarity index 100% rename from packages/basemap/doc/users/figures/npaeqd.py rename to packages/basemap/doc/source/users/figures/npaeqd.py diff --git a/packages/basemap/doc/users/figures/nplaea.py b/packages/basemap/doc/source/users/figures/nplaea.py similarity index 100% rename from packages/basemap/doc/users/figures/nplaea.py rename to packages/basemap/doc/source/users/figures/nplaea.py diff --git a/packages/basemap/doc/users/figures/npstere.py b/packages/basemap/doc/source/users/figures/npstere.py similarity index 100% rename from packages/basemap/doc/users/figures/npstere.py rename to packages/basemap/doc/source/users/figures/npstere.py diff --git a/packages/basemap/doc/users/figures/nsper_full.py b/packages/basemap/doc/source/users/figures/nsper_full.py similarity index 100% rename from packages/basemap/doc/users/figures/nsper_full.py rename to packages/basemap/doc/source/users/figures/nsper_full.py diff --git a/packages/basemap/doc/users/figures/nsper_partial.py b/packages/basemap/doc/source/users/figures/nsper_partial.py similarity index 100% rename from packages/basemap/doc/users/figures/nsper_partial.py rename to packages/basemap/doc/source/users/figures/nsper_partial.py diff --git a/packages/basemap/doc/users/figures/omerc.py b/packages/basemap/doc/source/users/figures/omerc.py similarity index 100% rename from packages/basemap/doc/users/figures/omerc.py rename to packages/basemap/doc/source/users/figures/omerc.py diff --git a/packages/basemap/doc/users/figures/ortho_full.py b/packages/basemap/doc/source/users/figures/ortho_full.py similarity index 100% rename from packages/basemap/doc/users/figures/ortho_full.py rename to packages/basemap/doc/source/users/figures/ortho_full.py diff --git a/packages/basemap/doc/users/figures/ortho_partial.py b/packages/basemap/doc/source/users/figures/ortho_partial.py similarity index 100% rename from packages/basemap/doc/users/figures/ortho_partial.py rename to packages/basemap/doc/source/users/figures/ortho_partial.py diff --git a/packages/basemap/doc/users/figures/plotargo.py b/packages/basemap/doc/source/users/figures/plotargo.py similarity index 100% rename from packages/basemap/doc/users/figures/plotargo.py rename to packages/basemap/doc/source/users/figures/plotargo.py diff --git a/packages/basemap/doc/users/figures/plotboulder.py b/packages/basemap/doc/source/users/figures/plotboulder.py similarity index 100% rename from packages/basemap/doc/users/figures/plotboulder.py rename to packages/basemap/doc/source/users/figures/plotboulder.py diff --git a/packages/basemap/doc/users/figures/plotdaynight.py b/packages/basemap/doc/source/users/figures/plotdaynight.py similarity index 100% rename from packages/basemap/doc/users/figures/plotdaynight.py rename to packages/basemap/doc/source/users/figures/plotdaynight.py diff --git a/packages/basemap/doc/users/figures/plotetopo5.py b/packages/basemap/doc/source/users/figures/plotetopo5.py similarity index 100% rename from packages/basemap/doc/users/figures/plotetopo5.py rename to packages/basemap/doc/source/users/figures/plotetopo5.py diff --git a/packages/basemap/doc/users/figures/plotgreatcircle.py b/packages/basemap/doc/source/users/figures/plotgreatcircle.py similarity index 100% rename from packages/basemap/doc/users/figures/plotgreatcircle.py rename to packages/basemap/doc/source/users/figures/plotgreatcircle.py diff --git a/packages/basemap/doc/users/figures/plothighsandlows.py b/packages/basemap/doc/source/users/figures/plothighsandlows.py similarity index 100% rename from packages/basemap/doc/users/figures/plothighsandlows.py rename to packages/basemap/doc/source/users/figures/plothighsandlows.py diff --git a/packages/basemap/doc/users/figures/plotprecip.py b/packages/basemap/doc/source/users/figures/plotprecip.py similarity index 100% rename from packages/basemap/doc/users/figures/plotprecip.py rename to packages/basemap/doc/source/users/figures/plotprecip.py diff --git a/packages/basemap/doc/users/figures/plotsst.py b/packages/basemap/doc/source/users/figures/plotsst.py similarity index 100% rename from packages/basemap/doc/users/figures/plotsst.py rename to packages/basemap/doc/source/users/figures/plotsst.py diff --git a/packages/basemap/doc/users/figures/plotwindvec.py b/packages/basemap/doc/source/users/figures/plotwindvec.py similarity index 100% rename from packages/basemap/doc/users/figures/plotwindvec.py rename to packages/basemap/doc/source/users/figures/plotwindvec.py diff --git a/packages/basemap/doc/users/figures/poly.py b/packages/basemap/doc/source/users/figures/poly.py similarity index 100% rename from packages/basemap/doc/users/figures/poly.py rename to packages/basemap/doc/source/users/figures/poly.py diff --git a/packages/basemap/doc/users/figures/robin.py b/packages/basemap/doc/source/users/figures/robin.py similarity index 100% rename from packages/basemap/doc/users/figures/robin.py rename to packages/basemap/doc/source/users/figures/robin.py diff --git a/packages/basemap/doc/users/figures/sinu.py b/packages/basemap/doc/source/users/figures/sinu.py similarity index 100% rename from packages/basemap/doc/users/figures/sinu.py rename to packages/basemap/doc/source/users/figures/sinu.py diff --git a/packages/basemap/doc/users/figures/spaeqd.py b/packages/basemap/doc/source/users/figures/spaeqd.py similarity index 100% rename from packages/basemap/doc/users/figures/spaeqd.py rename to packages/basemap/doc/source/users/figures/spaeqd.py diff --git a/packages/basemap/doc/users/figures/splaea.py b/packages/basemap/doc/source/users/figures/splaea.py similarity index 100% rename from packages/basemap/doc/users/figures/splaea.py rename to packages/basemap/doc/source/users/figures/splaea.py diff --git a/packages/basemap/doc/users/figures/spstere.py b/packages/basemap/doc/source/users/figures/spstere.py similarity index 100% rename from packages/basemap/doc/users/figures/spstere.py rename to packages/basemap/doc/source/users/figures/spstere.py diff --git a/packages/basemap/doc/users/figures/stere.py b/packages/basemap/doc/source/users/figures/stere.py similarity index 100% rename from packages/basemap/doc/users/figures/stere.py rename to packages/basemap/doc/source/users/figures/stere.py diff --git a/packages/basemap/doc/users/figures/tmerc.py b/packages/basemap/doc/source/users/figures/tmerc.py similarity index 100% rename from packages/basemap/doc/users/figures/tmerc.py rename to packages/basemap/doc/source/users/figures/tmerc.py diff --git a/packages/basemap/doc/users/figures/vandg.py b/packages/basemap/doc/source/users/figures/vandg.py similarity index 100% rename from packages/basemap/doc/users/figures/vandg.py rename to packages/basemap/doc/source/users/figures/vandg.py diff --git a/packages/basemap/doc/users/gall.rst b/packages/basemap/doc/source/users/gall.rst similarity index 100% rename from packages/basemap/doc/users/gall.rst rename to packages/basemap/doc/source/users/gall.rst diff --git a/packages/basemap/doc/users/geography.rst b/packages/basemap/doc/source/users/geography.rst similarity index 100% rename from packages/basemap/doc/users/geography.rst rename to packages/basemap/doc/source/users/geography.rst diff --git a/packages/basemap/doc/users/geos.rst b/packages/basemap/doc/source/users/geos.rst similarity index 100% rename from packages/basemap/doc/users/geos.rst rename to packages/basemap/doc/source/users/geos.rst diff --git a/packages/basemap/doc/users/gnomon.rst b/packages/basemap/doc/source/users/gnomon.rst similarity index 100% rename from packages/basemap/doc/users/gnomon.rst rename to packages/basemap/doc/source/users/gnomon.rst diff --git a/packages/basemap/doc/users/graticule.rst b/packages/basemap/doc/source/users/graticule.rst similarity index 100% rename from packages/basemap/doc/users/graticule.rst rename to packages/basemap/doc/source/users/graticule.rst diff --git a/packages/basemap/doc/users/hammer.rst b/packages/basemap/doc/source/users/hammer.rst similarity index 100% rename from packages/basemap/doc/users/hammer.rst rename to packages/basemap/doc/source/users/hammer.rst diff --git a/packages/basemap/doc/users/index.rst b/packages/basemap/doc/source/users/index.rst similarity index 100% rename from packages/basemap/doc/users/index.rst rename to packages/basemap/doc/source/users/index.rst diff --git a/packages/basemap/doc/users/installing.rst b/packages/basemap/doc/source/users/installing.rst similarity index 100% rename from packages/basemap/doc/users/installing.rst rename to packages/basemap/doc/source/users/installing.rst diff --git a/packages/basemap/doc/users/intro.rst b/packages/basemap/doc/source/users/intro.rst similarity index 100% rename from packages/basemap/doc/users/intro.rst rename to packages/basemap/doc/source/users/intro.rst diff --git a/packages/basemap/doc/users/kav7.rst b/packages/basemap/doc/source/users/kav7.rst similarity index 100% rename from packages/basemap/doc/users/kav7.rst rename to packages/basemap/doc/source/users/kav7.rst diff --git a/packages/basemap/doc/users/laea.rst b/packages/basemap/doc/source/users/laea.rst similarity index 100% rename from packages/basemap/doc/users/laea.rst rename to packages/basemap/doc/source/users/laea.rst diff --git a/packages/basemap/doc/users/lcc.rst b/packages/basemap/doc/source/users/lcc.rst similarity index 100% rename from packages/basemap/doc/users/lcc.rst rename to packages/basemap/doc/source/users/lcc.rst diff --git a/packages/basemap/doc/users/mapcoords.rst b/packages/basemap/doc/source/users/mapcoords.rst similarity index 100% rename from packages/basemap/doc/users/mapcoords.rst rename to packages/basemap/doc/source/users/mapcoords.rst diff --git a/packages/basemap/doc/users/mapsetup.rst b/packages/basemap/doc/source/users/mapsetup.rst similarity index 100% rename from packages/basemap/doc/users/mapsetup.rst rename to packages/basemap/doc/source/users/mapsetup.rst diff --git a/packages/basemap/doc/users/mbtfpq.rst b/packages/basemap/doc/source/users/mbtfpq.rst similarity index 100% rename from packages/basemap/doc/users/mbtfpq.rst rename to packages/basemap/doc/source/users/mbtfpq.rst diff --git a/packages/basemap/doc/users/merc.rst b/packages/basemap/doc/source/users/merc.rst similarity index 100% rename from packages/basemap/doc/users/merc.rst rename to packages/basemap/doc/source/users/merc.rst diff --git a/packages/basemap/doc/users/mill.rst b/packages/basemap/doc/source/users/mill.rst similarity index 100% rename from packages/basemap/doc/users/mill.rst rename to packages/basemap/doc/source/users/mill.rst diff --git a/packages/basemap/doc/users/moll.rst b/packages/basemap/doc/source/users/moll.rst similarity index 100% rename from packages/basemap/doc/users/moll.rst rename to packages/basemap/doc/source/users/moll.rst diff --git a/packages/basemap/doc/users/nsper.rst b/packages/basemap/doc/source/users/nsper.rst similarity index 100% rename from packages/basemap/doc/users/nsper.rst rename to packages/basemap/doc/source/users/nsper.rst diff --git a/packages/basemap/doc/users/omerc.rst b/packages/basemap/doc/source/users/omerc.rst similarity index 100% rename from packages/basemap/doc/users/omerc.rst rename to packages/basemap/doc/source/users/omerc.rst diff --git a/packages/basemap/doc/users/ortho.rst b/packages/basemap/doc/source/users/ortho.rst similarity index 100% rename from packages/basemap/doc/users/ortho.rst rename to packages/basemap/doc/source/users/ortho.rst diff --git a/packages/basemap/doc/users/paeqd.rst b/packages/basemap/doc/source/users/paeqd.rst similarity index 100% rename from packages/basemap/doc/users/paeqd.rst rename to packages/basemap/doc/source/users/paeqd.rst diff --git a/packages/basemap/doc/users/plaea.rst b/packages/basemap/doc/source/users/plaea.rst similarity index 100% rename from packages/basemap/doc/users/plaea.rst rename to packages/basemap/doc/source/users/plaea.rst diff --git a/packages/basemap/doc/users/poly.rst b/packages/basemap/doc/source/users/poly.rst similarity index 100% rename from packages/basemap/doc/users/poly.rst rename to packages/basemap/doc/source/users/poly.rst diff --git a/packages/basemap/doc/users/pstere.rst b/packages/basemap/doc/source/users/pstere.rst similarity index 100% rename from packages/basemap/doc/users/pstere.rst rename to packages/basemap/doc/source/users/pstere.rst diff --git a/packages/basemap/doc/users/robin.rst b/packages/basemap/doc/source/users/robin.rst similarity index 100% rename from packages/basemap/doc/users/robin.rst rename to packages/basemap/doc/source/users/robin.rst diff --git a/packages/basemap/doc/users/sinu.rst b/packages/basemap/doc/source/users/sinu.rst similarity index 100% rename from packages/basemap/doc/users/sinu.rst rename to packages/basemap/doc/source/users/sinu.rst diff --git a/packages/basemap/doc/users/stere.rst b/packages/basemap/doc/source/users/stere.rst similarity index 100% rename from packages/basemap/doc/users/stere.rst rename to packages/basemap/doc/source/users/stere.rst diff --git a/packages/basemap/doc/users/tmerc.rst b/packages/basemap/doc/source/users/tmerc.rst similarity index 100% rename from packages/basemap/doc/users/tmerc.rst rename to packages/basemap/doc/source/users/tmerc.rst diff --git a/packages/basemap/doc/users/vandg.rst b/packages/basemap/doc/source/users/vandg.rst similarity index 100% rename from packages/basemap/doc/users/vandg.rst rename to packages/basemap/doc/source/users/vandg.rst From 281e1ce75a1dd3550d175669cec604d867da9a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 22 Aug 2023 21:46:07 +0200 Subject: [PATCH 003/210] Reimplement sphinx conf.py configuration file --- packages/basemap/doc/source/_static/.gitkeep | 0 .../basemap/doc/source/_templates/.gitkeep | 0 .../source/_templates/autosummary/module.rst | 5 + packages/basemap/doc/source/conf.py | 292 ++++++++++-------- 4 files changed, 161 insertions(+), 136 deletions(-) create mode 100644 packages/basemap/doc/source/_static/.gitkeep create mode 100644 packages/basemap/doc/source/_templates/.gitkeep create mode 100644 packages/basemap/doc/source/_templates/autosummary/module.rst diff --git a/packages/basemap/doc/source/_static/.gitkeep b/packages/basemap/doc/source/_static/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/packages/basemap/doc/source/_templates/.gitkeep b/packages/basemap/doc/source/_templates/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/packages/basemap/doc/source/_templates/autosummary/module.rst b/packages/basemap/doc/source/_templates/autosummary/module.rst new file mode 100644 index 000000000..6090b5e35 --- /dev/null +++ b/packages/basemap/doc/source/_templates/autosummary/module.rst @@ -0,0 +1,5 @@ +{{ fullname }} +{{ underline }} + +.. automodule:: {{ fullname }} + :members: diff --git a/packages/basemap/doc/source/conf.py b/packages/basemap/doc/source/conf.py index 6d12a54cc..e9b7a1556 100644 --- a/packages/basemap/doc/source/conf.py +++ b/packages/basemap/doc/source/conf.py @@ -1,179 +1,199 @@ # -*- coding: utf-8 -*- -# -# Basemap documentation build configuration file, created by -# sphinx-quickstart on Fri May 2 12:33:25 2008. -# -# This file is execfile()d with the current directory set to its containing dir. -# -# The contents of this file are pickled, so don't put values in the namespace -# that aren't pickleable (module imports are okay, they're removed automatically). -# -# All configuration values have a default value; values that are commented out -# serve to show the default value. +# flake8: noqa: E402 +# pylint: disable=redefined-builtin,wrong-import-position +"""Configuration file for the Sphinx documentation builder. -import sys, os +This file does only contain a selection of the most common options. For a +full list see the documentation: +http://www.sphinx-doc.org/en/master/config +""" -# 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 -# absolute, like shown here. -#sys.path.append(os.path.abspath('sphinxext')) +# -- Path setup -------------------------------------------------------------- -# General configuration -# --------------------- +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +import os +import sys +sys.path.insert(0, os.path.abspath("../../src")) +myself = getattr(__import__("mpl_toolkits.basemap"), "basemap") +PY2 = (sys.version_info[0] == 2) -# Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', -#extensions = ['matplotlib.sphinxext.mathmpl', -# 'sphinx.ext.autodoc', 'matplotlib.sphinxext.only_directives', - 'matplotlib.sphinxext.plot_directive', -# 'sphinx.ext.inheritance_diagram', -# 'matplotlib.sphinxext.ipython_console_highlighting', - ] +# -- Project information ----------------------------------------------------- -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +project = myself.__name__.rsplit(".", 1)[-1] +copyright = "2011, Jeffrey Whitaker; 2016-2023 The matplotlib development team" +author = "Jeffrey Whitaker" -# The suffix of source filenames. -source_suffix = '.rst' +# The short X.Y version +version = "" +# The full version, including alpha/beta/rc tags +release = myself.__version__ -# The master toctree document. -master_doc = 'index' -# General substitutions. -project = 'Basemap Matplotlib Toolkit' -copyright = '2011, Jeffrey Whitaker; 2016 The matplotlib development team' +# -- General configuration --------------------------------------------------- -# The default replacements for |version| and |release|, also used in various -# other places throughout the built documents. +# If your documentation needs a minimal Sphinx version, state it here. # -# The short X.Y version. -from mpl_toolkits.basemap import __version__ as bmversion -version = bmversion -# The full version, including alpha/beta/rc tags. -release = bmversion +# needs_sphinx = "1.0" + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named "sphinx.ext.*") or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "matplotlib.sphinxext.plot_directive", +] -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -today_fmt = '%B %d, %Y' +autodoc_default_options = { + "member-order": "alphabetical", + "special-members": "__init__", + "undoc-members": True, + "exclude-members": "__weakref__", +} -# List of documents that shouldn't be included in the build. -unused_docs = [] +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = [".rst", ".md"] +source_suffix = ".rst" -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True +# The master toctree document. +master_doc = "index" + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = "en" -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = [] # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - +pygments_style = None -# Options for HTML output -# ----------------------- -# The style sheet to use for HTML and HTML Help pages. A file of that name -# must exist either in Sphinx' static/ path, or in one of the custom paths -# given in html_static_path. -#html_style = 'mpl.css' +# -- Options for HTML output ------------------------------------------------- -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -#html_title = None +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = "furo" +html_context = {} -# The name of an image file (within the static path) to place at the top of -# the sidebar. -#html_logo = 'logo.png' +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -#html_static_path = ['_static'] - -# If nonempty, this is the file name suffix for generated HTML files. The -# default is ``".html"``. -#html_file_suffix = '.xhtml' - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True +html_static_path = ["_static"] -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} - -# If false, no module index is generated. -#html_use_modindex = True +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# The default sidebars (for documents that don't match any pattern) are +# defined by theme itself. Builtin themes are using these templates by +# default: ``["localtoc.html", "relations.html", "sourcelink.html", +# "searchbox.html"]``. +# +# html_sidebars = {} -# If true, the reST sources are included in the HTML build as _sources/. -#html_copy_source = True -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. -html_use_opensearch = 'False' +# -- Options for HTMLHelp output --------------------------------------------- # Output file base name for HTML help builder. -htmlhelp_basename = 'Basemapdoc' +htmlhelp_basename = "{0}doc".format(project) -# Options for LaTeX output -# ------------------------ +# -- Options for LaTeX output ------------------------------------------------ -# The paper size ('letter' or 'a4'). -latex_paper_size = 'letter' - -# The font size ('10pt', '11pt' or '12pt'). -latex_font_size = '11pt' +latex_elements = { + # The paper size ("letterpaper" or "a4paper"). + "papersize": "letterpaper", + # The font size ("10pt", "11pt" or "12pt"). + "pointsize": "10pt", + # Additional stuff for the LaTeX preamble. + "preamble": "", + # Latex figure (float) alignment + "figure_align": "htbp", +} # Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, document class [howto/manual]). - -latex_documents = [ - ('index', 'Basemap.tex', 'Basemap', 'Jeffrey Whitaker', 'manual'), -] - - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -latex_logo = None - -# Additional stuff for the LaTeX preamble. -latex_preamble = '' - -# Documents to append as an appendix to all manuals. -latex_appendices = [] - -# If false, no module index is generated. -latex_use_modindex = True - -latex_use_parts = True +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [( + master_doc, "{0}.tex".format(project), + "{0} Documentation".format(project), + author, + "manual" +)] + + +# -- Options for manual page output ------------------------------------------ + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [( + master_doc, project, + "{0} Documentation".format(project), + [author], 1 +)] + + +# -- Options for Texinfo output ---------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [( + master_doc, + project, + "{0} Documentation".format(project), + author, + project, + myself.__doc__, + "Miscellaneous" +)] + + +# -- Options for Epub output ------------------------------------------------- + +# Bibliographic Dublin Core info. +epub_title = project + +# The unique identifier of the text. This can be a ISBN number +# or the project homepage. +# +# epub_identifier = "" -# Show both class-level docstring and __init__ docstring in class -# documentation -autoclass_content = 'both' +# A unique identification for the text. +# +# epub_uid = "" +# A list of files that should not be packed into the epub file. +epub_exclude_files = ["search.html"] +# -- Extension configuration ------------------------------------------------- -################ plot directive configurations ##################### +# Plot directive configurations. plot_html_show_formats = False plot_include_source = True -plot_rcparams = {'figure.figsize':[8, 6]} -plot_formats = [('png', 100), # pngs for html building - ('pdf', 72), # pdfs for latex building - ] +plot_rcparams = { + "figure.figsize": + [8, 6] +} +plot_formats = [ + ("png", 100), # PNGs for HTML building + ("pdf", 72), # PDFs for LaTeX building +] From 5bb41d9d73f070c5be1cac25333a43484a972138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 22 Aug 2023 21:46:37 +0200 Subject: [PATCH 004/210] Add sphinx.ext.viewcode extension to docs --- packages/basemap/doc/source/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/basemap/doc/source/conf.py b/packages/basemap/doc/source/conf.py index e9b7a1556..9392d3e91 100644 --- a/packages/basemap/doc/source/conf.py +++ b/packages/basemap/doc/source/conf.py @@ -42,6 +42,7 @@ # ones. extensions = [ "sphinx.ext.autodoc", + "sphinx.ext.viewcode", "matplotlib.sphinxext.plot_directive", ] From e620e65600e6fe2b53b30039a1962c6a84cca103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 22 Aug 2023 21:47:22 +0200 Subject: [PATCH 005/210] Add sphinx.ext.intersphinx extension to docs --- packages/basemap/doc/source/conf.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/basemap/doc/source/conf.py b/packages/basemap/doc/source/conf.py index 9392d3e91..42e4dac10 100644 --- a/packages/basemap/doc/source/conf.py +++ b/packages/basemap/doc/source/conf.py @@ -42,6 +42,7 @@ # ones. extensions = [ "sphinx.ext.autodoc", + "sphinx.ext.intersphinx", "sphinx.ext.viewcode", "matplotlib.sphinxext.plot_directive", ] @@ -53,6 +54,15 @@ "exclude-members": "__weakref__", } +intersphinx_mapping = { + "python": + ("https://docs.python.org/3", None), + "numpy": + ("https://numpy.org/doc/stable/", None), + "matplotlib": + ("https://matplotlib.org/stable/", None), +} + # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] From 199064fb1ac45c931d272cf3e2f5d1c5bbc796c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 22 Aug 2023 21:50:57 +0200 Subject: [PATCH 006/210] Update basemap-for-manylinux base images to Debian 9 --- .github/workflows/basemap-for-manylinux.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index eda92165b..e9b6e8606 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -43,7 +43,7 @@ jobs: max-parallel: 3 fail-fast: false needs: checkout - container: "pylegacy/python:${{ matrix.python-version }}-debian-8" + container: "pylegacy/python:${{ matrix.python-version }}-debian-9" steps: - name: Download checkout @@ -210,7 +210,7 @@ jobs: fail-fast: false needs: build runs-on: ubuntu-latest - container: "pylegacy/${{ matrix.arch }}-python:3.6-debian-8" + container: "pylegacy/${{ matrix.arch }}-python:3.6-debian-9" steps: - name: Download GEOS artifacts @@ -255,7 +255,7 @@ jobs: fail-fast: false needs: repair runs-on: ubuntu-latest - container: "pylegacy/${{ matrix.arch }}-python:${{ matrix.python-version }}-debian-8" + container: "pylegacy/${{ matrix.arch }}-python:${{ matrix.python-version }}-debian-9" steps: - name: Download checkout @@ -297,7 +297,7 @@ jobs: if: startsWith(github.event.ref, 'refs/tags/v') needs: test runs-on: ubuntu-latest - container: "pylegacy/${{ matrix.arch }}-python:${{ matrix.python-version }}-debian-8" + container: "pylegacy/${{ matrix.arch }}-python:${{ matrix.python-version }}-debian-9" environment: PyPI steps: - From 6fdf9492e2aa581fd116390965a9d2a09708f1fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 22 Aug 2023 21:52:35 +0200 Subject: [PATCH 007/210] Add docs job in basemap-for-manylinux workflow --- .github/workflows/basemap-for-manylinux.yml | 33 +++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index e9b6e8606..5c5462ab7 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -286,6 +286,39 @@ jobs: python -c "from mpl_toolkits.basemap import Basemap" python -c "from mpl_toolkits.basemap import cm" + docs: + needs: test + runs-on: ubuntu-latest + container: "pylegacy/python:3.8-debian-9" + steps: + - + name: Download checkout + uses: actions/download-artifact@v1 + with: + name: checkout + path: . + - + name: Install doc requirements + run: | + cd ${{ env.PKGDIR }} + pip install -r requirements-doc.txt + - + name: Install library requirements + run: | + cd ${{ env.PKGDIR }} + pip install -r requirements.txt + - + name: Run sphinx + run: | + cd ${{ env.PKGDIR }} + python -m sphinx doc/source public + - + name: Upload docs artifacts + uses: actions/upload-artifact@v1 + with: + name: docs + path: ${{ env.PKGDIR }}/public + upload: strategy: matrix: From ad18c401527789357274d63b8cad62256fa20d0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 22 Aug 2023 22:02:41 +0200 Subject: [PATCH 008/210] Apply minor reformatting to conf.py --- packages/basemap/doc/source/conf.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/basemap/doc/source/conf.py b/packages/basemap/doc/source/conf.py index 42e4dac10..01cd25d73 100644 --- a/packages/basemap/doc/source/conf.py +++ b/packages/basemap/doc/source/conf.py @@ -146,7 +146,7 @@ master_doc, "{0}.tex".format(project), "{0} Documentation".format(project), author, - "manual" + "manual", )] @@ -155,9 +155,11 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [( - master_doc, project, + master_doc, + project, "{0} Documentation".format(project), - [author], 1 + [author], + 1, )] @@ -173,7 +175,7 @@ author, project, myself.__doc__, - "Miscellaneous" + "Miscellaneous", )] @@ -202,7 +204,7 @@ plot_include_source = True plot_rcparams = { "figure.figsize": - [8, 6] + [8, 6], } plot_formats = [ ("png", 100), # PNGs for HTML building From 737070c8268b5dee3bb60895d01d1206bf0f55e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 23 Aug 2023 01:18:18 +0200 Subject: [PATCH 009/210] Fix docs job by installing the wheel from CI --- .github/workflows/basemap-for-manylinux.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index 5c5462ab7..9ccfa35b0 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -303,10 +303,16 @@ jobs: cd ${{ env.PKGDIR }} pip install -r requirements-doc.txt - - name: Install library requirements + name: Download build artifacts + uses: actions/download-artifact@v1 + with: + name: artifacts-build-x64-3.8 + path: ${{ env.PKGDIR }}/dist + - + name: Install package run: | cd ${{ env.PKGDIR }} - pip install -r requirements.txt + pip install dist/*-manylinux1*.whl - name: Run sphinx run: | From 0bea2d84350eda6af2df854f7d671b54d7d41260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 23 Aug 2023 13:36:52 +0200 Subject: [PATCH 010/210] Rewrap comments in documentation conf.py --- packages/basemap/doc/source/conf.py | 61 +++++++++++++++-------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/packages/basemap/doc/source/conf.py b/packages/basemap/doc/source/conf.py index 01cd25d73..79dc0c6bb 100644 --- a/packages/basemap/doc/source/conf.py +++ b/packages/basemap/doc/source/conf.py @@ -3,23 +3,24 @@ # pylint: disable=redefined-builtin,wrong-import-position """Configuration file for the Sphinx documentation builder. -This file does only contain a selection of the most common options. For a -full list see the documentation: +This file does only contain a selection of the most common options. +For a full list see the documentation: http://www.sphinx-doc.org/en/master/config """ -# -- Path setup -------------------------------------------------------------- +# -- Path setup -------------------------------------------------------- -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. +# If extensions (or modules to document with autodoc) are in another +# directory, add these directories to sys.path here. If the directory +# is relative to the documentation root, use os.path.abspath to make it +# absolute, like shown here. import os import sys sys.path.insert(0, os.path.abspath("../../src")) myself = getattr(__import__("mpl_toolkits.basemap"), "basemap") PY2 = (sys.version_info[0] == 2) -# -- Project information ----------------------------------------------------- +# -- Project information ----------------------------------------------- project = myself.__name__.rsplit(".", 1)[-1] copyright = "2011, Jeffrey Whitaker; 2016-2023 The matplotlib development team" @@ -31,7 +32,7 @@ release = myself.__version__ -# -- General configuration --------------------------------------------------- +# -- General configuration --------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. # @@ -75,8 +76,8 @@ # The master toctree document. master_doc = "index" -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. +# The language for content autogenerated by Sphinx. Refer to the +# documentation for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. @@ -91,42 +92,43 @@ pygments_style = None -# -- Options for HTML output ------------------------------------------------- +# -- Options for HTML output ------------------------------------------- -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. +# The theme to use for HTML and HTML Help pages. See the documentation +# for a list of builtin themes. html_theme = "furo" html_context = {} -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. +# Theme options are theme-specific and customize the look and feel of a +# theme further. For a list of options available for each theme, see +# the documentation. # # html_theme_options = {} -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". +# Add any paths that contain custom static files (such as style sheets) +# here, relative to this directory. They are copied after the builtin +# static files, so a file named "default.css" will overwrite the +# builtin "default.css". html_static_path = ["_static"] -# Custom sidebar templates, must be a dictionary that maps document names -# to template names. +# Custom sidebar templates, must be a dictionary that maps document +# names to template names. # # The default sidebars (for documents that don't match any pattern) are -# defined by theme itself. Builtin themes are using these templates by +# defined by theme itself. Builtin themes are using these templates by # default: ``["localtoc.html", "relations.html", "sourcelink.html", # "searchbox.html"]``. # # html_sidebars = {} -# -- Options for HTMLHelp output --------------------------------------------- +# -- Options for HTMLHelp output --------------------------------------- # Output file base name for HTML help builder. htmlhelp_basename = "{0}doc".format(project) -# -- Options for LaTeX output ------------------------------------------------ +# -- Options for LaTeX output ------------------------------------------ latex_elements = { # The paper size ("letterpaper" or "a4paper"). @@ -143,14 +145,15 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [( - master_doc, "{0}.tex".format(project), + master_doc, + "{0}.tex".format(project), "{0} Documentation".format(project), author, "manual", )] -# -- Options for manual page output ------------------------------------------ +# -- Options for manual page output ------------------------------------ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). @@ -163,7 +166,7 @@ )] -# -- Options for Texinfo output ---------------------------------------------- +# -- Options for Texinfo output ---------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, @@ -179,7 +182,7 @@ )] -# -- Options for Epub output ------------------------------------------------- +# -- Options for Epub output ------------------------------------------- # Bibliographic Dublin Core info. epub_title = project @@ -197,7 +200,7 @@ epub_exclude_files = ["search.html"] -# -- Extension configuration ------------------------------------------------- +# -- Extension configuration ------------------------------------------- # Plot directive configurations. plot_html_show_formats = False From c232a2161a440b03683cada24707a04eefdeaccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 23 Aug 2023 13:37:01 +0200 Subject: [PATCH 011/210] Remove unneeded parentheses --- packages/basemap/doc/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/basemap/doc/source/conf.py b/packages/basemap/doc/source/conf.py index 79dc0c6bb..50bde4883 100644 --- a/packages/basemap/doc/source/conf.py +++ b/packages/basemap/doc/source/conf.py @@ -18,7 +18,7 @@ import sys sys.path.insert(0, os.path.abspath("../../src")) myself = getattr(__import__("mpl_toolkits.basemap"), "basemap") -PY2 = (sys.version_info[0] == 2) +PY2 = sys.version_info[0] == 2 # -- Project information ----------------------------------------------- From 6040b304e3c34ae3646525f610dfd0997cdf5a9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 3 Oct 2023 09:19:49 +0200 Subject: [PATCH 012/210] Revert if-condition setup in upload jobs --- .github/workflows/basemap-data-hires.yml | 2 +- .github/workflows/basemap-data.yml | 2 +- .github/workflows/basemap-for-manylinux.yml | 2 +- .github/workflows/basemap-for-windows.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/basemap-data-hires.yml b/.github/workflows/basemap-data-hires.yml index a5101f727..a2030f33d 100644 --- a/.github/workflows/basemap-data-hires.yml +++ b/.github/workflows/basemap-data-hires.yml @@ -102,6 +102,7 @@ jobs: python-version: ["2.7"] max-parallel: 1 + if: startsWith(github.event.ref, 'refs/tags/v') needs: test runs-on: ubuntu-latest container: "pylegacy/python:${{ matrix.python-version }}-debian-9" @@ -129,7 +130,6 @@ jobs: TWINE_USERNAME: __token__ TWINE_PASSWORD: "${{ secrets.PYPI_TOKEN }}" TWINE_REPOSITORY_URL: "${{ secrets.PYPI_REPOSITORY_URL }}" - if: startsWith(github.event.ref, 'refs/tags/v') run: | python -m twine upload --skip-existing \ ${{ env.PKGDIR }}/dist/*.zip \ diff --git a/.github/workflows/basemap-data.yml b/.github/workflows/basemap-data.yml index 9439730fe..3958e1f09 100644 --- a/.github/workflows/basemap-data.yml +++ b/.github/workflows/basemap-data.yml @@ -102,6 +102,7 @@ jobs: python-version: ["2.7"] max-parallel: 1 + if: startsWith(github.event.ref, 'refs/tags/v') needs: test runs-on: ubuntu-latest container: "pylegacy/python:${{ matrix.python-version }}-debian-9" @@ -129,7 +130,6 @@ jobs: TWINE_USERNAME: __token__ TWINE_PASSWORD: "${{ secrets.PYPI_TOKEN }}" TWINE_REPOSITORY_URL: "${{ secrets.PYPI_REPOSITORY_URL }}" - if: startsWith(github.event.ref, 'refs/tags/v') run: | python -m twine upload --skip-existing \ ${{ env.PKGDIR }}/dist/*.zip \ diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index 54cc82a12..2f7502f55 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -333,6 +333,7 @@ jobs: python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] max-parallel: 1 + if: startsWith(github.event.ref, 'refs/tags/v') needs: test runs-on: ubuntu-latest container: "pylegacy/${{ matrix.arch }}-python:${{ matrix.python-version }}-debian-9" @@ -360,7 +361,6 @@ jobs: TWINE_USERNAME: __token__ TWINE_PASSWORD: "${{ secrets.PYPI_TOKEN }}" TWINE_REPOSITORY_URL: "${{ secrets.PYPI_REPOSITORY_URL }}" - if: startsWith(github.event.ref, 'refs/tags/v') run: | python -m twine upload --skip-existing \ ${{ env.PKGDIR }}/dist/*.zip \ diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml index b9aa7ebcd..ca3c8b0ba 100644 --- a/.github/workflows/basemap-for-windows.yml +++ b/.github/workflows/basemap-for-windows.yml @@ -261,6 +261,7 @@ jobs: python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] max-parallel: 1 + if: startsWith(github.event.ref, 'refs/tags/v') needs: test runs-on: windows-2019 environment: PyPI @@ -293,7 +294,6 @@ jobs: TWINE_USERNAME: __token__ TWINE_PASSWORD: "${{ secrets.PYPI_TOKEN }}" TWINE_REPOSITORY_URL: "${{ secrets.PYPI_REPOSITORY_URL }}" - if: startsWith(github.event.ref, 'refs/tags/v') run: | python -m twine upload --skip-existing ` ${{ env.PKGDIR }}/dist/*.whl From b3c9984b6d2e7c7d87aa8605a17407c342c05880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 3 Oct 2023 09:40:21 +0200 Subject: [PATCH 013/210] Add github-pages artifact generation in docs job --- .github/workflows/basemap-for-manylinux.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index 2f7502f55..2dac220ae 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -323,7 +323,13 @@ jobs: uses: actions/upload-artifact@v1 with: name: docs - path: ${{ env.PKGDIR }}/public + path: ${{ env.PKGDIR }}/public/ + - + name: Upload github-pages artifact + uses: actions/upload-pages-artifact@v2 + with: + name: github-pages + path: ${{ env.PKGDIR }}/public/ upload: strategy: From e18cc4ad55aa2bc12e0631f9c863bd87240e371b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 3 Oct 2023 12:58:00 +0200 Subject: [PATCH 014/210] Add pages job to basemap-for-manylinux --- .github/workflows/basemap-for-manylinux.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index 2dac220ae..d34fe8fa7 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -331,6 +331,20 @@ jobs: name: github-pages path: ${{ env.PKGDIR }}/public/ + pages: + needs: docs + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + permissions: + pages: write + id-token: write + steps: + - name: Deploy github-pages + uses: actions/deploy-pages@v2 + id: deployment + upload: strategy: matrix: From c70ebcda5a097001592875aaf864b65603f4aae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 4 Oct 2023 08:08:10 +0200 Subject: [PATCH 015/210] Remove end slash in root path for docs artifacts --- .github/workflows/basemap-for-manylinux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index d34fe8fa7..a75ec440d 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -323,13 +323,13 @@ jobs: uses: actions/upload-artifact@v1 with: name: docs - path: ${{ env.PKGDIR }}/public/ + path: ${{ env.PKGDIR }}/public - name: Upload github-pages artifact uses: actions/upload-pages-artifact@v2 with: name: github-pages - path: ${{ env.PKGDIR }}/public/ + path: ${{ env.PKGDIR }}/public pages: needs: docs From a3d64e0cf52f3dbdc540baabc7b0ff973f693c68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 13 Dec 2023 19:27:18 +0100 Subject: [PATCH 016/210] Update GEOS license text with upstream copy --- packages/basemap/LICENSE.geos | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/basemap/LICENSE.geos b/packages/basemap/LICENSE.geos index b1e3f5a26..f166cc57b 100644 --- a/packages/basemap/LICENSE.geos +++ b/packages/basemap/LICENSE.geos @@ -1,8 +1,8 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -10,7 +10,7 @@ as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] - Preamble + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public @@ -112,7 +112,7 @@ modification follow. Pay close attention to the difference between a former contains code derived from the library, whereas the latter must be combined with the library in order to run. - GNU LESSER GENERAL PUBLIC LICENSE + GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other @@ -146,7 +146,7 @@ such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - + 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an @@ -432,7 +432,7 @@ decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. @@ -455,7 +455,7 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS + END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries @@ -485,7 +485,7 @@ convey the exclusion of warranty; and each file should have at least the You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. @@ -499,6 +499,4 @@ necessary. Here is a sample; alter the names: , 1 April 1990 Ty Coon, President of Vice -That's all there is to it! - - +That's all there is to it! \ No newline at end of file From 87e4278dccdbd961acec70e606b3aa964d9d3296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 13 Dec 2023 19:51:54 +0100 Subject: [PATCH 017/210] Split optional requirements into separate files --- .github/workflows/basemap-for-manylinux.yml | 2 +- .github/workflows/basemap-for-windows.yml | 2 +- CHANGELOG.md | 7 ++++--- packages/basemap/requirements-owslib.txt | 8 ++++++++ .../{requirements-full.txt => requirements-pillow.txt} | 0 packages/basemap/setup.py | 6 ++++-- 6 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 packages/basemap/requirements-owslib.txt rename packages/basemap/{requirements-full.txt => requirements-pillow.txt} (100%) diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index dab8d28b0..1894fc6f4 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -285,7 +285,7 @@ jobs: name: Install package (full) run: | whlpath=$(ls ${{ env.PKGDIR }}/dist/*-manylinux1*.whl | head -n1) - pip install "${whlpath}[full]" + pip install "${whlpath}[owslib,pillow]" - name: Fix CA certificates location run: | diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml index c35705d0d..10e556cdc 100644 --- a/.github/workflows/basemap-for-windows.yml +++ b/.github/workflows/basemap-for-windows.yml @@ -258,7 +258,7 @@ jobs: name: Install package (full) run: | $whlpath = "$(Get-Item ${{ env.PKGDIR }}/dist/*-win*.whl)" - python -m pip install "${whlpath}[full]" + python -m pip install "${whlpath}[owslib,pillow]" - name: Test package run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 294bec506..f192ceac3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,9 +20,10 @@ https://semver.org/spec/v2.0.0.html ### Changed - Upgrade bundled GEOS library to 3.6.5. -- Create optional library requirements file `requirements-full.txt`: - - Move optional dependency `pillow` to optional requirements. - - Upgrade `pillow` upper pin to 10.2.0. +- Create optional library requirements files: + - `requirements-owslib.txt` for optional dependency `OWSLib`. + - `requirements-pillow.txt` for optional dependency `pillow`, with + upper pin bumped to 10.2.0. - Update library dependencies: - Downgrade `pyproj` upper pin to 2.2.0 for Python 2.7. - Set dependency on `packaging` as replacement for `distutils`. diff --git a/packages/basemap/requirements-owslib.txt b/packages/basemap/requirements-owslib.txt new file mode 100644 index 000000000..d5222d1dc --- /dev/null +++ b/packages/basemap/requirements-owslib.txt @@ -0,0 +1,8 @@ +ordereddict; python_version == "2.6" +OWSLib >= 0.8, < 0.15; python_version == "2.6" +OWSLib >= 0.8, < 0.19; python_version == "2.7" +OWSLib >= 0.8, < 0.11; python_version == "3.2" +OWSLib >= 0.8, < 0.11; python_version == "3.3" +OWSLib >= 0.8, < 0.18; python_version == "3.4" +OWSLib >= 0.8, < 0.20; python_version == "3.5" +OWSLib >= 0.8, < 0.30; python_version >= "3.6" diff --git a/packages/basemap/requirements-full.txt b/packages/basemap/requirements-pillow.txt similarity index 100% rename from packages/basemap/requirements-full.txt rename to packages/basemap/requirements-pillow.txt diff --git a/packages/basemap/setup.py b/packages/basemap/setup.py index a7ab1eeac..6441f0298 100644 --- a/packages/basemap/setup.py +++ b/packages/basemap/setup.py @@ -254,8 +254,10 @@ def run(self): get_content("requirements-lint.txt", splitlines=True), "test": get_content("requirements-test.txt", splitlines=True), - "full": - get_content("requirements-full.txt", splitlines=True), + "owslib": + get_content("requirements-owslib.txt", splitlines=True), + "pillow": + get_content("requirements-pillow.txt", splitlines=True), }, "cmdclass": { "sdist": basemap_sdist, From 13964069cad8dfe142a245e93c18a62e2c081505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 13 Dec 2023 20:39:31 +0100 Subject: [PATCH 018/210] Update limits for optional dependencies --- CHANGELOG.md | 19 ++++++++++++++----- packages/basemap/requirements-owslib.txt | 14 +++++++------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f192ceac3..436dd0766 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,8 +22,10 @@ https://semver.org/spec/v2.0.0.html - Upgrade bundled GEOS library to 3.6.5. - Create optional library requirements files: - `requirements-owslib.txt` for optional dependency `OWSLib`. - - `requirements-pillow.txt` for optional dependency `pillow`, with - upper pin bumped to 10.2.0. + - Set `OWSLib` lower pin to 0.28.1 for Python 3.6+ due to + vulnerability [CVE-2023-27476]. + - `requirements-pillow.txt` for optional dependency `pillow`: + - Upgrade `pillow` upper pin to 10.2.0. - Update library dependencies: - Downgrade `pyproj` upper pin to 2.2.0 for Python 2.7. - Set dependency on `packaging` as replacement for `distutils`. @@ -103,7 +105,8 @@ https://semver.org/spec/v2.0.0.html - Upgrade `matplotlib` upper pin to 3.8 (solves issue [#573]). - Upgrade `pyproj` upper pin to 3.6. - Upgrade test dependency `netCDF4` upper pin to 1.7. -- Upgrade test dependency `pillow` lower pin to 9.4. +- Upgrade test dependency `pillow` lower pin to 9.4 due to vulnerability + [CVE-2022-45198]. ## [1.3.6] - 2022-10-31 @@ -197,8 +200,8 @@ https://semver.org/spec/v2.0.0.html [CVE-2020-10177], [CVE-2020-10378], [CVE-2020-10379], [CVE-2020-10994] and [CVE-2020-11538]. - `pillow >= 6.2.2` For Python == 2.7 due to `pillow` vulnerabilities - [CVE-2019-16865], [CVE-2019-19911], [CVE-2020-5310], [CVE-2020-5312] - and [CVE-2020-5313]. + [CVE-2019-16865], [CVE-2019-19911], [CVE-2020-5310], + [CVE-2020-5311], [CVE-2020-5312] and [CVE-2020-5313]. ### Removed - Remove deprecation notices (issue [#527]). @@ -1217,6 +1220,10 @@ https://github.com/matplotlib/basemap/compare/v1.0.3rel...v1.0.4rel [1.0.3]: https://github.com/matplotlib/basemap/tree/v1.0.3rel +[CVE-2023-27476]: +https://nvd.nist.gov/vuln/detail/CVE-2023-27476 +[CVE-2022-45198]: +https://nvd.nist.gov/vuln/detail/CVE-2022-45198 [CVE-2022-24303]: https://nvd.nist.gov/vuln/detail/CVE-2022-24303 [CVE-2022-22817]: @@ -1283,6 +1290,8 @@ https://nvd.nist.gov/vuln/detail/CVE-2020-10177 https://nvd.nist.gov/vuln/detail/CVE-2020-5313 [CVE-2020-5312]: https://nvd.nist.gov/vuln/detail/CVE-2020-5312 +[CVE-2020-5311]: +https://nvd.nist.gov/vuln/detail/CVE-2020-5311 [CVE-2020-5310]: https://nvd.nist.gov/vuln/detail/CVE-2020-5310 [CVE-2019-19911]: diff --git a/packages/basemap/requirements-owslib.txt b/packages/basemap/requirements-owslib.txt index d5222d1dc..5c4f0439d 100644 --- a/packages/basemap/requirements-owslib.txt +++ b/packages/basemap/requirements-owslib.txt @@ -1,8 +1,8 @@ ordereddict; python_version == "2.6" -OWSLib >= 0.8, < 0.15; python_version == "2.6" -OWSLib >= 0.8, < 0.19; python_version == "2.7" -OWSLib >= 0.8, < 0.11; python_version == "3.2" -OWSLib >= 0.8, < 0.11; python_version == "3.3" -OWSLib >= 0.8, < 0.18; python_version == "3.4" -OWSLib >= 0.8, < 0.20; python_version == "3.5" -OWSLib >= 0.8, < 0.30; python_version >= "3.6" +OWSLib >= 0.8.0, < 0.15.0; python_version == "2.6" +OWSLib >= 0.8.0, < 0.19.0; python_version == "2.7" +OWSLib >= 0.8.0, < 0.11.0; python_version == "3.2" +OWSLib >= 0.8.0, < 0.11.0; python_version == "3.3" +OWSLib >= 0.8.0, < 0.18.0; python_version == "3.4" +OWSLib >= 0.8.0, < 0.20.0; python_version == "3.5" +OWSLib >= 0.28.1, < 0.30.0; python_version >= "3.6" From d66ae2ff779d5d1c60d82a3aac907590cce6f6a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 13 Dec 2023 21:12:27 +0100 Subject: [PATCH 019/210] Apply linting corrections to setup.py --- packages/basemap/setup.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/basemap/setup.py b/packages/basemap/setup.py index 6441f0298..45035e42e 100644 --- a/packages/basemap/setup.py +++ b/packages/basemap/setup.py @@ -12,12 +12,11 @@ from setuptools import setup from setuptools import find_packages from setuptools.command.sdist import sdist -from setuptools.dist import Distribution from setuptools.extension import Extension try: import Cython - cython_major_version = int(Cython.__version__.split(".")[0]) + cython_major_version = int(Cython.__version__.split(".", 1)[0]) except ImportError: cython_major_version = 0 @@ -84,7 +83,7 @@ def get_geos_install_prefix(): return None -class basemap_sdist(sdist): +class basemap_sdist(sdist): # pylint: disable=invalid-name """Custom `sdist` so that it will not pack DLLs on Windows if present.""" def run(self): @@ -117,8 +116,8 @@ def run(self): import numpy include_dirs.append(numpy.get_include()) except ImportError as err: - build_cmds = ("bdist_wheel", "build", "install") - if any(cmd in sys.argv[1:] for cmd in build_cmds): + cmds = ("bdist_wheel", "build", "install") + if any(cmd in sys.argv[1:] for cmd in cmds): warnings.warn("unable to locate NumPy headers", RuntimeWarning) # Define GEOS include, library and runtime dirs. From 09ef4557153547a04830f3aa152d2df6bf50b97b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 13 Dec 2023 21:14:21 +0100 Subject: [PATCH 020/210] Extend python_requires to include Python 3.12 --- packages/basemap/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/basemap/setup.py b/packages/basemap/setup.py index 45035e42e..4c98a8776 100644 --- a/packages/basemap/setup.py +++ b/packages/basemap/setup.py @@ -240,7 +240,7 @@ def run(self): ">=2.6", "!=3.0.*", "!=3.1.*", - "<3.12", + "<3.13", ]), "setup_requires": setup_requires, From 2d73034a9740c4cd9646d9cb5cf499b97c9f5ab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 13 Dec 2023 21:19:17 +0100 Subject: [PATCH 021/210] Update upper pin for numpy to 1.27.0 --- CHANGELOG.md | 1 + packages/basemap/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 436dd0766..778284dd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ https://semver.org/spec/v2.0.0.html - `requirements-pillow.txt` for optional dependency `pillow`: - Upgrade `pillow` upper pin to 10.2.0. - Update library dependencies: + - Upgrade `numpy` upper pin to 1.27.0. - Downgrade `pyproj` upper pin to 2.2.0 for Python 2.7. - Set dependency on `packaging` as replacement for `distutils`. - Update build dependencies: diff --git a/packages/basemap/requirements.txt b/packages/basemap/requirements.txt index e19d5ebfa..242b6e4d8 100644 --- a/packages/basemap/requirements.txt +++ b/packages/basemap/requirements.txt @@ -8,7 +8,7 @@ numpy >= 1.15, < 1.17; python_version == "3.4" numpy >= 1.16, < 1.19; python_version == "3.5" numpy >= 1.19, < 1.20; python_version == "3.6" numpy >= 1.21, < 1.22; python_version == "3.7" -numpy >= 1.21, < 1.26; python_version >= "3.8" +numpy >= 1.21, < 1.27; python_version >= "3.8" cycler < 0.11; python_version == "3.2" pyparsing >= 1.5, < 2.4.1; python_version == "2.6" From 41384d34f7b5d7558c3e9fd039af8de7457213e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 13 Dec 2023 21:25:33 +0100 Subject: [PATCH 022/210] Add Python 3.12 to basemap-for-windows workflow --- .github/workflows/basemap-for-windows.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml index 10e556cdc..d3548a708 100644 --- a/.github/workflows/basemap-for-windows.yml +++ b/.github/workflows/basemap-for-windows.yml @@ -41,7 +41,7 @@ jobs: strategy: matrix: python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] + ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] max-parallel: 3 fail-fast: false needs: checkout @@ -147,7 +147,7 @@ jobs: arch: ["x64", "x86"] python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] + ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] max-parallel: 3 fail-fast: false needs: build-geos @@ -176,7 +176,8 @@ jobs: "^2\.6|3\.[123]$" { Set-Variable -Name "pkgvers" -Value "1.11.3" } "^2\.7|3\.[456789]$" { Set-Variable -Name "pkgvers" -Value "1.16.6" } "^3\.10$" { Set-Variable -Name "pkgvers" -Value "1.21.4" } - default { Set-Variable -Name "pkgvers" -Value "1.23.3" } + "^3\.11$" { Set-Variable -Name "pkgvers" -Value "1.23.3" } + default { Set-Variable -Name "pkgvers" -Value "1.26.0" } } $env:SETUPTOOLS_USE_DISTUTILS = "stdlib" python -m pip install "numpy == ${pkgvers}" @@ -221,7 +222,11 @@ jobs: arch: ["x64", "x86"] python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] + ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + exclude: + # Missing precompiled binaries for `numpy` and `matplotlib`. + - arch: "x86" + python-version: "3.12" max-parallel: 3 fail-fast: false needs: build @@ -280,7 +285,7 @@ jobs: arch: ["x64", "x86"] python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] + ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] max-parallel: 1 if: startsWith(github.event.ref, 'refs/tags/v') needs: test From 7c95e5b5e2fa1414af549080a8009642699012af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 13 Dec 2023 22:39:08 +0100 Subject: [PATCH 023/210] Update numpy for Python 3.12 in build-system requires --- packages/basemap/pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/basemap/pyproject.toml b/packages/basemap/pyproject.toml index 26e78d87a..20cc071fd 100644 --- a/packages/basemap/pyproject.toml +++ b/packages/basemap/pyproject.toml @@ -2,7 +2,8 @@ requires = [ 'setuptools', 'wheel', - 'numpy == 1.23.3; python_version >= "3.11"', + 'numpy == 1.26.0; python_version >= "3.12"', + 'numpy == 1.23.3; python_version == "3.11"', 'numpy == 1.21.4; python_version == "3.10"', 'numpy == 1.21.4; sys_platform == "darwin" and (python_version >= "3.7" and python_version <= "3.9")', 'numpy == 1.16.6; sys_platform != "darwin" and (python_version >= "3.7" and python_version <= "3.9")', From c69fe699efa1087020831fce21fe70e03525359e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 14 Dec 2023 09:17:32 +0100 Subject: [PATCH 024/210] Upgrade doc dependencies --- CHANGELOG.md | 4 +++- packages/basemap/requirements-doc.txt | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 778284dd7..8798a9639 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,7 +32,9 @@ https://semver.org/spec/v2.0.0.html - Set dependency on `packaging` as replacement for `distutils`. - Update build dependencies: - Upgrade `Cython` upper pin to 3.1. -- Update doc dependencies: +- Update doc dependencies and require at least Python 3.8 for them: + - Upgrade upper limit for `sphinx` to 7.2. + - Upgrade upper limit for `furo` to 2023.9.11. - Move dependency on `netCDF4` to `requirements-doc.txt`. - Set dependency on `cftime` explicitly in `requirements-doc.txt`. diff --git a/packages/basemap/requirements-doc.txt b/packages/basemap/requirements-doc.txt index 6b88a848c..353713310 100644 --- a/packages/basemap/requirements-doc.txt +++ b/packages/basemap/requirements-doc.txt @@ -1,5 +1,5 @@ -sphinx >= 5.3, < 6.3; python_version >= "3.6" -furo >= 2022.4.7, < 2023.5.21; python_version >= "3.6" +sphinx >= 5.3, < 7.2; python_version >= "3.8" +furo >= 2022.4.7, < 2023.9.11; python_version >= "3.8" netCDF4 >= 1.5.6, < 1.7.0; python_version >= "3.6" cftime >= 1.4.0, < 1.7.0; python_version >= "3.6" From fb90313948a3a69b54fa2c830b5546724081a6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 14 Dec 2023 09:19:07 +0100 Subject: [PATCH 025/210] Update lint dependencies --- CHANGELOG.md | 4 ++++ packages/basemap/requirements-lint.txt | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8798a9639..ce62afb00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,10 @@ https://semver.org/spec/v2.0.0.html - Upgrade upper limit for `furo` to 2023.9.11. - Move dependency on `netCDF4` to `requirements-doc.txt`. - Set dependency on `cftime` explicitly in `requirements-doc.txt`. +- Update lint dependencies: + - Downgrade upper limit for `flake8` to 6.2. + - Upgrade upper limit for `astropy` to 3.1. + - Upgrade lower limit for `pylint` to 3.1. ### Fixed - Reimplement `matplotlib` version checks without using `distutils` and diff --git a/packages/basemap/requirements-lint.txt b/packages/basemap/requirements-lint.txt index 5669b9475..2b2a187c4 100644 --- a/packages/basemap/requirements-lint.txt +++ b/packages/basemap/requirements-lint.txt @@ -5,13 +5,13 @@ flake8 >= 2.6, < 4.0; python_version == "2.7" flake8 >= 2.6, < 3.0; python_version == "3.2" flake8 >= 2.6, < 3.0; python_version == "3.3" flake8 >= 2.6, < 3.9; python_version == "3.4" -flake8 >= 2.6, < 7.1; python_version >= "3.5" +flake8 >= 2.6, < 6.2; python_version >= "3.5" astroid >= 1.6, < 2.0; python_version == "2.7" astroid >= 2.4, < 2.5; python_version == "3.5" astroid >= 2.5, < 2.7; python_version == "3.6" -astroid >= 2.8, < 3.0; python_version >= "3.7" +astroid >= 2.8, < 3.1; python_version >= "3.7" pylint >= 1.9, < 2.0; python_version == "2.7" pylint >= 2.6, < 2.7; python_version == "3.5" pylint >= 2.7, < 2.10; python_version == "3.6" -pylint >= 2.11, < 3.0; python_version >= "3.7" +pylint >= 2.11, < 3.1; python_version >= "3.7" From 5165e5508edfaa55f251d916ae53709bafde9a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 14 Dec 2023 09:23:38 +0100 Subject: [PATCH 026/210] Update test dependencies --- CHANGELOG.md | 14 +++++++++----- packages/basemap/requirements-test.txt | 25 +++++++++++++++---------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce62afb00..9e7aae28b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,16 +22,16 @@ https://semver.org/spec/v2.0.0.html - Upgrade bundled GEOS library to 3.6.5. - Create optional library requirements files: - `requirements-owslib.txt` for optional dependency `OWSLib`. - - Set `OWSLib` lower pin to 0.28.1 for Python 3.6+ due to + - Set `OWSLib` lower limit to 0.28.1 for Python 3.6+ due to vulnerability [CVE-2023-27476]. - `requirements-pillow.txt` for optional dependency `pillow`: - - Upgrade `pillow` upper pin to 10.2.0. + - Upgrade `pillow` upper limit to 10.2.0. - Update library dependencies: - - Upgrade `numpy` upper pin to 1.27.0. - - Downgrade `pyproj` upper pin to 2.2.0 for Python 2.7. + - Upgrade upper limit for `numpy` to 1.27.0. + - Downgrade upper limit for `pyproj` to 2.2.0 for Python 2.7. - Set dependency on `packaging` as replacement for `distutils`. - Update build dependencies: - - Upgrade `Cython` upper pin to 3.1. + - Upgrade upper limit for `Cython` to 3.1. - Update doc dependencies and require at least Python 3.8 for them: - Upgrade upper limit for `sphinx` to 7.2. - Upgrade upper limit for `furo` to 2023.9.11. @@ -41,6 +41,10 @@ https://semver.org/spec/v2.0.0.html - Downgrade upper limit for `flake8` to 6.2. - Upgrade upper limit for `astropy` to 3.1. - Upgrade lower limit for `pylint` to 3.1. +- Update test dependencies: + - Upgrade upper limit for `pytest` to 7.5. + - Upgrade upper limit for `coverage` to 7.4. + - Upgrade upper limit for `pytest-cov` to 4.2. ### Fixed - Reimplement `matplotlib` version checks without using `distutils` and diff --git a/packages/basemap/requirements-test.txt b/packages/basemap/requirements-test.txt index 6b0e3cd96..7491b2686 100644 --- a/packages/basemap/requirements-test.txt +++ b/packages/basemap/requirements-test.txt @@ -1,18 +1,23 @@ unittest2; python_version <= "3.9" -typing >= 3.5, < 3.11; python_version == "3.4" -pytest >= 3.2, < 3.3; python_version == "2.6" -pytest >= 3.2, < 5.0; python_version == "2.7" -pytest >= 2.9, < 3.0; python_version == "3.2" -pytest >= 3.2, < 3.3; python_version == "3.3" -pytest >= 3.2, < 5.0; python_version == "3.4" -pytest >= 3.2, < 6.2; python_version == "3.5" -pytest >= 6.2.5, < 6.3; python_version >= "3.6" +pytest >= 3.2.0, < 3.3; python_version == "2.6" +pytest >= 4.6.9, < 5.0; python_version == "2.7" +pytest >= 2.9.0, < 3.0; python_version == "3.2" +pytest >= 3.2.0, < 3.3; python_version == "3.3" +pytest >= 4.6.9, < 5.0; python_version == "3.4" +pytest >= 6.1.2, < 6.2; python_version == "3.5" +pytest >= 6.2.5, < 7.5; python_version >= "3.6" +coverage >= 4.5, < 5.0; python_version == "2.6" +coverage >= 5.5, < 6.0; python_version == "2.7" coverage >= 3.7, < 4.0; python_version == "3.2" +coverage >= 4.5, < 5.0; python_version == "3.3" +coverage >= 4.5, < 5.0; python_version == "3.4" +coverage >= 5.5, < 6.0; python_version == "3.5" +coverage >= 5.5, < 7.4; python_version >= "3.6" pytest-cov >= 2.5, < 2.6; python_version == "2.6" -pytest-cov >= 2.5, < 3.0; python_version == "2.7" +pytest-cov >= 2.9, < 3.0; python_version == "2.7" pytest-cov >= 2.5, < 2.6; python_version == "3.2" pytest-cov >= 2.5, < 2.6; python_version == "3.3" pytest-cov >= 2.5, < 2.9; python_version == "3.4" -pytest-cov >= 2.5, < 3.1; python_version >= "3.5" +pytest-cov >= 2.9, < 4.2; python_version >= "3.5" From 37f10edb6db2c1b39e792df5b3432d2a1ca41085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 14 Dec 2023 11:00:48 +0100 Subject: [PATCH 027/210] Update filterwarnings for pytest temporarily For `pytest` it is needed to add another filter temporarily to deal with a DeprecationWarning in `dateutil`, which will be solved with its next release, see: https://github.com/dateutil/dateutil/issues/1314 --- packages/basemap/setup.cfg | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/basemap/setup.cfg b/packages/basemap/setup.cfg index 6661e4249..58e39b69a 100644 --- a/packages/basemap/setup.cfg +++ b/packages/basemap/setup.cfg @@ -22,7 +22,11 @@ ignore = [tool:pytest] filterwarnings = error - ignore::DeprecationWarning:unittest2.compatibility: + # To be removed when replacing `unittest2`. + ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated:DeprecationWarning:unittest2.compatibility:143 + # To be removed with `dateutil` release after 2.8.2. + # See: https://github.com/dateutil/dateutil/issues/1314 + ignore:datetime.datetime.utcfromtimestamp\(\) is deprecated:DeprecationWarning:dateutil.tz.tz:37 [coverage:paths] source = From d138ed13f6a2719dc54806fcc9cd86d67dc60cb0 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 20 Dec 2023 11:19:58 +0100 Subject: [PATCH 028/210] Call the Python version of import_array() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new approach follows this example: The C version is a macro with control flow that Cython does not know anything about. It introduces a C type error. This fixes a build failure with some compilers: src/_geoslib.c: In function ‘__pyx_pymod_exec__geoslib’: src/_geoslib.c:8755:3: error: returning ‘void *’ from a function with return type ‘int’ makes integer from pointer without a cast 8755 | import_array(); | ^~~~~~~~~~~~ --- packages/basemap/src/_geoslib.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/basemap/src/_geoslib.pyx b/packages/basemap/src/_geoslib.pyx index e078b4f30..74be404f6 100644 --- a/packages/basemap/src/_geoslib.pyx +++ b/packages/basemap/src/_geoslib.pyx @@ -1,5 +1,6 @@ import sys import numpy +cimport numpy as cnp __version__ = "0.3" @@ -20,10 +21,9 @@ cdef extern from "numpy/arrayobject.h": cdef int flags npy_intp PyArray_SIZE(ndarray arr) npy_intp PyArray_ISCONTIGUOUS(ndarray arr) - void import_array() # Initialize numpy -import_array() +cnp.import_array() # GENERAL NOTES: # From 73326b40bed70e7b06a089d99968861e143ce9e9 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 20 Dec 2023 11:24:52 +0100 Subject: [PATCH 029/210] Change GEOSGeom to GEOSGeometry and GEOSCoordSeq to GEOSCoordSequence MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The C types GEOSGeom and GEOSCoordSeq are themselves pointer types. The underlying struct typedefs are called GEOSGeometry and GEOSCoordSequence. This fixes C compilation errors with future compilers: src/_geoslib.c:6918:28: error: passing argument 1 of ‘GEOSCoordSeq_setY’ from incompatible pointer type 6918 | (void)(GEOSCoordSeq_setY(__pyx_v_cs, 0, __pyx_v_dy)); | ^~~~~~~~~~ | | | GEOSCoordSequence ** {aka struct GEOSCoordSeq_t **} /usr/include/geos_c.h:2194:58: note: expected ‘GEOSCoordSequence *’ {aka ‘struct GEOSCoordSeq_t *’} but argument is of type ‘GEOSCoordSequence **’ {aka ‘struct GEOSCoordSeq_t **’} 2194 | extern int GEOS_DLL GEOSCoordSeq_setY(GEOSCoordSequence* s, | ~~~~~~~~~~~~~~~~~~~^ --- packages/basemap/src/_geoslib.pyx | 128 +++++++++++++++--------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/packages/basemap/src/_geoslib.pyx b/packages/basemap/src/_geoslib.pyx index 74be404f6..a5671262c 100644 --- a/packages/basemap/src/_geoslib.pyx +++ b/packages/basemap/src/_geoslib.pyx @@ -47,9 +47,9 @@ cdef extern from "geos_c.h": GEOS_MULTIPOLYGON GEOS_GEOMETRYCOLLECTION GEOS_VERSION_MAJOR - ctypedef struct GEOSGeom: + ctypedef struct GEOSGeometry: pass - ctypedef struct GEOSCoordSeq: + ctypedef struct GEOSCoordSequence: pass # Cython 3: Next ctypedef needs "noexcept" declaration unless # the compiler directive "legacy_implicit_noexcept" is used @@ -58,55 +58,55 @@ cdef extern from "geos_c.h": char *GEOSversion() void initGEOS(GEOSMessageHandler notice_function, GEOSMessageHandler error_function) void finishGEOS() - GEOSCoordSeq *GEOSCoordSeq_create(unsigned int size, unsigned int dims) - void GEOSCoordSeq_destroy(GEOSCoordSeq* s) - int GEOSCoordSeq_setX(GEOSCoordSeq* s,unsigned int idx, double val) - int GEOSCoordSeq_setY(GEOSCoordSeq* s,unsigned int idx, double val) - int GEOSCoordSeq_getX(GEOSCoordSeq* s, unsigned int idx, double *val) - int GEOSCoordSeq_getY(GEOSCoordSeq* s, unsigned int idx, double *val) - GEOSGeom *GEOSUnion(GEOSGeom* g1, GEOSGeom* g2) - GEOSGeom *GEOSUnaryUnion(GEOSGeom* g1) - GEOSGeom *GEOSEnvelope(GEOSGeom* g1) - GEOSGeom *GEOSConvexHull(GEOSGeom* g1) - GEOSGeom *GEOSGeom_createPoint(GEOSCoordSeq* s) - GEOSGeom *GEOSGeom_createLineString(GEOSCoordSeq* s) - GEOSGeom *GEOSGeom_createPolygon(GEOSGeom* shell, GEOSGeom** holes, unsigned int nholes) - GEOSGeom *GEOSGeom_createLinearRing(GEOSCoordSeq* s) - void GEOSGeom_destroy(GEOSGeom* g) + GEOSCoordSequence *GEOSCoordSeq_create(unsigned int size, unsigned int dims) + void GEOSCoordSeq_destroy(GEOSCoordSequence* s) + int GEOSCoordSeq_setX(GEOSCoordSequence* s,unsigned int idx, double val) + int GEOSCoordSeq_setY(GEOSCoordSequence* s,unsigned int idx, double val) + int GEOSCoordSeq_getX(GEOSCoordSequence* s, unsigned int idx, double *val) + int GEOSCoordSeq_getY(GEOSCoordSequence* s, unsigned int idx, double *val) + GEOSGeometry *GEOSUnion(GEOSGeometry* g1, GEOSGeometry* g2) + GEOSGeometry *GEOSUnaryUnion(GEOSGeometry* g1) + GEOSGeometry *GEOSEnvelope(GEOSGeometry* g1) + GEOSGeometry *GEOSConvexHull(GEOSGeometry* g1) + GEOSGeometry *GEOSGeom_createPoint(GEOSCoordSequence* s) + GEOSGeometry *GEOSGeom_createLineString(GEOSCoordSequence* s) + GEOSGeometry *GEOSGeom_createPolygon(GEOSGeometry* shell, GEOSGeometry** holes, unsigned int nholes) + GEOSGeometry *GEOSGeom_createLinearRing(GEOSCoordSequence* s) + void GEOSGeom_destroy(GEOSGeometry* g) # Topology operations - return NULL on exception. - GEOSGeom *GEOSIntersection(GEOSGeom* g1, GEOSGeom* g2) - GEOSGeom *GEOSSimplify(GEOSGeom* g1, double tolerance) - GEOSGeom *GEOSBuffer(GEOSGeom* g1, double width, int quadsegs) - GEOSGeom *GEOSTopologyPreserveSimplify(GEOSGeom* g1, double tolerance) + GEOSGeometry *GEOSIntersection(GEOSGeometry* g1, GEOSGeometry* g2) + GEOSGeometry *GEOSSimplify(GEOSGeometry* g1, double tolerance) + GEOSGeometry *GEOSBuffer(GEOSGeometry* g1, double width, int quadsegs) + GEOSGeometry *GEOSTopologyPreserveSimplify(GEOSGeometry* g1, double tolerance) # Binary/Unary predicate - return 2 on exception, 1 on true, 0 on false - char GEOSIntersects(GEOSGeom* g1, GEOSGeom* g2) - char GEOSWithin(GEOSGeom* g1, GEOSGeom* g2) - char GEOSContains(GEOSGeom* g1, GEOSGeom* g2) - char GEOSisEmpty(GEOSGeom* g1) - char GEOSisValid(GEOSGeom* g1) - char GEOSisSimple(GEOSGeom* g1) - char GEOSisRing(GEOSGeom* g1) + char GEOSIntersects(GEOSGeometry* g1, GEOSGeometry* g2) + char GEOSWithin(GEOSGeometry* g1, GEOSGeometry* g2) + char GEOSContains(GEOSGeometry* g1, GEOSGeometry* g2) + char GEOSisEmpty(GEOSGeometry* g1) + char GEOSisValid(GEOSGeometry* g1) + char GEOSisSimple(GEOSGeometry* g1) + char GEOSisRing(GEOSGeometry* g1) # Geometry info - char *GEOSGeomType(GEOSGeom* g1) - int GEOSGeomTypeId(GEOSGeom* g1) + char *GEOSGeomType(GEOSGeometry* g1) + int GEOSGeomTypeId(GEOSGeometry* g1) # Functions: Return 0 on exception, 1 otherwise - int GEOSArea(GEOSGeom* g1, double *area) - int GEOSLength(GEOSGeom* g1, double *length) + int GEOSArea(GEOSGeometry* g1, double *area) + int GEOSLength(GEOSGeometry* g1, double *length) # returns -1 on error and 1 for non-multi geoms - int GEOSGetNumGeometries(GEOSGeom* g1) + int GEOSGetNumGeometries(GEOSGeometry* g1) # Return NULL on exception, Geometry must be a Collection. # Returned object is a pointer to internal storage: # it must NOT be destroyed directly. - GEOSGeom *GEOSGetGeometryN(GEOSGeom* g, int n) - int GEOSGetNumInteriorRings(GEOSGeom* g1) + GEOSGeometry *GEOSGetGeometryN(GEOSGeometry* g, int n) + int GEOSGetNumInteriorRings(GEOSGeometry* g1) # Return NULL on exception, Geometry must be a Polygon. # Returned object is a pointer to internal storage: # it must NOT be destroyed directly. - GEOSGeom *GEOSGetExteriorRing(GEOSGeom* g) + GEOSGeometry *GEOSGetExteriorRing(GEOSGeometry* g) # Return NULL on exception. # Geometry must be a LineString, LinearRing or Point. - GEOSCoordSeq *GEOSGeom_getCoordSeq(GEOSGeom* g) - int GEOSCoordSeq_getSize(GEOSCoordSeq *s, unsigned int *size) + GEOSCoordSequence *GEOSGeom_getCoordSeq(GEOSGeometry* g) + int GEOSCoordSeq_getSize(GEOSCoordSequence *s, unsigned int *size) # Cython 3: Next cdef needs "noexcept" declaration unless # the compiler directive "legacy_implicit_noexcept" is used @@ -145,7 +145,7 @@ __geos_major_version__ = GEOS_VERSION_MAJOR initGEOS(notice_h, error_h) cdef class BaseGeometry: - cdef GEOSGeom *_geom + cdef GEOSGeometry *_geom cdef unsigned int _npts cdef public object boundary @@ -161,8 +161,8 @@ cdef class BaseGeometry: return PyBytes_FromString(GEOSGeomType(self._geom)) def within(self, BaseGeometry geom): - cdef GEOSGeom *g1 - cdef GEOSGeom *g2 + cdef GEOSGeometry *g1 + cdef GEOSGeometry *g2 cdef char answer g1 = self._geom g2 = geom._geom @@ -173,10 +173,10 @@ cdef class BaseGeometry: return False def union(self, BaseGeometry geom): - cdef GEOSGeom *g1 - cdef GEOSGeom *g2 - cdef GEOSGeom *g3 - cdef GEOSGeom *gout + cdef GEOSGeometry *g1 + cdef GEOSGeometry *g2 + cdef GEOSGeometry *g3 + cdef GEOSGeometry *gout cdef int numgeoms, i, typeid g1 = self._geom g2 = geom._geom @@ -206,9 +206,9 @@ cdef class BaseGeometry: return p def simplify(self, tol): - cdef GEOSGeom *g1 - cdef GEOSGeom *g3 - cdef GEOSGeom *gout + cdef GEOSGeometry *g1 + cdef GEOSGeometry *g3 + cdef GEOSGeometry *gout cdef double tolerance cdef int numgeoms, i, typeid g1 = self._geom @@ -239,9 +239,9 @@ cdef class BaseGeometry: return p def fix(self): - cdef GEOSGeom *g1 - cdef GEOSGeom *g3 - cdef GEOSGeom *gout + cdef GEOSGeometry *g1 + cdef GEOSGeometry *g3 + cdef GEOSGeometry *gout cdef int numgeoms, i, typeid g1 = self._geom g3 = GEOSBuffer(g1, 0., 0) @@ -270,8 +270,8 @@ cdef class BaseGeometry: return p def intersects(self, BaseGeometry geom): - cdef GEOSGeom *g1 - cdef GEOSGeom *g2 + cdef GEOSGeometry *g1 + cdef GEOSGeometry *g2 cdef char answer g1 = self._geom g2 = geom._geom @@ -282,10 +282,10 @@ cdef class BaseGeometry: return False def intersection(self, BaseGeometry geom): - cdef GEOSGeom *g1 - cdef GEOSGeom *g2 - cdef GEOSGeom *g3 - cdef GEOSGeom *gout + cdef GEOSGeometry *g1 + cdef GEOSGeometry *g2 + cdef GEOSGeometry *g3 + cdef GEOSGeometry *gout cdef char answer cdef int numgeoms, i, typeid g1 = self._geom @@ -341,8 +341,8 @@ cdef class Polygon(BaseGeometry): cdef unsigned int M, m, i cdef double dx, dy cdef double *bbuffer - cdef GEOSCoordSeq *cs - cdef GEOSGeom *lr + cdef GEOSCoordSequence *cs + cdef GEOSGeometry *lr @@ -396,7 +396,7 @@ cdef class Polygon(BaseGeometry): cdef class LineString(BaseGeometry): def __init__(self, ndarray b): cdef double dx, dy - cdef GEOSCoordSeq *cs + cdef GEOSCoordSequence *cs cdef int i, M cdef double *bbuffer @@ -429,7 +429,7 @@ cdef class Point(BaseGeometry): cdef public x,y def __init__(self, b): cdef double dx, dy - cdef GEOSCoordSeq *cs + cdef GEOSCoordSequence *cs # Create a coordinate sequence cs = GEOSCoordSeq_create(1, 2) dx = b[0]; dy = b[1] @@ -439,9 +439,9 @@ cdef class Point(BaseGeometry): self._npts = 1 self.boundary = b -cdef _get_coords(GEOSGeom *geom): - cdef GEOSCoordSeq *cs - cdef GEOSGeom *lr +cdef _get_coords(GEOSGeometry *geom): + cdef GEOSCoordSequence *cs + cdef GEOSGeometry *lr cdef unsigned int i, M cdef double dx, dy cdef ndarray b From 0d90252ac0218eabcb333212af2faa2f159abe85 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 20 Dec 2023 11:27:38 +0100 Subject: [PATCH 030/210] Fix const correctness issues This avoids lots of C compiler warnings. --- packages/basemap/src/_geoslib.pyx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/basemap/src/_geoslib.pyx b/packages/basemap/src/_geoslib.pyx index a5671262c..d6d6f4826 100644 --- a/packages/basemap/src/_geoslib.pyx +++ b/packages/basemap/src/_geoslib.pyx @@ -105,8 +105,8 @@ cdef extern from "geos_c.h": GEOSGeometry *GEOSGetExteriorRing(GEOSGeometry* g) # Return NULL on exception. # Geometry must be a LineString, LinearRing or Point. - GEOSCoordSequence *GEOSGeom_getCoordSeq(GEOSGeometry* g) - int GEOSCoordSeq_getSize(GEOSCoordSequence *s, unsigned int *size) + GEOSCoordSequence *GEOSGeom_getCoordSeq(const GEOSGeometry* g) + int GEOSCoordSeq_getSize(const GEOSCoordSequence *s, unsigned int *size) # Cython 3: Next cdef needs "noexcept" declaration unless # the compiler directive "legacy_implicit_noexcept" is used @@ -176,7 +176,7 @@ cdef class BaseGeometry: cdef GEOSGeometry *g1 cdef GEOSGeometry *g2 cdef GEOSGeometry *g3 - cdef GEOSGeometry *gout + cdef const GEOSGeometry *gout cdef int numgeoms, i, typeid g1 = self._geom g2 = geom._geom @@ -208,7 +208,7 @@ cdef class BaseGeometry: def simplify(self, tol): cdef GEOSGeometry *g1 cdef GEOSGeometry *g3 - cdef GEOSGeometry *gout + cdef const GEOSGeometry *gout cdef double tolerance cdef int numgeoms, i, typeid g1 = self._geom @@ -241,7 +241,7 @@ cdef class BaseGeometry: def fix(self): cdef GEOSGeometry *g1 cdef GEOSGeometry *g3 - cdef GEOSGeometry *gout + cdef const GEOSGeometry *gout cdef int numgeoms, i, typeid g1 = self._geom g3 = GEOSBuffer(g1, 0., 0) @@ -285,7 +285,7 @@ cdef class BaseGeometry: cdef GEOSGeometry *g1 cdef GEOSGeometry *g2 cdef GEOSGeometry *g3 - cdef GEOSGeometry *gout + cdef const GEOSGeometry *gout cdef char answer cdef int numgeoms, i, typeid g1 = self._geom @@ -439,9 +439,9 @@ cdef class Point(BaseGeometry): self._npts = 1 self.boundary = b -cdef _get_coords(GEOSGeometry *geom): - cdef GEOSCoordSequence *cs - cdef GEOSGeometry *lr +cdef _get_coords(const GEOSGeometry *geom): + cdef const GEOSCoordSequence *cs + cdef const GEOSGeometry *lr cdef unsigned int i, M cdef double dx, dy cdef ndarray b From c181b790282a3215fcb3aa2d06d25c7960a83e19 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 20 Dec 2023 11:33:06 +0100 Subject: [PATCH 031/210] Fix type error in initGEOS() call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The function pointers passed to initGEOS() did not have the correct type. A proper fix needs support in Cython, which is currently missing. This fixes a build failure with Clang 16 and GCC 14. src/_geoslib.c: In function ‘__pyx_pymod_exec__geoslib’: src/_geoslib.c:8803:12: error: passing argument 1 of ‘initGEOS’ from incompatible pointer type 8803 | initGEOS(__pyx_f_8_geoslib_notice_h, __pyx_f_8_geoslib_error_h); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | | | void (*)(char *, char *) In file included from src/_geoslib.c:1219: /usr/include/geos_c.h:2074:24: note: expected ‘GEOSMessageHandler’ {aka ‘void (*)(const char *, ...)’} but argument is of type ‘void (*)(char *, char *)’ 2074 | GEOSMessageHandler notice_function, | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ src/_geoslib.c:8803:40: error: passing argument 2 of ‘initGEOS’ from incompatible pointer type 8803 | initGEOS(__pyx_f_8_geoslib_notice_h, __pyx_f_8_geoslib_error_h); | ^~~~~~~~~~~~~~~~~~~~~~~~~ | | | void (*)(char *, char *) /usr/include/geos_c.h:2075:24: note: expected ‘GEOSMessageHandler’ {aka ‘void (*)(const char *, ...)’} but argument is of type ‘void (*)(char *, char *)’ 2075 | GEOSMessageHandler error_function); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ --- packages/basemap/src/_geoslib.pyx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/basemap/src/_geoslib.pyx b/packages/basemap/src/_geoslib.pyx index d6d6f4826..d92071b63 100644 --- a/packages/basemap/src/_geoslib.pyx +++ b/packages/basemap/src/_geoslib.pyx @@ -54,7 +54,7 @@ cdef extern from "geos_c.h": # Cython 3: Next ctypedef needs "noexcept" declaration unless # the compiler directive "legacy_implicit_noexcept" is used # ("noexcept" syntax supported since Cython 0.29.31). - ctypedef void (*GEOSMessageHandler)(char *fmt, char *list) + ctypedef void (*GEOSMessageHandler)(const char *fmt, ...) char *GEOSversion() void initGEOS(GEOSMessageHandler notice_function, GEOSMessageHandler error_function) void finishGEOS() @@ -111,7 +111,7 @@ cdef extern from "geos_c.h": # Cython 3: Next cdef needs "noexcept" declaration unless # the compiler directive "legacy_implicit_noexcept" is used # ("noexcept" syntax supported since Cython 0.29.31). -cdef void notice_h(char *fmt, char*msg): +cdef void notice_h(const char *fmt, ...): pass #format = PyBytes_FromString(fmt) #message = PyBytes_FromString(msg) @@ -124,7 +124,9 @@ cdef void notice_h(char *fmt, char*msg): # Cython 3: Next cdef needs "noexcept" declaration unless # the compiler directive "legacy_implicit_noexcept" is used # ("noexcept" syntax supported since Cython 0.29.31). -cdef void error_h(char *fmt, char*msg): +# FIXME: The type should be: error_h(const char *fmt, ...), but +# Cython does not currently support varargs functions. +cdef void error_h(const char *fmt, char*msg): format = PyBytes_FromString(fmt) message = PyBytes_FromString(msg) try: @@ -142,7 +144,7 @@ __geos_major_version__ = GEOS_VERSION_MAJOR # raise ValueError('version 2.2.3 of the geos library is required') # intialize GEOS (parameters are notice and error function callbacks). -initGEOS(notice_h, error_h) +initGEOS(notice_h, error_h) cdef class BaseGeometry: cdef GEOSGeometry *_geom From b5b72e6718f4ab5d23423c7e7dacba596912e712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 21 Dec 2023 00:34:30 +0100 Subject: [PATCH 032/210] Add Python 3.12 to basemap-for-manylinux workflow --- .github/workflows/basemap-for-manylinux.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index 1894fc6f4..2458dd7a6 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -39,7 +39,7 @@ jobs: strategy: matrix: python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] + ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] max-parallel: 3 fail-fast: false needs: checkout @@ -131,7 +131,7 @@ jobs: arch: ["x64", "x86"] python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] + ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] max-parallel: 3 fail-fast: false needs: build-geos @@ -162,10 +162,11 @@ jobs: 2.6|3.[23]) pkgvers=1.11.3;; 2.7|3.[456789]) pkgvers=1.16.6;; 3.10) pkgvers=1.21.4;; - *) pkgvers=1.23.3;; + 3.11) pkgvers=1.23.3;; + *) pkgvers=1.26.0;; esac - # Dirty solution to get NumPy headers for Python 3.11. - if [ "${{ matrix.python-version }}" = "3.11" ]; then + # Dirty solution to get NumPy headers for Python 3.11 and 3.12. + if [ "${{ matrix.python-version }}" = "3.11" -o "${{ matrix.python-version }}" = "3.12" ]; then case "${{ matrix.arch }}" in x64) kwds="--plat=manylinux_2_17_x86_64" ;; x86) kwds="--plat=manylinux_2_17_i686" ;; @@ -185,7 +186,7 @@ jobs: sitepkgdir=$(pip show numpy 2>/dev/null | grep Location: | cut -d' ' -f2) export GEOS_DIR="${GITHUB_WORKSPACE}/${{ env.PKGDIR }}/extern" export NUMPY_INCLUDE_PATH=${sitepkgdir}/numpy/core/include - if [ "${{ matrix.python-version }}" = "3.11" ]; then + if [ "${{ matrix.python-version }}" = "3.11" -o "${{ matrix.python-version }}" = "3.12" ]; then kwds="--no-build-isolation" pip install setuptools wheel "cython >= 0.29, < 3.1" fi @@ -205,7 +206,7 @@ jobs: arch: ["x64", "x86"] python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] + ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] max-parallel: 3 fail-fast: false needs: build @@ -250,7 +251,7 @@ jobs: arch: ["x64", "x86"] python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] + ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] max-parallel: 3 fail-fast: false needs: repair @@ -347,7 +348,7 @@ jobs: arch: ["x64", "x86"] python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] + ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] max-parallel: 1 if: startsWith(github.event.ref, 'refs/tags/v') needs: test From 76b79c48c20ba8d09359a049e88dc4294f1992d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 21 Dec 2023 16:39:05 +0100 Subject: [PATCH 033/210] Update basemap-for-manylinux workflow for Python 3.12 --- .github/workflows/basemap-for-manylinux.yml | 58 ++++++++++++--------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index 2458dd7a6..c3854c554 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -158,38 +158,44 @@ jobs: - name: Build old numpy from source run: | + case "${{ matrix.arch }}" in + x64) arch="x86_64" ;; + x86) arch="i686" ;; + esac case "${{ matrix.python-version }}" in - 2.6|3.[23]) pkgvers=1.11.3;; - 2.7|3.[456789]) pkgvers=1.16.6;; - 3.10) pkgvers=1.21.4;; - 3.11) pkgvers=1.23.3;; - *) pkgvers=1.26.0;; + 2.6|3.[23]) pkgvers=1.11.3; tag=manylinux1 ;; + 2.7|3.[456789]) pkgvers=1.16.6; tag=manylinux1 ;; + 3.10) pkgvers=1.21.4; tag=manylinux1 ;; + 3.11) pkgvers=1.23.3; tag=manylinux_2_17 ;; + *) pkgvers=1.26.0; tag=manylinux_2_28 ;; + esac + case "${{ matrix.python-version }}" in + 3.11|3.12) + # Dirty solution to get NumPy headers for Python 3.11 and 3.12. + kwds="--plat=${tag}_${arch}" + pip download --no-deps ${kwds} "numpy==${pkgvers}" + oldpkgfile=$(ls *.whl | head -n1) + newpkgfile=$(echo "${oldpkgfile}" | sed "s/${tag}/linux/") + mv "${oldpkgfile}" "${newpkgfile}" + pip install "${newpkgfile}" + rm "${newpkgfile}" + ;; + *) + pip install "numpy == ${pkgvers}" + ;; esac - # Dirty solution to get NumPy headers for Python 3.11 and 3.12. - if [ "${{ matrix.python-version }}" = "3.11" -o "${{ matrix.python-version }}" = "3.12" ]; then - case "${{ matrix.arch }}" in - x64) kwds="--plat=manylinux_2_17_x86_64" ;; - x86) kwds="--plat=manylinux_2_17_i686" ;; - esac - pip download --no-deps ${kwds} "numpy==${pkgvers}" - oldpkgfile=$(ls *.whl | head -n1) - newpkgfile=$(echo "${oldpkgfile}" | sed 's/manylinux_2_17/linux/') - mv "${oldpkgfile}" "${newpkgfile}" - pip install "${newpkgfile}" - rm "${newpkgfile}" - else - pip install "numpy == ${pkgvers}" - fi - name: Build wheel run: | sitepkgdir=$(pip show numpy 2>/dev/null | grep Location: | cut -d' ' -f2) export GEOS_DIR="${GITHUB_WORKSPACE}/${{ env.PKGDIR }}/extern" export NUMPY_INCLUDE_PATH=${sitepkgdir}/numpy/core/include - if [ "${{ matrix.python-version }}" = "3.11" -o "${{ matrix.python-version }}" = "3.12" ]; then - kwds="--no-build-isolation" - pip install setuptools wheel "cython >= 0.29, < 3.1" - fi + case "${{ matrix.python-version }}" in + 3.11|3.12) + kwds="--no-build-isolation" + pip install setuptools wheel "cython >= 0.29, < 3.1" + ;; + esac cd ${{ env.PKGDIR }} python setup.py sdist pip wheel -w dist --no-deps ${kwds} dist/*.zip @@ -252,6 +258,10 @@ jobs: ["x64", "x86"] python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + exclude: + # Missing precompiled binaries for `numpy` and `matplotlib`. + - arch: "x86" + python-version: "3.12" max-parallel: 3 fail-fast: false needs: repair From 95a622c535f8be9606f7c3f1aeb69d86513a1109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 21 Dec 2023 17:08:05 +0100 Subject: [PATCH 034/210] Bump build numpy version to 1.26.1 for Python 3.12 --- .github/workflows/basemap-for-manylinux.yml | 2 +- .github/workflows/basemap-for-windows.yml | 2 +- packages/basemap/pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index c3854c554..caf3426ce 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -167,7 +167,7 @@ jobs: 2.7|3.[456789]) pkgvers=1.16.6; tag=manylinux1 ;; 3.10) pkgvers=1.21.4; tag=manylinux1 ;; 3.11) pkgvers=1.23.3; tag=manylinux_2_17 ;; - *) pkgvers=1.26.0; tag=manylinux_2_28 ;; + *) pkgvers=1.26.1; tag=manylinux_2_28 ;; esac case "${{ matrix.python-version }}" in 3.11|3.12) diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml index d3548a708..b1297b1b8 100644 --- a/.github/workflows/basemap-for-windows.yml +++ b/.github/workflows/basemap-for-windows.yml @@ -177,7 +177,7 @@ jobs: "^2\.7|3\.[456789]$" { Set-Variable -Name "pkgvers" -Value "1.16.6" } "^3\.10$" { Set-Variable -Name "pkgvers" -Value "1.21.4" } "^3\.11$" { Set-Variable -Name "pkgvers" -Value "1.23.3" } - default { Set-Variable -Name "pkgvers" -Value "1.26.0" } + default { Set-Variable -Name "pkgvers" -Value "1.26.1" } } $env:SETUPTOOLS_USE_DISTUTILS = "stdlib" python -m pip install "numpy == ${pkgvers}" diff --git a/packages/basemap/pyproject.toml b/packages/basemap/pyproject.toml index 20cc071fd..6a50e2c78 100644 --- a/packages/basemap/pyproject.toml +++ b/packages/basemap/pyproject.toml @@ -2,7 +2,7 @@ requires = [ 'setuptools', 'wheel', - 'numpy == 1.26.0; python_version >= "3.12"', + 'numpy == 1.26.1; python_version >= "3.12"', 'numpy == 1.23.3; python_version == "3.11"', 'numpy == 1.21.4; python_version == "3.10"', 'numpy == 1.21.4; sys_platform == "darwin" and (python_version >= "3.7" and python_version <= "3.9")', From 119f88ad7ec3a23ee5d0b26f031d76b7005026d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 21 Dec 2023 18:01:35 +0100 Subject: [PATCH 035/210] Exclude Python 3.12 manylinux tests due to missing dependencies --- .github/workflows/basemap-for-manylinux.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index caf3426ce..1da48efb9 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -259,7 +259,12 @@ jobs: python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] exclude: - # Missing precompiled binaries for `numpy` and `matplotlib`. + # Missing precompiled binaries for `numpy`, `matplotlib`, `pillow` + # and `lxml`. + - arch: "x64" + python-version: "3.12" + # Missing precompiled binaries for `numpy`, `matplotlib`, `pyproj`, + # `pillow` and `lxml`. - arch: "x86" python-version: "3.12" max-parallel: 3 From 9a1145452667dd7a78e01cce116d812fd56f1e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 21 Dec 2023 22:11:39 +0100 Subject: [PATCH 036/210] Update CHANGELOG with Python 3.12 support --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e7aae28b..b3d08e9dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ https://semver.org/spec/v2.0.0.html ## [Unreleased] ### Added +- Support for Python 3.12. - Optional argument `encoding_errors` for `Basemap.readshapefile` method (PR [#554] by @guziy, implements request [#552]). - Optional argument `cachedir` for `Basemap.arcgisimage` method to allow From d85cff4c6fbc295ad31c486735867f833aec5730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 21 Dec 2023 22:17:37 +0100 Subject: [PATCH 037/210] Update CHANGELOG with Cython compatibility fixes --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3d08e9dd..40503319f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,8 @@ https://semver.org/spec/v2.0.0.html precompiled Windows wheels (PR [#565]). - Fix `_geoslib.pyx` compilation with Cython 3.0+ using the compiler directive "legacy_implicit_noexcept" (PR [#593] by @musicinmybrain). +- Fix `_geoslib.pyx` syntax to comply with newer compilers such as + Clang 16 and GCC 14 (PR [#595] by @fweimer-rh). ### Removed - Attribute `__version__` in `mpl_toolkits.basemap.proj` module. @@ -1058,6 +1060,8 @@ https://semver.org/spec/v2.0.0.html - Fix glitches in drawing of parallels and meridians. +[#595]: +https://github.com/matplotlib/basemap/pull/595 [#593]: https://github.com/matplotlib/basemap/pull/593 [#592]: From fdd8f50dc52c01c90a4dfa064dda7962697717f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 25 Dec 2023 22:24:33 +0100 Subject: [PATCH 038/210] Fix unhandled GeometryCollection in BaseGeometry.intersection Solves issue #566. --- packages/basemap/src/_geoslib.pyx | 24 +++++++++++ .../test/mpl_toolkits/basemap/test_Basemap.py | 41 +++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/packages/basemap/src/_geoslib.pyx b/packages/basemap/src/_geoslib.pyx index d92071b63..0ecab80cf 100644 --- a/packages/basemap/src/_geoslib.pyx +++ b/packages/basemap/src/_geoslib.pyx @@ -318,6 +318,30 @@ cdef class BaseGeometry: b = _get_coords(gout) p = LineString(b) pout.append(p) + elif typeid == GEOS_GEOMETRYCOLLECTION: + numgeoms = GEOSGetNumGeometries(g3) + pout = [] + for i from 0 <= i < numgeoms: + gout = GEOSGetGeometryN(g3, i) + typeid = GEOSGeomTypeId(gout) + if typeid == GEOS_POLYGON: + b = _get_coords(gout) + p = Polygon(b) + pout.append(p) + elif typeid == GEOS_LINESTRING: + b = _get_coords(gout) + p = LineString(b) + pout.append(p) + else: + # More cases might need to be handled here: + # - GEOS_MULTILINESTRING + # - GEOS_MULTIPOLYGON + # - GEOS_GEOMETRYCOLLECTION + # The underlying problem is the need of a generic + # converter from GEOSGeom pointers to `_geoslib` + # objects, since postprocessing `GeometryCollections` + # might need recursiveness. + pass else: #type = PyBytes_FromString(GEOSGeomType(g3)) #raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) diff --git a/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py b/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py index 9861a3383..e614d982a 100644 --- a/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py +++ b/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py @@ -8,6 +8,7 @@ import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt +from matplotlib.collections import LineCollection from matplotlib.image import AxesImage from matplotlib.patches import Polygon from mpl_toolkits.basemap import Basemap @@ -85,6 +86,46 @@ def test_init_with_optional_casting(self): bmap2 = Basemap(lat_1=bmap2_lat_1, **kwds) self.assertEqual(bmap1.proj4string, bmap2.proj4string) + def test_drawcoastlines(self, axs=None, axslen0=10): + """Test that no lines are missing when drawing coastlines.""" + + axs_obj = plt.gca() if axs is None else axs + axs_children = axs_obj.get_children() + self.assertEqual(len(axs_children), axslen0) + + bmap = Basemap(projection="merc", resolution="i", lat_ts=20, + llcrnrlat=36.0, llcrnrlon=6.0, + urcrnrlat=47.7, urcrnrlon=19.0) + + collection = bmap.drawcoastlines(linewidth=1, color="red") + self.assertIsInstance(collection, LineCollection) + + axs_children = axs_obj.get_children() + self.assertEqual(len(axs_children), axslen0 + 1) + + lines = collection.get_paths() + self.assertEqual(len(lines), 27) + + def test_drawcountries(self, axs=None, axslen0=10): + """Test that no lines are missing when drawing country boundaries.""" + + axs_obj = plt.gca() if axs is None else axs + axs_children = axs_obj.get_children() + self.assertEqual(len(axs_children), axslen0) + + bmap = Basemap(projection="merc", resolution="i", lat_ts=20, + llcrnrlat=36.0, llcrnrlon=6.0, + urcrnrlat=47.7, urcrnrlon=19.0) + + collection = bmap.drawcountries(linewidth=1, color="blue") + self.assertIsInstance(collection, LineCollection) + + axs_children = axs_obj.get_children() + self.assertEqual(len(axs_children), axslen0 + 1) + + lines = collection.get_paths() + self.assertEqual(len(lines), 29) + @unittest.skipIf(PIL is None, reason="pillow unavailable") def test_arcgisimage_with_cyl(self, axs=None, axslen0=10): """Test showing an ArcGIS image as background.""" From 8f5bca13c000820c8a247cd946b214dfcede8d37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 26 Dec 2023 02:25:48 +0100 Subject: [PATCH 039/210] Backport fix for country borders disappearing --- CHANGELOG.md | 22 ++++++++++++++-------- packages/basemap/src/_geoslib.pyx | 24 ++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0cbac906..a320bea8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,19 +16,23 @@ https://semver.org/spec/v2.0.0.html - Fix `GeosLibrary` wrapper to also work with CMake >= 3.27.0 and Python 2.7 on Windows by adding '/MANIFEST:NO' to override the new default '/MANIFEST:EMBED,ID=2' provided to linker. -- Fix references to removed `numpy.float` alias (solves issue [#589], - thanks to @quickbrett). -- Fix bug with elliptical maps causing warped images (Blue Marble, - ETOPO, Shaded Relief) to be shown behind the map background when the - map boundary is not initialised manually (solves issue [#577], thanks - to @YilongWang). +- Fix broken `Proj.__call__` when the input arguments are provided as + a combined single array. - Fix flipped coastlines with pseudocylindrical projections when `lon_0` is greater than 0 deg (solves issues [#443] and [#463], thanks to @YilongWang). -- Fix broken `Proj.__call__` when the input arguments are provided as - a combined single array. - Fix `antialiased` argument being ignored in `Basemap.drawcounties` and `Basemap.readshapefile` (solves issue [#501], thanks to @TheFizzWare). +- Fix `BaseGeometry.intersection` in `_geoslib` so that it also works + with `GEOS_GEOMETRYCOLLECTION` objects returned by `GEOSIntersection` + (solves issue [#566], where country boundaries are missing due to this + bug, thanks to @guidocioni). +- Fix bug with elliptical maps causing warped images (Blue Marble, + ETOPO, Shaded Relief) to be shown behind the map background when the + map boundary is not initialised manually (solves issue [#577], thanks + to @YilongWang). +- Fix references to removed `numpy.float` alias (solves issue [#589], + thanks to @quickbrett). - Fix wrong reference to `ireland.py` example in FAQ, which should be `hires.py` instead, and fix wrong use of locals and invalid syntax in this example (solves issue [#592], thanks to @timcoote). @@ -1017,6 +1021,8 @@ https://github.com/matplotlib/basemap/issues/579 https://github.com/matplotlib/basemap/issues/577 [#573]: https://github.com/matplotlib/basemap/issues/573 +[#566]: +https://github.com/matplotlib/basemap/issues/566 [#564]: https://github.com/matplotlib/basemap/pull/564 [#563]: diff --git a/packages/basemap/src/_geoslib.pyx b/packages/basemap/src/_geoslib.pyx index 7ef440b4c..a6d819a0e 100644 --- a/packages/basemap/src/_geoslib.pyx +++ b/packages/basemap/src/_geoslib.pyx @@ -307,6 +307,30 @@ cdef class BaseGeometry: b = _get_coords(gout) p = LineString(b) pout.append(p) + elif typeid == GEOS_GEOMETRYCOLLECTION: + numgeoms = GEOSGetNumGeometries(g3) + pout = [] + for i from 0 <= i < numgeoms: + gout = GEOSGetGeometryN(g3, i) + typeid = GEOSGeomTypeId(gout) + if typeid == GEOS_POLYGON: + b = _get_coords(gout) + p = Polygon(b) + pout.append(p) + elif typeid == GEOS_LINESTRING: + b = _get_coords(gout) + p = LineString(b) + pout.append(p) + else: + # More cases might need to be handled here: + # - GEOS_MULTILINESTRING + # - GEOS_MULTIPOLYGON + # - GEOS_GEOMETRYCOLLECTION + # The underlying problem is the need of a generic + # converter from GEOSGeom pointers to `_geoslib` + # objects, since postprocessing `GeometryCollections` + # might need recursiveness. + pass else: #type = PyBytes_FromString(GEOSGeomType(g3)) #raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) From 86a0eb3208225b7435ec7b82cd369160dbe167dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 26 Dec 2023 12:44:45 +0100 Subject: [PATCH 040/210] Set release date for 1.3.9 in CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a320bea8d..0f8acf943 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ https://keepachangelog.com/en/1.0.0/ https://semver.org/spec/v2.0.0.html -## [1.3.9] +## [1.3.9] - 2023-12-26 ### Fixed - Fix `GeosLibrary` wrapper to also work with CMake >= 3.27.0 and From 849979b0cef31e7638bfded74e965f83da68e223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 26 Dec 2023 15:09:38 +0100 Subject: [PATCH 041/210] Remove basemap-for-manylinux workaround for CA certificates --- .github/workflows/basemap-for-manylinux.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index 1da48efb9..622e40a4c 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -302,13 +302,6 @@ jobs: run: | whlpath=$(ls ${{ env.PKGDIR }}/dist/*-manylinux1*.whl | head -n1) pip install "${whlpath}[owslib,pillow]" - - - name: Fix CA certificates location - run: | - sslvers=$(python -c 'import ssl; print(".".join(map(str, ssl._OPENSSL_API_VERSION[:3])))') - sslfold=/opt/openssl-${sslvers}/ssl - mkdir -p "${sslfold}" - cp "/etc/ssl/cert.pem" "${sslfold}/cert.pem" - name: Test package run: | From 33858f495651a1be3256bb88e79694da59595a55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 26 Dec 2023 15:10:35 +0100 Subject: [PATCH 042/210] Fix comment in basemap-for-manylinux workflow --- .github/workflows/basemap-for-manylinux.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index 622e40a4c..5516a425f 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -259,8 +259,7 @@ jobs: python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] exclude: - # Missing precompiled binaries for `numpy`, `matplotlib`, `pillow` - # and `lxml`. + # Missing precompiled binaries for `lxml`. - arch: "x64" python-version: "3.12" # Missing precompiled binaries for `numpy`, `matplotlib`, `pyproj`, From ec7c8023cbd94df0771d584f1bb65b208430aef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 29 Dec 2023 12:22:59 +0100 Subject: [PATCH 043/210] Update copyright years in GeosLibrary helper class --- packages/basemap/utils/GeosLibrary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/basemap/utils/GeosLibrary.py b/packages/basemap/utils/GeosLibrary.py index 24bdff3b0..e48b3aa3b 100644 --- a/packages/basemap/utils/GeosLibrary.py +++ b/packages/basemap/utils/GeosLibrary.py @@ -1,7 +1,7 @@ #! /usr/bin/env python # -*- coding: utf-8 -*- # -# Copyright (c) 2021 Víctor Molina García +# Copyright (c) 2021-2023 Víctor Molina García # GeosLibrary.py is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published From 7ebb3b190cd25b0d78095ee67ffb7d4b9b7f2a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 4 Jan 2024 16:29:58 +0100 Subject: [PATCH 044/210] Fix malformed tables in docstrings --- .../src/mpl_toolkits/basemap/__init__.py | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index 5714864f2..d88c13f71 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -2070,9 +2070,9 @@ def readshapefile(self,shapefile,name,drawbounds=True,zorder=None, .. tabularcolumns:: |l|L| - ============== ==================================================== + ================ ==================================================== Argument Description - ============== ==================================================== + ================ ==================================================== shapefile path to shapefile components. Example: shapefile='/home/jeff/esri/world_borders' assumes that world_borders.shp, world_borders.shx and @@ -2090,7 +2090,7 @@ def readshapefile(self,shapefile,name,drawbounds=True,zorder=None, shapes are split out into separate polygons, and additional keys 'RINGNUM' and 'SHAPENUM' are added to the shape attribute dictionary. - ============== ==================================================== + ================ ==================================================== The following optional keyword arguments are only relevant for Polyline and Polygon shape types, for Point and MultiPoint shapes they are @@ -2098,9 +2098,9 @@ def readshapefile(self,shapefile,name,drawbounds=True,zorder=None, .. tabularcolumns:: |l|L| - ============== ==================================================== + ================ ===================================================== Keyword Description - ============== ==================================================== + ================ ===================================================== drawbounds draw boundaries of shapes (default True). zorder shape boundary zorder (if not specified, default for mathplotlib.lines.LineCollection @@ -2114,7 +2114,7 @@ def readshapefile(self,shapefile,name,drawbounds=True,zorder=None, (default utf-8) encoding_errors encoding error handling (default strict), other possible values: ignore, replace and backslashreplace - ============== ==================================================== + ================ ===================================================== A tuple (num_shapes, type, min, max) containing shape file info is returned. @@ -4785,17 +4785,17 @@ def shiftdata(self,lonsin,datain=None,lon_0=None,fix_wrap_around=True): .. tabularcolumns:: |l|L| - ============== ==================================================== + ================ ====================================================== Arguments Description - ============== ==================================================== + ================ ====================================================== lonsin original 1-d or 2-d longitudes. - ============== ==================================================== + ================ ====================================================== .. tabularcolumns:: |l|L| - ============== ==================================================== + ================ ====================================================== Keywords Description - ============== ==================================================== + ================ ====================================================== datain original 1-d or 2-d data. Default None. lon_0 center of map projection region. Defaut None, given by current map projection. @@ -4806,7 +4806,7 @@ def shiftdata(self,lonsin,datain=None,lon_0=None,fix_wrap_around=True): If False do not reindex longitudes and data, but do make sure that longitudes are in the [lon_0-180, lon_0+180] range. - ============== ==================================================== + ================ ====================================================== if datain given, returns ``dataout,lonsout`` (data and longitudes shifted to fit in interval [lon_0-180,lon_0+180]), otherwise just returns longitudes. If From 135260ab911bb6ab67c7fd3899a5d6ed8d017588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 4 Jan 2024 16:55:02 +0100 Subject: [PATCH 045/210] Fix outdated use of axisbg in docs --- packages/basemap/doc/source/users/figures/geos_partial.py | 6 +++++- packages/basemap/doc/source/users/figures/nsper_partial.py | 6 +++++- packages/basemap/doc/source/users/figures/ortho_partial.py | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/basemap/doc/source/users/figures/geos_partial.py b/packages/basemap/doc/source/users/figures/geos_partial.py index 3d7329073..f304648ab 100644 --- a/packages/basemap/doc/source/users/figures/geos_partial.py +++ b/packages/basemap/doc/source/users/figures/geos_partial.py @@ -1,13 +1,17 @@ from mpl_toolkits.basemap import Basemap import numpy as np +import matplotlib as mpl import matplotlib.pyplot as plt +mpl_version = tuple(map(int, mpl.__version__.split("."))) +axkwds = {"axisbg" if mpl_version < (2,) else "facecolor": "k"} + fig = plt.figure() # global geostationary map centered on lon_0 lon_0=57. # resolution = None means don't process the boundary datasets. m1 = Basemap(projection='geos',lon_0=lon_0,resolution=None) # add an axes with a black background -ax = fig.add_axes([0.1,0.1,0.8,0.8],axisbg='k') +ax = fig.add_axes([0.1,0.1,0.8,0.8], **axkwds) # plot just upper right quadrant (corners determined from global map). # keywords llcrnrx,llcrnry,urcrnrx,urcrnry used to define the lower # left and upper right corners in map projection coordinates. diff --git a/packages/basemap/doc/source/users/figures/nsper_partial.py b/packages/basemap/doc/source/users/figures/nsper_partial.py index 89795398b..0e9762169 100644 --- a/packages/basemap/doc/source/users/figures/nsper_partial.py +++ b/packages/basemap/doc/source/users/figures/nsper_partial.py @@ -1,6 +1,10 @@ from mpl_toolkits.basemap import Basemap import numpy as np +import matplotlib as mpl import matplotlib.pyplot as plt +mpl_version = tuple(map(int, mpl.__version__.split("."))) +axkwds = {"axisbg" if mpl_version < (2,) else "facecolor": "k"} + fig = plt.figure() # global ortho map centered on lon_0,lat_0 lat_0=10.; lon_0=57. @@ -10,7 +14,7 @@ m1 = Basemap(projection='nsper',satellite_height=h*1000.,\ lon_0=lon_0,lat_0=lat_0,resolution=None) # add an axes with a black background -ax = fig.add_axes([0.1,0.1,0.8,0.8],axisbg='k') +ax = fig.add_axes([0.1,0.1,0.8,0.8], **axkwds) # plot just upper right quadrant (corners determined from global map). # keywords llcrnrx,llcrnry,urcrnrx,urcrnry used to define the lower # left and upper right corners in map projection coordinates. diff --git a/packages/basemap/doc/source/users/figures/ortho_partial.py b/packages/basemap/doc/source/users/figures/ortho_partial.py index e1adc9c01..c41656311 100644 --- a/packages/basemap/doc/source/users/figures/ortho_partial.py +++ b/packages/basemap/doc/source/users/figures/ortho_partial.py @@ -1,13 +1,17 @@ from mpl_toolkits.basemap import Basemap import numpy as np +import matplotlib as mpl import matplotlib.pyplot as plt +mpl_version = tuple(map(int, mpl.__version__.split("."))) +axkwds = {"axisbg" if mpl_version < (2,) else "facecolor": "k"} + fig = plt.figure() # global ortho map centered on lon_0,lat_0 lat_0=10.; lon_0=57. # resolution = None means don't process the boundary datasets. m1 = Basemap(projection='ortho',lon_0=lon_0,lat_0=lat_0,resolution=None) # add an axes with a black background -ax = fig.add_axes([0.1,0.1,0.8,0.8],axisbg='k') +ax = fig.add_axes([0.1,0.1,0.8,0.8], **axkwds) # plot just upper right quadrant (corners determined from global map). # keywords llcrnrx,llcrnry,urcrnrx,urcrnry used to define the lower # left and upper right corners in map projection coordinates. From af4a95f407594ae3b8dad29efb09d063a114a1a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 4 Jan 2024 17:08:19 +0100 Subject: [PATCH 046/210] Fix invalid leading zeros in docs --- packages/basemap/doc/source/users/figures/plotwindvec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/basemap/doc/source/users/figures/plotwindvec.py b/packages/basemap/doc/source/users/figures/plotwindvec.py index de0797617..faffb91b1 100644 --- a/packages/basemap/doc/source/users/figures/plotwindvec.py +++ b/packages/basemap/doc/source/users/figures/plotwindvec.py @@ -4,7 +4,7 @@ from mpl_toolkits.basemap import Basemap, shiftgrid from netCDF4 import Dataset # specify date to plot. -yyyy=1993; mm=03; dd=14; hh=00 +yyyy=1993; mm=3; dd=14; hh=0 date = datetime.datetime(yyyy,mm,dd,hh) # set OpenDAP server URL. URLbase="http://nomads.ncdc.noaa.gov/thredds/dodsC/modeldata/cmd_pgbh/" From 828fb4136832895f9e70599941e5303ae86b365d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 4 Jan 2024 20:45:13 +0100 Subject: [PATCH 047/210] Fix some invalid relative paths in docs --- packages/basemap/doc/source/users/figures/hurrtracks.py | 6 ++++-- packages/basemap/doc/source/users/figures/plotprecip.py | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/basemap/doc/source/users/figures/hurrtracks.py b/packages/basemap/doc/source/users/figures/hurrtracks.py index 2c09020c6..1d1674c83 100644 --- a/packages/basemap/doc/source/users/figures/hurrtracks.py +++ b/packages/basemap/doc/source/users/figures/hurrtracks.py @@ -3,15 +3,17 @@ part of the track for which storm is cat 4 or 5 is shown red. ESRI shapefile data from http://nationalatlas.gov/mld/huralll.html """ +import os import numpy as np import matplotlib.pyplot as plt -from mpl_toolkits.basemap import Basemap +from mpl_toolkits.basemap import Basemap # Lambert Conformal Conic map. m = Basemap(llcrnrlon=-100.,llcrnrlat=0.,urcrnrlon=-20.,urcrnrlat=57., projection='lcc',lat_1=20.,lat_2=40.,lon_0=-60., resolution ='l',area_thresh=1000.) # read shapefile. -shp_info = m.readshapefile('../../../examples/huralll020','hurrtracks',drawbounds=False) +shp_path = os.path.join(*6 * [".."] + ["examples", "huralll020"]) +shp_info = m.readshapefile(shp_path,'hurrtracks',drawbounds=False) # find names of storms that reached Cat 4. names = [] for shapedict in m.hurrtracks_info: diff --git a/packages/basemap/doc/source/users/figures/plotprecip.py b/packages/basemap/doc/source/users/figures/plotprecip.py index 8a33afa0f..95fd7ef67 100644 --- a/packages/basemap/doc/source/users/figures/plotprecip.py +++ b/packages/basemap/doc/source/users/figures/plotprecip.py @@ -1,13 +1,15 @@ from mpl_toolkits.basemap import Basemap, cm # requires netcdf4-python (netcdf4-python.googlecode.com) from netCDF4 import Dataset as NetCDFFile +import os import numpy as np import matplotlib.pyplot as plt # plot rainfall from NWS using special precipitation # colormap used by the NWS, and included in basemap. -nc = NetCDFFile('../../../examples/nws_precip_conus_20061222.nc') +ncpath = os.path.join(*6 * [".."] + ["examples", "nws_precip_conus_20061222.nc"]) +nc = NetCDFFile(ncpath) # data from http://water.weather.gov/precip/ prcpvar = nc.variables['amountofprecip'] data = 0.01*prcpvar[:] From c5f31ce846a38975edcaf7b69e87efa3b737fa8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 4 Jan 2024 20:57:56 +0100 Subject: [PATCH 048/210] Add scipy as explicit doc dependency --- CHANGELOG.md | 1 + packages/basemap/requirements-doc.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1f9a4403..e196dfca5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ https://semver.org/spec/v2.0.0.html - Upgrade upper limit for `furo` to 2023.9.11. - Move dependency on `netCDF4` to `requirements-doc.txt`. - Set dependency on `cftime` explicitly in `requirements-doc.txt`. + - Set dependency on `scipy` explicitly in `requirements-doc.txt`. - Update lint dependencies: - Downgrade upper limit for `flake8` to 6.2. - Upgrade upper limit for `astropy` to 3.1. diff --git a/packages/basemap/requirements-doc.txt b/packages/basemap/requirements-doc.txt index 353713310..229abc2ac 100644 --- a/packages/basemap/requirements-doc.txt +++ b/packages/basemap/requirements-doc.txt @@ -1,5 +1,6 @@ sphinx >= 5.3, < 7.2; python_version >= "3.8" furo >= 2022.4.7, < 2023.9.11; python_version >= "3.8" +scipy >= 1.2, < 1.12; python_version >= "3.5" netCDF4 >= 1.5.6, < 1.7.0; python_version >= "3.6" cftime >= 1.4.0, < 1.7.0; python_version >= "3.6" From c9cec5044b15076d06ac3b8c6c6bcca55cb9cea3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 5 Jan 2024 00:13:27 +0100 Subject: [PATCH 049/210] Fix URL for plothighsandlows.py --- .../basemap/doc/source/users/figures/plothighsandlows.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/basemap/doc/source/users/figures/plothighsandlows.py b/packages/basemap/doc/source/users/figures/plothighsandlows.py index cf93f2c9c..3a7c3f963 100644 --- a/packages/basemap/doc/source/users/figures/plothighsandlows.py +++ b/packages/basemap/doc/source/users/figures/plothighsandlows.py @@ -23,13 +23,10 @@ def extrema(mat,mode='wrap',window=10): date = datetime.now().strftime('%Y%m%d')+'00' # open OpenDAP dataset. -#data=Dataset("http://nomads.ncep.noaa.gov:9090/dods/gfs/gfs/%s/gfs_%sz_anl" %\ -# (date[0:8],date[8:10])) -data=Dataset("http://nomads.ncep.noaa.gov:9090/dods/gfs_hd/gfs_hd%s/gfs_hd_%sz"%\ +data=Dataset("https://nomads.ncep.noaa.gov/dods/gfs_0p50/gfs%s/gfs_0p50_%sz"%\ (date[0:8],date[8:10])) - # read lats,lons. lats = data.variables['lat'][:] lons1 = data.variables['lon'][:] From 518c7addf0bfa1a9abdb09229f2cfff5f5d48cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 5 Jan 2024 00:15:05 +0100 Subject: [PATCH 050/210] Fix outdated use of urllib.urlretrieve --- packages/basemap/doc/source/users/figures/plotargo.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/basemap/doc/source/users/figures/plotargo.py b/packages/basemap/doc/source/users/figures/plotargo.py index 6c8fa05f0..17222b729 100644 --- a/packages/basemap/doc/source/users/figures/plotargo.py +++ b/packages/basemap/doc/source/users/figures/plotargo.py @@ -2,10 +2,14 @@ import time, calendar, datetime, numpy from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt -import urllib, os +import os +try: + from urllib.request import urlretrieve +except ImportError: + from urllib import urlretrieve # data downloaded from the form at -# http://coastwatch.pfeg.noaa.gov/erddap/tabledap/apdrcArgoAll.html -filename, headers = urllib.urlretrieve('http://coastwatch.pfeg.noaa.gov/erddap/tabledap/apdrcArgoAll.nc?longitude,latitude,time&longitude>=0&longitude<=360&latitude>=-90&latitude<=90&time>=2010-01-01&time<=2010-01-08&distinct()') +# http://coastwatch.pfeg.noaa.gov/erddap/tabledap/apdrcArgoAll.html +filename, headers = urlretrieve('http://coastwatch.pfeg.noaa.gov/erddap/tabledap/apdrcArgoAll.nc?longitude,latitude,time&longitude>=0&longitude<=360&latitude>=-90&latitude<=90&time>=2010-01-01&time<=2010-01-08&distinct()') dset = Dataset(filename) lats = dset.variables['latitude'][:] lons = dset.variables['longitude'][:] From 616e66c3087c8e0a55badd1a2e9dec8e88bfeb8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 5 Jan 2024 00:18:29 +0100 Subject: [PATCH 051/210] Fix URL and coordinate grid in plotsst.py --- packages/basemap/doc/source/users/figures/plotsst.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/basemap/doc/source/users/figures/plotsst.py b/packages/basemap/doc/source/users/figures/plotsst.py index 485e6ffd2..ead54ab0a 100644 --- a/packages/basemap/doc/source/users/figures/plotsst.py +++ b/packages/basemap/doc/source/users/figures/plotsst.py @@ -5,18 +5,23 @@ from datetime import datetime date = datetime(2007,12,15,0) # date to plot. # open dataset. -dataset = \ -Dataset('http://www.ncdc.noaa.gov/thredds/dodsC/OISST-V2-AVHRR_agg') +dataset = Dataset("https://psl.noaa.gov/thredds/dodsC/Datasets/noaa.oisst.v2.highres/sst.day.mean.{0}.nc".format(date.year)) timevar = dataset.variables['time'] timeindex = date2index(date,timevar) # find time index for desired date. # read sst. Will automatically create a masked array using # missing_value variable attribute. 'squeeze out' singleton dimensions. sst = dataset.variables['sst'][timeindex,:].squeeze() # read ice. -ice = dataset.variables['ice'][timeindex,:].squeeze() +dataset.close() +dataset = Dataset("https://psl.noaa.gov/thredds/dodsC/Datasets/noaa.oisst.v2.highres/icec.day.mean.{0}.nc".format(date.year)) +ice = dataset.variables['icec'][timeindex,:].squeeze() # read lats and lons (representing centers of grid boxes). lats = dataset.variables['lat'][:] lons = dataset.variables['lon'][:] +dataset.close() +latstep, lonstep = np.diff(lats[:2]), np.diff(lons[:2]) +lats = np.append(lats - 0.5 * latstep, lats[-1] + 0.5 * latstep) +lons = np.append(lons - 0.5 * lonstep, lons[-1] + 0.5 * lonstep) lons, lats = np.meshgrid(lons,lats) # create figure, axes instances. fig = plt.figure() From 080e5e6fe899c697a63ee400a863785ee733e4e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 5 Jan 2024 00:33:50 +0100 Subject: [PATCH 052/210] Add rsphere tuple as workaround for the geostationary examples See GitHub issue #361. --- packages/basemap/doc/source/users/figures/geos_full.py | 2 +- packages/basemap/doc/source/users/figures/geos_partial.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/basemap/doc/source/users/figures/geos_full.py b/packages/basemap/doc/source/users/figures/geos_full.py index 1ccf6cfba..7afe27a4d 100644 --- a/packages/basemap/doc/source/users/figures/geos_full.py +++ b/packages/basemap/doc/source/users/figures/geos_full.py @@ -5,7 +5,7 @@ # resolution = 'l' means use low resolution coastlines. # optional parameter 'satellite_height' may be used to # specify height of orbit above earth (default 35,786 km). -m = Basemap(projection='geos',lon_0=-105,resolution='l') +m = Basemap(projection='geos',lon_0=-105,resolution='l',rsphere=(6378137.00,6356752.3142)) m.drawcoastlines() m.fillcontinents(color='coral',lake_color='aqua') # draw parallels and meridians. diff --git a/packages/basemap/doc/source/users/figures/geos_partial.py b/packages/basemap/doc/source/users/figures/geos_partial.py index f304648ab..c3c6ad9cf 100644 --- a/packages/basemap/doc/source/users/figures/geos_partial.py +++ b/packages/basemap/doc/source/users/figures/geos_partial.py @@ -18,7 +18,8 @@ # llcrnrlat,llcrnrlon,urcrnrlon,urcrnrlat could be used to define # lat/lon values of corners - but this won't work in cases such as this # where one of the corners does not lie on the earth. -m = Basemap(projection='geos',lon_0=lon_0,resolution='l',\ +m = Basemap(projection='geos',lon_0=lon_0,resolution='l', + rsphere=(6378137.00,6356752.3142), llcrnrx=0.,llcrnry=0.,urcrnrx=m1.urcrnrx/2.,urcrnry=m1.urcrnry/2.) m.drawcoastlines() m.drawmapboundary(fill_color='aqua') From 345cee724b01a446e967f8e8b9e2683fbb07087d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 5 Jan 2024 13:28:20 +0100 Subject: [PATCH 053/210] Fix URL and data variables in plotwindvec.py --- packages/basemap/doc/source/users/figures/plotwindvec.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/basemap/doc/source/users/figures/plotwindvec.py b/packages/basemap/doc/source/users/figures/plotwindvec.py index faffb91b1..ca0eb1f28 100644 --- a/packages/basemap/doc/source/users/figures/plotwindvec.py +++ b/packages/basemap/doc/source/users/figures/plotwindvec.py @@ -7,7 +7,7 @@ yyyy=1993; mm=3; dd=14; hh=0 date = datetime.datetime(yyyy,mm,dd,hh) # set OpenDAP server URL. -URLbase="http://nomads.ncdc.noaa.gov/thredds/dodsC/modeldata/cmd_pgbh/" +URLbase="https://www.ncei.noaa.gov/thredds/dodsC/model-cfs_reanl_6h_pgb/" URL=URLbase+"%04i/%04i%02i/%04i%02i%02i/pgbh00.gdas.%04i%02i%02i%02i.grb2" %\ (yyyy,yyyy,mm,yyyy,mm,dd,yyyy,mm,dd,hh) data = Dataset(URL) @@ -18,8 +18,8 @@ # get sea level pressure and 10-m wind data. # mult slp by 0.01 to put in units of hPa. slpin = 0.01*data.variables['Pressure_msl'][:].squeeze() -uin = data.variables['U-component_of_wind_height_above_ground'][:].squeeze() -vin = data.variables['V-component_of_wind_height_above_ground'][:].squeeze() +uin = data.variables['u-component_of_wind_height_above_ground'][:].squeeze() +vin = data.variables['v-component_of_wind_height_above_ground'][:].squeeze() # add cyclic points manually (could use addcyclic function) slp = np.zeros((slpin.shape[0],slpin.shape[1]+1),np.float64) slp[:,0:-1] = slpin[::-1]; slp[:,-1] = slpin[::-1,0] From a62e367b0c5203f7b566f539aeb4937c18a7fbeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 5 Jan 2024 14:33:15 +0100 Subject: [PATCH 054/210] Update plotsst.py to use direct download links --- packages/basemap/doc/source/users/figures/plotsst.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/basemap/doc/source/users/figures/plotsst.py b/packages/basemap/doc/source/users/figures/plotsst.py index ead54ab0a..a8652c34d 100644 --- a/packages/basemap/doc/source/users/figures/plotsst.py +++ b/packages/basemap/doc/source/users/figures/plotsst.py @@ -3,9 +3,14 @@ import numpy as np import matplotlib.pyplot as plt from datetime import datetime +try: + from urllib.request import urlretrieve +except ImportError: + from urllib import urlretrieve date = datetime(2007,12,15,0) # date to plot. # open dataset. -dataset = Dataset("https://psl.noaa.gov/thredds/dodsC/Datasets/noaa.oisst.v2.highres/sst.day.mean.{0}.nc".format(date.year)) +sstpath, sstheader = urlretrieve("https://downloads.psl.noaa.gov/Datasets/noaa.oisst.v2.highres/sst.day.mean.{0}.nc".format(date.year)) +dataset = Dataset(sstpath) timevar = dataset.variables['time'] timeindex = date2index(date,timevar) # find time index for desired date. # read sst. Will automatically create a masked array using @@ -13,7 +18,8 @@ sst = dataset.variables['sst'][timeindex,:].squeeze() # read ice. dataset.close() -dataset = Dataset("https://psl.noaa.gov/thredds/dodsC/Datasets/noaa.oisst.v2.highres/icec.day.mean.{0}.nc".format(date.year)) +icepath, iceheader = urlretrieve("https://downloads.psl.noaa.gov/Datasets/noaa.oisst.v2.highres/icec.day.mean.{0}.nc".format(date.year)) +dataset = Dataset(icepath) ice = dataset.variables['icec'][timeindex,:].squeeze() # read lats and lons (representing centers of grid boxes). lats = dataset.variables['lat'][:] From 58575816e31a2d632dfda92eb6bfedb04e441ebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 5 Jan 2024 14:33:37 +0100 Subject: [PATCH 055/210] Fix URL for plotargo.py example --- packages/basemap/doc/source/users/figures/plotargo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/basemap/doc/source/users/figures/plotargo.py b/packages/basemap/doc/source/users/figures/plotargo.py index 17222b729..8209b7118 100644 --- a/packages/basemap/doc/source/users/figures/plotargo.py +++ b/packages/basemap/doc/source/users/figures/plotargo.py @@ -9,11 +9,11 @@ from urllib import urlretrieve # data downloaded from the form at # http://coastwatch.pfeg.noaa.gov/erddap/tabledap/apdrcArgoAll.html -filename, headers = urlretrieve('http://coastwatch.pfeg.noaa.gov/erddap/tabledap/apdrcArgoAll.nc?longitude,latitude,time&longitude>=0&longitude<=360&latitude>=-90&latitude<=90&time>=2010-01-01&time<=2010-01-08&distinct()') +filename, headers = urlretrieve("https://erddap.ifremer.fr/erddap/tabledap/ArgoFloats-index.nc?date%2Clatitude%2Clongitude&date%3E=2010-01-01&date%3C=2010-01-08&latitude%3E=-90&latitude%3C=90&longitude%3E=-180&longitude%3C=180&distinct()") dset = Dataset(filename) lats = dset.variables['latitude'][:] lons = dset.variables['longitude'][:] -time = dset.variables['time'] +time = dset.variables['date'] # seconds since epoch times = time[:] t1 = times.min(); t2 = times.max() date1 = num2date(t1, units=time.units) From 82502d706cb9f6f4eb0b5c62d23db96dbacd7c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 5 Jan 2024 14:57:58 +0100 Subject: [PATCH 056/210] Remove unused animated kwarg in contour calls --- packages/basemap/doc/source/users/figures/plotwindvec.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/basemap/doc/source/users/figures/plotwindvec.py b/packages/basemap/doc/source/users/figures/plotwindvec.py index ca0eb1f28..0c542bca3 100644 --- a/packages/basemap/doc/source/users/figures/plotwindvec.py +++ b/packages/basemap/doc/source/users/figures/plotwindvec.py @@ -43,8 +43,8 @@ parallels = np.arange(-80.,90,20.) meridians = np.arange(0.,360.,20.) # plot SLP contours. -CS1 = m.contour(x,y,slp,clevs,linewidths=0.5,colors='k',animated=True) -CS2 = m.contourf(x,y,slp,clevs,cmap=plt.cm.RdBu_r,animated=True) +CS1 = m.contour(x,y,slp,clevs,linewidths=0.5,colors='k') +CS2 = m.contourf(x,y,slp,clevs,cmap=plt.cm.RdBu_r) # plot wind vectors on projection grid. # first, shift grid so it goes from -180 to 180 (instead of 0 to 360 # in longitude). Otherwise, interpolation is messed up. @@ -72,8 +72,8 @@ fig2 = plt.figure(figsize=(8,10)) ax = fig2.add_axes([0.1,0.1,0.8,0.8]) # plot SLP contours -CS1 = m.contour(x,y,slp,clevs,linewidths=0.5,colors='k',animated=True) -CS2 = m.contourf(x,y,slp,clevs,cmap=plt.cm.RdBu_r,animated=True) +CS1 = m.contour(x,y,slp,clevs,linewidths=0.5,colors='k') +CS2 = m.contourf(x,y,slp,clevs,cmap=plt.cm.RdBu_r) # plot wind barbs over map. barbs = m.barbs(xx,yy,uproj,vproj,length=5,barbcolor='k',flagcolor='r',linewidth=0.5) # draw coastlines, parallels, meridians. From c214cd43792dda87f306fc5d6662fe4ebda11bc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 5 Jan 2024 15:24:14 +0100 Subject: [PATCH 057/210] Update copyright years --- packages/basemap/doc/source/conf.py | 2 +- packages/basemap/utils/GeosLibrary.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/basemap/doc/source/conf.py b/packages/basemap/doc/source/conf.py index 50bde4883..2479c16da 100644 --- a/packages/basemap/doc/source/conf.py +++ b/packages/basemap/doc/source/conf.py @@ -23,7 +23,7 @@ # -- Project information ----------------------------------------------- project = myself.__name__.rsplit(".", 1)[-1] -copyright = "2011, Jeffrey Whitaker; 2016-2023 The matplotlib development team" +copyright = "2011 Jeffrey Whitaker; 2016-2024 The matplotlib development team" author = "Jeffrey Whitaker" # The short X.Y version diff --git a/packages/basemap/utils/GeosLibrary.py b/packages/basemap/utils/GeosLibrary.py index e48b3aa3b..6fab5945c 100644 --- a/packages/basemap/utils/GeosLibrary.py +++ b/packages/basemap/utils/GeosLibrary.py @@ -1,7 +1,7 @@ #! /usr/bin/env python # -*- coding: utf-8 -*- # -# Copyright (c) 2021-2023 Víctor Molina García +# Copyright (c) 2021-2024 Víctor Molina García # GeosLibrary.py is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published From 0e88006b63401c60ecb259d933291f042a132050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 5 Jan 2024 15:44:06 +0100 Subject: [PATCH 058/210] Update titles in docs --- packages/basemap/doc/source/api/basemap_api.rst | 7 +------ packages/basemap/doc/source/api/index.rst | 5 ++--- packages/basemap/doc/source/index.rst | 4 ++-- packages/basemap/doc/source/users/index.rst | 5 ++--- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/packages/basemap/doc/source/api/basemap_api.rst b/packages/basemap/doc/source/api/basemap_api.rst index 6d6537399..f460dac35 100644 --- a/packages/basemap/doc/source/api/basemap_api.rst +++ b/packages/basemap/doc/source/api/basemap_api.rst @@ -1,10 +1,5 @@ -************************** -matplotlib basemap toolkit -************************** - - :mod:`mpl_toolkits.basemap` -============================= +--------------------------- .. automodule:: mpl_toolkits.basemap :members: diff --git a/packages/basemap/doc/source/api/index.rst b/packages/basemap/doc/source/api/index.rst index 7352d468f..76bc0a6a2 100644 --- a/packages/basemap/doc/source/api/index.rst +++ b/packages/basemap/doc/source/api/index.rst @@ -1,8 +1,7 @@ .. _api-index: -#################################### - The Matplotlib Basemap Toolkit API -#################################### +Basemap API +=========== :Release: |version| :Date: |today| diff --git a/packages/basemap/doc/source/index.rst b/packages/basemap/doc/source/index.rst index 65f6b2c3c..7a6741d0c 100644 --- a/packages/basemap/doc/source/index.rst +++ b/packages/basemap/doc/source/index.rst @@ -1,5 +1,5 @@ -Welcome to the Matplotlib Basemap Toolkit documentation -======================================================= +Welcome to the Basemap documentation! +===================================== .. toctree:: :maxdepth: 2 diff --git a/packages/basemap/doc/source/users/index.rst b/packages/basemap/doc/source/users/index.rst index 69dea0050..e859e75b0 100644 --- a/packages/basemap/doc/source/users/index.rst +++ b/packages/basemap/doc/source/users/index.rst @@ -1,8 +1,7 @@ .. _users-guide-index: -############################################# - The Matplotlib Basemap Toolkit User's Guide -############################################# +Basemap User's Guide +==================== :Release: |version| :Date: |today| From 2f84dac4c3a7a601c3a182f248d677355ad2be1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 5 Jan 2024 15:48:38 +0100 Subject: [PATCH 059/210] Fix missing release version in basemap docs --- packages/basemap/doc/source/api/index.rst | 2 +- packages/basemap/doc/source/users/index.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/basemap/doc/source/api/index.rst b/packages/basemap/doc/source/api/index.rst index 76bc0a6a2..47b4044de 100644 --- a/packages/basemap/doc/source/api/index.rst +++ b/packages/basemap/doc/source/api/index.rst @@ -3,7 +3,7 @@ Basemap API =========== -:Release: |version| +:Release: |release| :Date: |today| .. toctree:: diff --git a/packages/basemap/doc/source/users/index.rst b/packages/basemap/doc/source/users/index.rst index e859e75b0..2f61f8e3f 100644 --- a/packages/basemap/doc/source/users/index.rst +++ b/packages/basemap/doc/source/users/index.rst @@ -3,7 +3,7 @@ Basemap User's Guide ==================== -:Release: |version| +:Release: |release| :Date: |today| .. toctree:: From 8be57c331a7ed6789577bd119a6ca1b0c6a22b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 5 Jan 2024 15:49:09 +0100 Subject: [PATCH 060/210] Apply minor correction in docs copyright --- packages/basemap/doc/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/basemap/doc/source/conf.py b/packages/basemap/doc/source/conf.py index 2479c16da..59c07f16c 100644 --- a/packages/basemap/doc/source/conf.py +++ b/packages/basemap/doc/source/conf.py @@ -23,7 +23,7 @@ # -- Project information ----------------------------------------------- project = myself.__name__.rsplit(".", 1)[-1] -copyright = "2011 Jeffrey Whitaker; 2016-2024 The matplotlib development team" +copyright = "2011 Jeffrey Whitaker; 2016-2024 The Matplotlib development team" author = "Jeffrey Whitaker" # The short X.Y version From d7d94aa943f026e8791b418eb199db3c87bb2764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 5 Jan 2024 17:58:09 +0100 Subject: [PATCH 061/210] Fix docs introduction and its broken links --- packages/basemap/doc/source/users/index.rst | 2 +- packages/basemap/doc/source/users/intro.rst | 57 ++++++++++++--------- 2 files changed, 33 insertions(+), 26 deletions(-) diff --git a/packages/basemap/doc/source/users/index.rst b/packages/basemap/doc/source/users/index.rst index 2f61f8e3f..b6a0006c5 100644 --- a/packages/basemap/doc/source/users/index.rst +++ b/packages/basemap/doc/source/users/index.rst @@ -8,8 +8,8 @@ Basemap User's Guide .. toctree:: - download.rst intro.rst + download.rst installing.rst mapsetup.rst geography.rst diff --git a/packages/basemap/doc/source/users/intro.rst b/packages/basemap/doc/source/users/intro.rst index 46965fcf3..ac5567a51 100644 --- a/packages/basemap/doc/source/users/intro.rst +++ b/packages/basemap/doc/source/users/intro.rst @@ -2,30 +2,37 @@ Introduction ============ The matplotlib basemap toolkit is a library for plotting 2D data on maps -in `Python `_. It is similar in functionality to -the `matlab mapping toolbox `_, -the `IDL mapping facilities `_, -`GrADS `_, or the -`Generic Mapping Tools `_. -`PyNGL `_ and -`CDAT `_ -are other libraries that provide similar capabilities in Python. +in `Python`_. It is similar in functionality to `GrADS`_, `GMT`_, the +`MATLAB Mapping Toolbox`_ and the `IDL Mapping Facilities`_. `CDAT`_ +and `PyNGL`_ are other Python libraries with similar capabilities. -Basemap does not do any plotting on it's own, but provides the facilities to transform coordinates to one of 25 different map projections (using the -`PROJ.4 `_ C library). `Matplotlib -`_ is then -used to plot contours, images, vectors, lines or points -in the transformed coordinates. -Shoreline, river and political boundary -datasets (from `Generic Mapping Tools `_) -are provided, along with methods for plotting them. The `GEOS library -`_ is used internally to clip the coastline and polticial boundary features to the desired map projection region. +Basemap does not plot on its own, but provides the facilities to +transform coordinates to one of 25 different map projections (using +`pyproj`_ and therefore the `PROJ`_ C library). Then `matplotlib`_ is +used to plot contours, images, vectors, lines or points in the +transformed coordinates. Shoreline, river and political boundary +datasets (extracted from `GMT`_) are provided, together with methods +for plotting them. The `GEOS`_ library is used internally to clip the +coastline and political boundary features to the map projection region. -Basemap is geared toward the needs of earth scientists, particularly -oceanographers and meteorologists. Jeff Whitaker originally wrote Basemap -to help in his research (climate and weather forecasting), since at the time -`CDAT `_ was -the only other tool in python for plotting data on map projections. Over -the years, the capabilities of Basemap have evolved as scientists in other -disciplines (such as biology, geology and geophysics) requested and -contributed new features. +Basemap is geared towards the needs of Earth scientists, particularly +oceanographers and meteorologists. Jeff Whitaker originally wrote +Basemap to help in his research (climate and weather forecasting), +since at the time `CDAT`_ was the only other tool in Python for +plotting data on map projections. Over the years, the capabilities +of basemap have evolved as scientists in other disciplines (such as +biology, geology and geophysics) requested and contributed new features. + + +.. _Python: https://www.python.org/ +.. _GMT: https://www.generic-mapping-tools.org/ +.. _GrADS: http://cola.gmu.edu/grads/ +.. _MATLAB Mapping Toolbox: https://www.mathworks.com/help/map/map.html +.. _IDL Mapping Facilities: https://www.nv5geospatialsoftware.com/docs/mapping_funct_list.html +.. _CDAT: https://cdat.llnl.gov/ +.. _PyNGL: https://www.pyngl.ucar.edu/ + +.. _pyproj: https://pyproj4.github.io/pyproj +.. _PROJ: https://proj.org/ +.. _matplotlib: https://matplotlib.org/ +.. _GEOS: https://libgeos.org/ From ff1cd416bf09fe949c34c2122f37fff30368edb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 5 Jan 2024 20:36:00 +0100 Subject: [PATCH 062/210] Rename intro.rst into introduction.rst --- packages/basemap/doc/source/users/index.rst | 2 +- .../basemap/doc/source/users/{intro.rst => introduction.rst} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename packages/basemap/doc/source/users/{intro.rst => introduction.rst} (100%) diff --git a/packages/basemap/doc/source/users/index.rst b/packages/basemap/doc/source/users/index.rst index b6a0006c5..8c5b203ca 100644 --- a/packages/basemap/doc/source/users/index.rst +++ b/packages/basemap/doc/source/users/index.rst @@ -8,7 +8,7 @@ Basemap User's Guide .. toctree:: - intro.rst + introduction.rst download.rst installing.rst mapsetup.rst diff --git a/packages/basemap/doc/source/users/intro.rst b/packages/basemap/doc/source/users/introduction.rst similarity index 100% rename from packages/basemap/doc/source/users/intro.rst rename to packages/basemap/doc/source/users/introduction.rst From 4a62ffdef922b29c2c85872ebcac288af1beaa24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 5 Jan 2024 20:39:38 +0100 Subject: [PATCH 063/210] Rename installing.rst into installation.rst --- packages/basemap/doc/source/users/index.rst | 2 +- .../doc/source/users/{installing.rst => installation.rst} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename packages/basemap/doc/source/users/{installing.rst => installation.rst} (100%) diff --git a/packages/basemap/doc/source/users/index.rst b/packages/basemap/doc/source/users/index.rst index 8c5b203ca..bdee7782d 100644 --- a/packages/basemap/doc/source/users/index.rst +++ b/packages/basemap/doc/source/users/index.rst @@ -9,8 +9,8 @@ Basemap User's Guide .. toctree:: introduction.rst + installation.rst download.rst - installing.rst mapsetup.rst geography.rst graticule.rst diff --git a/packages/basemap/doc/source/users/installing.rst b/packages/basemap/doc/source/users/installation.rst similarity index 100% rename from packages/basemap/doc/source/users/installing.rst rename to packages/basemap/doc/source/users/installation.rst From 565a7aa015bf8f123c0dd6656009b1c8560c9ee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 5 Jan 2024 21:23:15 +0100 Subject: [PATCH 064/210] Rewrite installation section in docs --- README.md | 13 +- .../basemap/doc/source/users/installation.rst | 128 ++++++++++-------- 2 files changed, 82 insertions(+), 59 deletions(-) diff --git a/README.md b/README.md index 78f05434c..1d4a9b8f4 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Optional requirements include: ## Installation The `basemap-data` and `basemap-data-hires` packages are available in -PyPI and can be installed with [`pip`](https:/pip.pypa.io/): +PyPI and can be installed with [`pip`](https://pip.pypa.io/): ```sh python -m pip install basemap-data python -m pip install basemap-data-hires @@ -37,7 +37,8 @@ available in PyPI (architectures x86 and x64, Python 2.7 and 3.5+): python -m pip install basemap ``` -Otherwise, you will need to install `basemap` from source as follows: +Otherwise, you will need to install `basemap` from its source hosted +on GitHub as indicated in the following steps: 1. Install pre-requisite Python modules: - [cython](https://github.com/cython/cython) @@ -51,7 +52,8 @@ Otherwise, you will need to install `basemap` from source as follows: ``` 3. Build the [GEOS](https://github.com/libgeos/geos) library. You may - use the helper provided in `utils`, i.e. + use the helper provided in `utils`, (please note that you need + [`CMake`](https://cmake.org/) and a working C compiler in advance): ```sh export GEOS_DIR= python -c "import utils; utils.GeosLibrary('3.6.5').build(installdir='${GEOS_DIR}')" @@ -70,11 +72,10 @@ Otherwise, you will need to install `basemap` from source as follows: to build Cython extensions (e.g. on Debian-like systems, you should have the package `python-dev` installed). -5. Check that the package installed correctly by executing: +5. Check that the package was installed correctly by executing: ```sh python -c "from mpl_toolkits.basemap import Basemap" ``` - You can also test the examples available in the `examples` folder. ## License @@ -98,7 +99,7 @@ https://spdx.org/licenses/LGPL-3.0-or-later.html ## Documentation -See https://matplotlib.github.io/basemap/ +See https://matplotlib.org/basemap/ See scripts in `examples` directory for example usage. diff --git a/packages/basemap/doc/source/users/installation.rst b/packages/basemap/doc/source/users/installation.rst index b27b161aa..a2ce9153b 100644 --- a/packages/basemap/doc/source/users/installation.rst +++ b/packages/basemap/doc/source/users/installation.rst @@ -1,76 +1,98 @@ -.. _installing: +Installation +============ -********** -Installing -********** +Installing from PyPI +-------------------- -Dependencies -============ +Precompiled binary wheels for Windows and GNU/Linux are available in +PyPI (architectures x86 and x64, Python 2.7 and 3.5+) and can be +installed with `pip`_: -**Requirements** +.. code-block:: sh -These are external packages which you will need to install before -installing Basemap. + python -m pip install basemap +Installing ``basemap`` will also install ``basemap-data``, containing the +minimal data assets required by ``basemap``. If you also need the +high-resolution data assets, you can install them with `pip`_ too: -Matplotlib 1.0.0 (or later, `download `__) +.. code-block:: sh -Python 2.6 (or later, including Python 3) (`download `__) - Matplotlib 2.2 LTS requires Python 2.7 or later - Matplotlib 3.0 requires Python 3.5 or later + python -m pip install basemap-data-hires -NumPy 1.2.1 (or later) - Array support for Python (`download `__) +Installing from conda-forge +--------------------------- -`PROJ4 `__ Cartographic Projections Library. +For Miniforge users, ``basemap`` packages are available through the +``conda-forge`` channel for Windows and GNU/Linux (x64) as well as +for MacOS (x64 and arm64): -**Required library that ships with Basemap** +.. code-block:: sh -`GEOS `__ (Geometry Engine - Open Source) library 3.1.1 or later. - Source code is included in the geos-3.3.3 directory. - When building from source, must be built and installed separately - from basemap (see build instructions below). - Included in Windows binary installers. + conda install -c conda-forge basemap -**Optional libraries** +Similarly to the PyPI installation, the high-resolution data assets +can be installed separately if needed: -Pillow - Python Imaging Library (`download `__), - only needed for :func:`~mpl_toolkits.basemap.Basemap.bluemarble`, :func:`~mpl_toolkits.basemap.Basemap.etopo`, :func:`~mpl_toolkits.basemap.Basemap.shadedrelief` and :func:`~mpl_toolkits.basemap.Basemap.warpimage` instance methods. +.. code-block:: sh -Installation -============ + conda install -c conda-forge basemap-data-hires + +Installation from source +------------------------ + +Optionally, you can also install ``basemap`` from its source hosted +on GitHub as indicated in the following steps: + +1. Install pre-requisite Python modules: + + - `cython`_ + - `numpy`_ + +2. Download the ``basemap`` source code and move to the + ``packages/basemap`` folder: + + .. code-block:: sh + + git clone --depth 1 https://github.com/matplotlib/basemap.git + cd basemap/packages/basemap + +3. Build the `GEOS`_ library. You may use the helper provided in the + ``utils`` folder (please note that you need `CMake`_ and a working + C compiler in advance): + + .. code-block:: sh + + export GEOS_DIR= + python -c "import utils; utils.GeosLibrary('3.6.5').build(installdir='${GEOS_DIR}')" + + or you can link directly to the system library if it is already + installed. ``GEOS_DIR`` must point to the GEOS installation prefix; + e.g. if ``libgeos_c.so`` is located in ``/usr/lib`` and ``geos_c.h`` + is located in ``/usr/include``, then you must set ``GEOS_DIR`` to + ``/usr``. -Download either Windows binary installers or source tarballs -`here `__. +4. Build and install the ``basemap`` binary wheel: -To install from the source, follow these steps: + .. code-block:: sh + python -m pip install . -* Install pre-requisite requirements. + On GNU/Linux, if your Python was installed through a package + management system, make sure that you have the Python header + ``Python.h`` required to build Cython extensions (e.g. on + Debian-like systems, you should have the package ``python-dev`` + installed). -* Untar the basemap version X.Y.Z source tar.gz file, and - and cd to the basemap-X.Y.Z directory. +5. Check that the package was installed correctly by executing: -* Install the GEOS library. If you already have it on your - system, just set the environment variable GEOS_DIR to point to the location - of libgeos_c and geos_c.h (if libgeos_c is in /usr/local/lib and - geos_c.h is in /usr/local/include, set GEOS_DIR to /usr/local). - Then go to next step. If you don't have it, you can build it from - the source code included with basemap by following these steps:: + .. code-block:: sh - cd geos-3.3.3 - export GEOS_DIR= - # A reasonable choice on a Unix-like system is /usr/local, or - # if you don't have permission to write there, your home directory. - ./configure --prefix=$GEOS_DIR - make; make install + python -c "from mpl_toolkits.basemap import Basemap" -* cd back to the top level basemap directory (basemap-X.Y.Z) and - run the usual ``python setup.py install``. Check your installation - by running ``from mpl_toolkits.basemap import Basemap`` at the Python - prompt. -* To test, cd to the examples directory and run ``python simpletest.py``. - To run all the examples (except those that have extra dependencies - or require an internet connection), execute ``python run_all.py``. +.. _pip: https://pip.pypa.io/ +.. _cython: https://github.com/cython/cython +.. _numpy: https://github.com/numpy/numpy +.. _GEOS: https://github.com/libgeos/geos +.. _CMake: https://cmake.org/ From e38233ee4ef701f9dad8819bf5a0ca4044764b07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 5 Jan 2024 21:29:23 +0100 Subject: [PATCH 065/210] Remove download.rst from docs --- packages/basemap/doc/source/users/download.rst | 9 --------- packages/basemap/doc/source/users/index.rst | 1 - 2 files changed, 10 deletions(-) delete mode 100644 packages/basemap/doc/source/users/download.rst diff --git a/packages/basemap/doc/source/users/download.rst b/packages/basemap/doc/source/users/download.rst deleted file mode 100644 index 40eabf307..000000000 --- a/packages/basemap/doc/source/users/download.rst +++ /dev/null @@ -1,9 +0,0 @@ -Download -======== - -Source code can be found -`here `__ - -The recommended installation method is using anaconda through the -conda-forge channel. Basemap is no longer uploaded to PyPI due to its -size and non-python external dependencies. diff --git a/packages/basemap/doc/source/users/index.rst b/packages/basemap/doc/source/users/index.rst index bdee7782d..d79f0783c 100644 --- a/packages/basemap/doc/source/users/index.rst +++ b/packages/basemap/doc/source/users/index.rst @@ -10,7 +10,6 @@ Basemap User's Guide introduction.rst installation.rst - download.rst mapsetup.rst geography.rst graticule.rst From 23903e73f74f8ae8ad8f8b835ed8c7ca100c67ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 5 Jan 2024 21:57:59 +0100 Subject: [PATCH 066/210] Update more outdated links in docs --- packages/basemap/doc/source/users/examples.rst | 4 ++-- packages/basemap/doc/source/users/geography.rst | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/basemap/doc/source/users/examples.rst b/packages/basemap/doc/source/users/examples.rst index 00f21aba2..9d0daca31 100644 --- a/packages/basemap/doc/source/users/examples.rst +++ b/packages/basemap/doc/source/users/examples.rst @@ -32,7 +32,7 @@ For more specifics of how to use the Basemap instance methods, see :ref:`api-index`. Here are the examples (many of which utilize the -`netcdf4-python `__ module +`netcdf4-python `__ module to retrieve datasets over http): * Plot contour lines on a basemap @@ -56,7 +56,7 @@ to retrieve datasets over http): .. plot:: users/figures/plotetopo5.py -* Plot markers at locations of `ARGO `__ floats. +* Plot markers at locations of `ARGO `__ floats. .. plot:: users/figures/plotargo.py diff --git a/packages/basemap/doc/source/users/geography.rst b/packages/basemap/doc/source/users/geography.rst index e69e8df8a..5714dbbee 100644 --- a/packages/basemap/doc/source/users/geography.rst +++ b/packages/basemap/doc/source/users/geography.rst @@ -7,7 +7,7 @@ Basemap includes the GSSH (now `GSHHG `_) coastline dataset, as well as datasets for rivers, state and country boundaries from -`GMT `_. +`GMT `_. These datasets can be used to draw coastlines, rivers and political boundaries on maps at several different resolutions. The relevant Basemap methods are: @@ -36,13 +36,13 @@ used as a map background. Basemap provides several options for this: mask is derived from the GSHHS coastline data, and there are several coastline options and pixel sizes to choose from. * :func:`~mpl_toolkits.basemap.Basemap.bluemarble`: draw a NASA - `Blue Marble `_ + `Blue Marble `_ image as a map background. * :func:`~mpl_toolkits.basemap.Basemap.shadedrelief`: draw a - `shaded relief `_ image + `shaded relief `_ image as a map background. * :func:`~mpl_toolkits.basemap.Basemap.etopo`: draw an - `etopo `_ + `etopo `_ relief image as map background. * :func:`~mpl_toolkits.basemap.Basemap.warpimage`: use an abitrary image as a map background. The image must be global, covering the From d5d8921f72e2ebcca6c73465f8a48f20769d538a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 5 Jan 2024 22:08:30 +0100 Subject: [PATCH 067/210] Fix some examples with fixes from docs --- examples/hurrtracks.py | 10 +++------- examples/plothighsandlows.py | 2 +- examples/plotsst.py | 19 ++++++++++++++----- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/examples/hurrtracks.py b/examples/hurrtracks.py index 32a35663e..2670cb7b7 100644 --- a/examples/hurrtracks.py +++ b/examples/hurrtracks.py @@ -1,14 +1,13 @@ -from __future__ import (absolute_import, division, print_function) - """ draw Atlantic Hurricane Tracks for storms that reached Cat 4 or 5. part of the track for which storm is cat 4 or 5 is shown red. ESRI shapefile data from http://nationalatlas.gov/mld/huralll.html """ +import os import numpy as np import matplotlib.pyplot as plt -from mpl_toolkits.basemap import Basemap as Basemap -# Lambert Conformal Conic maplt. +from mpl_toolkits.basemap import Basemap +# Lambert Conformal Conic map. m = Basemap(llcrnrlon=-100.,llcrnrlat=0.,urcrnrlon=-20.,urcrnrlat=57., projection='lcc',lat_1=20.,lat_2=40.,lon_0=-60., resolution ='l',area_thresh=1000.) @@ -16,7 +15,6 @@ fig=plt.figure() # read shapefile. shp_info = m.readshapefile('huralll020','hurrtracks',drawbounds=False) -print(shp_info) # find names of storms that reached Cat 4. names = [] for shapedict in m.hurrtracks_info: @@ -25,8 +23,6 @@ if cat in ['H4','H5'] and name not in names: # only use named storms. if name != 'NOT NAMED': names.append(name) -print(names) -print(len(names)) # plot tracks of those storms. for shapedict,shape in zip(m.hurrtracks_info,m.hurrtracks): name = shapedict['NAME'] diff --git a/examples/plothighsandlows.py b/examples/plothighsandlows.py index f86fddda6..f5fa73345 100644 --- a/examples/plothighsandlows.py +++ b/examples/plothighsandlows.py @@ -27,7 +27,7 @@ def main(): """Main function.""" # Plot 00 UTC today. - url = "http://nomads.ncep.noaa.gov/dods/gfs_0p25/gfs%Y%m%d/gfs_0p25_00z" + url = "http://nomads.ncep.noaa.gov/dods/gfs_0p50/gfs%Y%m%d/gfs_0p50_00z" date = dt.datetime.now() # Open OPeNDAP dataset. diff --git a/examples/plotsst.py b/examples/plotsst.py index e57a560db..a8652c34d 100644 --- a/examples/plotsst.py +++ b/examples/plotsst.py @@ -1,24 +1,33 @@ -from __future__ import (absolute_import, division, print_function) - from mpl_toolkits.basemap import Basemap from netCDF4 import Dataset, date2index import numpy as np import matplotlib.pyplot as plt from datetime import datetime +try: + from urllib.request import urlretrieve +except ImportError: + from urllib import urlretrieve date = datetime(2007,12,15,0) # date to plot. # open dataset. -dataset = \ -Dataset('http://www.ncdc.noaa.gov/thredds/dodsC/OISST-V2-AVHRR_agg') +sstpath, sstheader = urlretrieve("https://downloads.psl.noaa.gov/Datasets/noaa.oisst.v2.highres/sst.day.mean.{0}.nc".format(date.year)) +dataset = Dataset(sstpath) timevar = dataset.variables['time'] timeindex = date2index(date,timevar) # find time index for desired date. # read sst. Will automatically create a masked array using # missing_value variable attribute. 'squeeze out' singleton dimensions. sst = dataset.variables['sst'][timeindex,:].squeeze() # read ice. -ice = dataset.variables['ice'][timeindex,:].squeeze() +dataset.close() +icepath, iceheader = urlretrieve("https://downloads.psl.noaa.gov/Datasets/noaa.oisst.v2.highres/icec.day.mean.{0}.nc".format(date.year)) +dataset = Dataset(icepath) +ice = dataset.variables['icec'][timeindex,:].squeeze() # read lats and lons (representing centers of grid boxes). lats = dataset.variables['lat'][:] lons = dataset.variables['lon'][:] +dataset.close() +latstep, lonstep = np.diff(lats[:2]), np.diff(lons[:2]) +lats = np.append(lats - 0.5 * latstep, lats[-1] + 0.5 * latstep) +lons = np.append(lons - 0.5 * lonstep, lons[-1] + 0.5 * lonstep) lons, lats = np.meshgrid(lons,lats) # create figure, axes instances. fig = plt.figure() From 0c06f62a4c5eaf9134fd74a159a5c7754eb90bb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 5 Jan 2024 23:51:59 +0100 Subject: [PATCH 068/210] Fix several broken examples --- examples/geos_demo.py | 2 +- examples/geos_demo_2.py | 2 +- examples/ortho_demo.py | 2 +- examples/plotcities.py | 16 +++++++++------- examples/plotozone.py | 2 +- examples/warpimage.py | 2 +- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/examples/geos_demo.py b/examples/geos_demo.py index e21377671..63bae91ff 100644 --- a/examples/geos_demo.py +++ b/examples/geos_demo.py @@ -20,11 +20,11 @@ def get_input(prompt): # plot land-sea mask. # land red, oceans blue. # lakes=True means plot inland lakes with ocean color. +m.drawmapboundary() m.drawlsmask(land_color='red',ocean_color='blue',lakes=True) # draw parallels and meridians. m.drawparallels(np.arange(-90.,120.,30.)) m.drawmeridians(np.arange(0.,420.,60.)) -m.drawmapboundary() plt.title('Geostationary Map Centered on Lon=%s' % (lon_0)) # map with continents drawn and filled. diff --git a/examples/geos_demo_2.py b/examples/geos_demo_2.py index 5b3bc258b..cbc0d3f2c 100644 --- a/examples/geos_demo_2.py +++ b/examples/geos_demo_2.py @@ -39,7 +39,7 @@ m = Basemap(projection='geos', lon_0=lon_0, satellite_height=satellite_height, resolution='l', llcrnrlon=ll_lon, llcrnrlat=ll_lat, urcrnrlon=ur_lon, urcrnrlat=ur_lat) # add data -m.imshow(data, cmap=plt.cm.gray, interpolation='nearest') +m.imshow(data[::-1], cmap=plt.cm.gray, interpolation='nearest') plt.clim(0, 255) # draw coastlines. m.drawcoastlines(linewidth=0.5, color=overlay_color) diff --git a/examples/ortho_demo.py b/examples/ortho_demo.py index 9fa1ed56b..4a16e8662 100644 --- a/examples/ortho_demo.py +++ b/examples/ortho_demo.py @@ -22,13 +22,13 @@ def get_input(prompt): # land coral, oceans aqua. # lakes=True means plot inland lakes with ocean color. # resolution = 5 (default) means use 5 min dataset (can use 2.5) +m.drawmapboundary() m.drawcoastlines() m.drawlsmask(land_color='coral',ocean_color='aqua', lakes=True,\ resolution=resolution,grid=grid) # draw parallels and meridians. m.drawparallels(np.arange(-90.,120.,30.)) m.drawmeridians(np.arange(0.,420.,60.)) -m.drawmapboundary() plt.title('Orthographic Map Centered on Lon=%s, Lat=%s' % (lon_0,lat_0)) # map with continents drawn and filled (continent filling fails for diff --git a/examples/plotcities.py b/examples/plotcities.py index a708b2f4c..6f8b2a6ca 100644 --- a/examples/plotcities.py +++ b/examples/plotcities.py @@ -1,20 +1,22 @@ from __future__ import (absolute_import, division, print_function) -from matplotlib.mlab import prctile_rank +import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap as Basemap +prctile_rank = lambda x, p: np.searchsorted(np.percentile(x, np.atleast_1d(p)), x) # cities colored by population rank. m = Basemap() shp_info = m.readshapefile('cities','cities') -x, y = zip(*m.cities) -pop = [] -for item in m.cities_info: +x, y, pop = [], [], [] +for item, (x_i, y_i) in zip(m.cities_info, m.cities): population = item['POPULATION'] - if population < 0: continue # population missing - pop.append(population) -popranks = prctile_rank(pop,100) + if population >= 0: + pop.append(population) + x.append(x_i) + y.append(y_i) +popranks = prctile_rank(pop,np.linspace(0, 100, 101)) colors = [] for rank in popranks: colors.append(plt.cm.jet(float(rank)/100.)) diff --git a/examples/plotozone.py b/examples/plotozone.py index 1a4d41b5a..26c11c072 100644 --- a/examples/plotozone.py +++ b/examples/plotozone.py @@ -66,7 +66,7 @@ toplot = np.ma.masked_values(o3[0, 0], 0.) * 1000. bounds = np.percentile(toplot.compressed().ravel(), np.linspace(5, 95, 9).tolist()) -ptch = m.pcolor(X, Y, toplot, cmap = WhGrYlBu, norm = plt.matplotlib.colors.BoundaryNorm(bounds, 20), vmin = bounds[0], vmax = bounds[-1]) +ptch = m.pcolor(X, Y, toplot, cmap = WhGrYlBu, norm = plt.matplotlib.colors.BoundaryNorm(bounds, 20)) # Add a colorbar using proportional spacing, but # colors based on 10 distinct bins diff --git a/examples/warpimage.py b/examples/warpimage.py index 1bea87a59..705105d81 100644 --- a/examples/warpimage.py +++ b/examples/warpimage.py @@ -81,7 +81,7 @@ # define orthographic projection centered on Europe. m = Basemap(projection='ortho',lat_0=40,lon_0=40,resolution='l') # plot a gray-scale image specified from a URL. -im = m.warpimage("http://earthobservatory.nasa.gov/Features/BlueMarble/Images/gebco_bathy.5400x2700.jpg") +im = m.warpimage("https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73963/gebco_08_rev_bath_3600x1800_color.jpg") # draw coastlines. m.drawcoastlines(linewidth=0.5,color='0.5') # draw lat/lon grid lines every 30 degrees. From 25d1661a65d603c2fa7f3b469806e9525ea41389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sat, 6 Jan 2024 00:10:36 +0100 Subject: [PATCH 069/210] Fix a couple of typos in docs --- packages/basemap/doc/source/index.rst | 2 +- packages/basemap/doc/source/users/cea.rst | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/basemap/doc/source/index.rst b/packages/basemap/doc/source/index.rst index 7a6741d0c..a2cdbc306 100644 --- a/packages/basemap/doc/source/index.rst +++ b/packages/basemap/doc/source/index.rst @@ -1,4 +1,4 @@ -Welcome to the Basemap documentation! +Welcome to the basemap documentation! ===================================== .. toctree:: diff --git a/packages/basemap/doc/source/users/cea.rst b/packages/basemap/doc/source/users/cea.rst index 7271c7f64..cf72603c7 100644 --- a/packages/basemap/doc/source/users/cea.rst +++ b/packages/basemap/doc/source/users/cea.rst @@ -1,8 +1,8 @@ .. _cea: -Cylindrial Equal-Area Projection -================================ +Cylindrical Equal-Area Projection +================================= -It is what is says. +It is what is says. .. plot:: users/figures/cea.py From 08afbc369f8a77770003e9a246587c9570c38a32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sat, 6 Jan 2024 14:15:25 +0100 Subject: [PATCH 070/210] Apply minor corrections in README and docs --- README.md | 2 +- packages/basemap/doc/source/users/geography.rst | 3 +-- packages/basemap/doc/source/users/installation.rst | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1d4a9b8f4..0f6c19781 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Basic requirements are the following: Optional requirements include: * [OWSLib](https://github.com/geopython/OWSLib). It is needed for the - `Basemap.wmsimage` function. + method `Basemap.wmsimage`. * [Pillow](https://github.com/python-pillow/Pillow). It is needed for the methods `Basemap.bluemarble`, `Basemap.etopo`, diff --git a/packages/basemap/doc/source/users/geography.rst b/packages/basemap/doc/source/users/geography.rst index 5714dbbee..ce71334c4 100644 --- a/packages/basemap/doc/source/users/geography.rst +++ b/packages/basemap/doc/source/users/geography.rst @@ -3,8 +3,7 @@ Drawing a Map Background ======================== -Basemap includes the GSSH (now -`GSHHG `_) +Basemap includes the `GSHHG `_ coastline dataset, as well as datasets for rivers, state and country boundaries from `GMT `_. diff --git a/packages/basemap/doc/source/users/installation.rst b/packages/basemap/doc/source/users/installation.rst index a2ce9153b..f9bd57c4e 100644 --- a/packages/basemap/doc/source/users/installation.rst +++ b/packages/basemap/doc/source/users/installation.rst @@ -38,8 +38,8 @@ can be installed separately if needed: conda install -c conda-forge basemap-data-hires -Installation from source ------------------------- +Installing from source +---------------------- Optionally, you can also install ``basemap`` from its source hosted on GitHub as indicated in the following steps: From 6ca0d8366aa6e72fe8762a256d6016acda12a1a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sat, 6 Jan 2024 17:58:10 +0100 Subject: [PATCH 071/210] Fix missing napoleon extension in conf.py --- packages/basemap/doc/source/conf.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/basemap/doc/source/conf.py b/packages/basemap/doc/source/conf.py index 59c07f16c..875790dcc 100644 --- a/packages/basemap/doc/source/conf.py +++ b/packages/basemap/doc/source/conf.py @@ -43,6 +43,7 @@ # ones. extensions = [ "sphinx.ext.autodoc", + "sphinx.ext.napoleon", "sphinx.ext.intersphinx", "sphinx.ext.viewcode", "matplotlib.sphinxext.plot_directive", @@ -55,6 +56,8 @@ "exclude-members": "__weakref__", } +napoleon_use_ivar = True +napoleon_use_rtype = False intersphinx_mapping = { "python": ("https://docs.python.org/3", None), From ecf540e74714e9dc0c482d94eedf9c4341d47dde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sat, 6 Jan 2024 18:05:38 +0100 Subject: [PATCH 072/210] Update CHANGELOG --- CHANGELOG.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e196dfca5..f09db5fff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,13 @@ https://semver.org/spec/v2.0.0.html ### Added - Support for Python 3.12. +- Complete support for `basemap` in `conda-forge` channel for the major + platforms on x64 and for MacOS on arm64 (solves issue [#286]). +- Precompiled wheels for MacOS x64 and arm64 on PyPI (solves issues + [#447] and [#574]). +- Renewed documentation, with fixes for the broken links and examples, + an improved section on the installation process, and without the + deprecation/sunsetting section (solves issues [#527] and [#568]). - Optional argument `encoding_errors` for `Basemap.readshapefile` method (PR [#554] by @guziy, implements request [#552]). - Optional argument `cachedir` for `Basemap.arcgisimage` method to allow @@ -1087,8 +1094,12 @@ https://github.com/matplotlib/basemap/pull/580 https://github.com/matplotlib/basemap/issues/579 [#577]: https://github.com/matplotlib/basemap/issues/577 +[#574]: +https://github.com/matplotlib/basemap/issues/574 [#573]: https://github.com/matplotlib/basemap/issues/573 +[#568]: +https://github.com/matplotlib/basemap/issues/568 [#566]: https://github.com/matplotlib/basemap/issues/566 [#565]: @@ -1177,6 +1188,8 @@ https://github.com/matplotlib/basemap/issues/463 https://github.com/matplotlib/basemap/issues/461 [#456]: https://github.com/matplotlib/basemap/issues/456 +[#447]: +https://github.com/matplotlib/basemap/issues/447 [#445]: https://github.com/matplotlib/basemap/issues/445 [#444]: @@ -1197,6 +1210,8 @@ https://github.com/matplotlib/basemap/issues/403 https://github.com/matplotlib/basemap/issues/383 [#362]: https://github.com/matplotlib/basemap/issues/362 +[#286]: +https://github.com/matplotlib/basemap/issues/286 [#228]: https://github.com/matplotlib/basemap/issues/228 [#179]: From f895685296b6456914e5121a2ed693a3472b2d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sat, 6 Jan 2024 18:05:52 +0100 Subject: [PATCH 073/210] Restrict pages job to tags --- .github/workflows/basemap-for-manylinux.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index 4340dd027..ce5bf0e39 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -395,6 +395,7 @@ jobs: path: ${{ env.PKGDIR }}/public pages: + if: startsWith(github.event.ref, 'refs/tags/v') needs: docs runs-on: ubuntu-latest environment: From 847649e5b95a1fefac22ae0ab36957a0582615ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sat, 6 Jan 2024 18:07:05 +0100 Subject: [PATCH 074/210] Remove flake8 exclusion in conf.py --- packages/basemap/doc/source/conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/basemap/doc/source/conf.py b/packages/basemap/doc/source/conf.py index 875790dcc..8f46e913e 100644 --- a/packages/basemap/doc/source/conf.py +++ b/packages/basemap/doc/source/conf.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -# flake8: noqa: E402 # pylint: disable=redefined-builtin,wrong-import-position """Configuration file for the Sphinx documentation builder. From 823688b76a6b619d3a982d1d4c04d1a10eb19663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sat, 6 Jan 2024 18:31:12 +0100 Subject: [PATCH 075/210] Replace PIP_TIMEOUT with PIP_DEFAULT_TIMEOUT in workflows --- .github/workflows/basemap-data-hires.yml | 2 +- .github/workflows/basemap-data.yml | 2 +- .github/workflows/basemap-for-manylinux.yml | 2 +- .github/workflows/basemap-for-windows.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/basemap-data-hires.yml b/.github/workflows/basemap-data-hires.yml index a2030f33d..87584216a 100644 --- a/.github/workflows/basemap-data-hires.yml +++ b/.github/workflows/basemap-data-hires.yml @@ -3,9 +3,9 @@ name: basemap-data-hires env: PKGDIR: "packages/basemap_data_hires" PYTHONWARNINGS: "ignore:DEPRECATION" + PIP_DEFAULT_TIMEOUT: 10 PIP_DISABLE_PIP_VERSION_CHECK: 1 PIP_PREFER_BINARY: 1 - PIP_TIMEOUT: 10 PIP_RETRIES: 0 on: diff --git a/.github/workflows/basemap-data.yml b/.github/workflows/basemap-data.yml index 3958e1f09..cb01cc296 100644 --- a/.github/workflows/basemap-data.yml +++ b/.github/workflows/basemap-data.yml @@ -3,9 +3,9 @@ name: basemap-data env: PKGDIR: "packages/basemap_data" PYTHONWARNINGS: "ignore:DEPRECATION" + PIP_DEFAULT_TIMEOUT: 10 PIP_DISABLE_PIP_VERSION_CHECK: 1 PIP_PREFER_BINARY: 1 - PIP_TIMEOUT: 10 PIP_RETRIES: 0 on: diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index ce5bf0e39..4848b011b 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -3,9 +3,9 @@ name: basemap-for-manylinux env: PKGDIR: "packages/basemap" PYTHONWARNINGS: "ignore:DEPRECATION" + PIP_DEFAULT_TIMEOUT: 10 PIP_DISABLE_PIP_VERSION_CHECK: 1 PIP_PREFER_BINARY: 1 - PIP_TIMEOUT: 10 PIP_RETRIES: 0 on: diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml index b1297b1b8..f2c91076e 100644 --- a/.github/workflows/basemap-for-windows.yml +++ b/.github/workflows/basemap-for-windows.yml @@ -3,9 +3,9 @@ name: basemap-for-windows env: PKGDIR: "packages/basemap" PYTHONWARNINGS: "ignore:DEPRECATION" + PIP_DEFAULT_TIMEOUT: 10 PIP_DISABLE_PIP_VERSION_CHECK: 1 PIP_PREFER_BINARY: 1 - PIP_TIMEOUT: 10 PIP_RETRIES: 0 on: From f4195876a5f01294d3a86404018ce8c1dcf7faaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sat, 6 Jan 2024 18:35:33 +0100 Subject: [PATCH 076/210] Add PYTHONUNBUFFERED environment variable to workflows --- .github/workflows/basemap-data-hires.yml | 3 ++- .github/workflows/basemap-data.yml | 3 ++- .github/workflows/basemap-for-manylinux.yml | 3 ++- .github/workflows/basemap-for-windows.yml | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/basemap-data-hires.yml b/.github/workflows/basemap-data-hires.yml index 87584216a..a17c75bef 100644 --- a/.github/workflows/basemap-data-hires.yml +++ b/.github/workflows/basemap-data-hires.yml @@ -2,11 +2,12 @@ name: basemap-data-hires env: PKGDIR: "packages/basemap_data_hires" - PYTHONWARNINGS: "ignore:DEPRECATION" PIP_DEFAULT_TIMEOUT: 10 PIP_DISABLE_PIP_VERSION_CHECK: 1 PIP_PREFER_BINARY: 1 PIP_RETRIES: 0 + PYTHONUNBUFFERED: "1" + PYTHONWARNINGS: "ignore:DEPRECATION" on: push: diff --git a/.github/workflows/basemap-data.yml b/.github/workflows/basemap-data.yml index cb01cc296..60fabb8ad 100644 --- a/.github/workflows/basemap-data.yml +++ b/.github/workflows/basemap-data.yml @@ -2,11 +2,12 @@ name: basemap-data env: PKGDIR: "packages/basemap_data" - PYTHONWARNINGS: "ignore:DEPRECATION" PIP_DEFAULT_TIMEOUT: 10 PIP_DISABLE_PIP_VERSION_CHECK: 1 PIP_PREFER_BINARY: 1 PIP_RETRIES: 0 + PYTHONUNBUFFERED: "1" + PYTHONWARNINGS: "ignore:DEPRECATION" on: push: diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index 4848b011b..2773e52c8 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -2,11 +2,12 @@ name: basemap-for-manylinux env: PKGDIR: "packages/basemap" - PYTHONWARNINGS: "ignore:DEPRECATION" PIP_DEFAULT_TIMEOUT: 10 PIP_DISABLE_PIP_VERSION_CHECK: 1 PIP_PREFER_BINARY: 1 PIP_RETRIES: 0 + PYTHONUNBUFFERED: "1" + PYTHONWARNINGS: "ignore:DEPRECATION" on: push: diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml index f2c91076e..69b23d645 100644 --- a/.github/workflows/basemap-for-windows.yml +++ b/.github/workflows/basemap-for-windows.yml @@ -2,11 +2,12 @@ name: basemap-for-windows env: PKGDIR: "packages/basemap" - PYTHONWARNINGS: "ignore:DEPRECATION" PIP_DEFAULT_TIMEOUT: 10 PIP_DISABLE_PIP_VERSION_CHECK: 1 PIP_PREFER_BINARY: 1 PIP_RETRIES: 0 + PYTHONUNBUFFERED: "1" + PYTHONWARNINGS: "ignore:DEPRECATION" on: push: From 8921657b939f499bdd9f06427ec4e9a889fff91f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sat, 6 Jan 2024 19:42:43 +0100 Subject: [PATCH 077/210] Apply basic code linting in _geoslib.pyx --- CHANGELOG.md | 2 + packages/basemap/src/_geoslib.pyx | 186 ++++++++++++++++-------------- 2 files changed, 100 insertions(+), 88 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f09db5fff..738c3009c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,8 @@ https://semver.org/spec/v2.0.0.html directive "legacy_implicit_noexcept" (PR [#593] by @musicinmybrain). - Fix `_geoslib.pyx` syntax to comply with newer compilers such as Clang 16 and GCC 14 (PR [#595] by @fweimer-rh). +- Apply basic cleanup of `_geoslib.pyx` source code (i.e. basic linting, + removal of commented code, version update). ### Removed - Attribute `__version__` in `mpl_toolkits.basemap.proj` module. diff --git a/packages/basemap/src/_geoslib.pyx b/packages/basemap/src/_geoslib.pyx index 0ecab80cf..c82de52d2 100644 --- a/packages/basemap/src/_geoslib.pyx +++ b/packages/basemap/src/_geoslib.pyx @@ -2,41 +2,41 @@ import sys import numpy cimport numpy as cnp -__version__ = "0.3" +__version__ = "1.4.0-dev" -# need some python C API functions for strings. + +# Need some Python C-API functions for strings. cdef extern from "Python.h": object PyBytes_FromString(char *) -# taken from numpy.pxi in numpy 1.0rc2. + +# Taken from `numpy.pxi` in numpy 1.0rc2. cdef extern from "numpy/arrayobject.h": - ctypedef int npy_intp + ctypedef int npy_intp ctypedef extern class numpy.ndarray [object PyArrayObject]: cdef char *data cdef int nd cdef npy_intp *dimensions cdef npy_intp *strides cdef object base -# cdef dtype descr cdef int flags npy_intp PyArray_SIZE(ndarray arr) npy_intp PyArray_ISCONTIGUOUS(ndarray arr) -# Initialize numpy + +# Initialize numpy. cnp.import_array() -# GENERAL NOTES: -# -# - Remember to call initGEOS() before any use of this library's -# functions, and call finishGEOS() when done. -# -# - Currently you have to explicitly GEOSGeom_destroy() all -# GEOSGeom objects to avoid memory leaks, and to free() -# all returned char * (unless const). This might change -# before first release to ensure greater API stability. +# GENERAL NOTES: +# - Remember to call initGEOS() before any use of this library's +# functions, and call finishGEOS() when done. +# - Currently you have to explicitly GEOSGeom_destroy() all +# GEOSGeom objects to avoid memory leaks, and to free() +# all returned char * (unless const). This might change +# before first release to ensure greater API stability. cdef extern from "geos_c.h": -# Supported geometry type IDs + # Supported geometry type IDs. cdef enum: GEOS_POINT GEOS_LINESTRING @@ -60,8 +60,8 @@ cdef extern from "geos_c.h": void finishGEOS() GEOSCoordSequence *GEOSCoordSeq_create(unsigned int size, unsigned int dims) void GEOSCoordSeq_destroy(GEOSCoordSequence* s) - int GEOSCoordSeq_setX(GEOSCoordSequence* s,unsigned int idx, double val) - int GEOSCoordSeq_setY(GEOSCoordSequence* s,unsigned int idx, double val) + int GEOSCoordSeq_setX(GEOSCoordSequence* s, unsigned int idx, double val) + int GEOSCoordSeq_setY(GEOSCoordSequence* s, unsigned int idx, double val) int GEOSCoordSeq_getX(GEOSCoordSequence* s, unsigned int idx, double *val) int GEOSCoordSeq_getY(GEOSCoordSequence* s, unsigned int idx, double *val) GEOSGeometry *GEOSUnion(GEOSGeometry* g1, GEOSGeometry* g2) @@ -71,14 +71,14 @@ cdef extern from "geos_c.h": GEOSGeometry *GEOSGeom_createPoint(GEOSCoordSequence* s) GEOSGeometry *GEOSGeom_createLineString(GEOSCoordSequence* s) GEOSGeometry *GEOSGeom_createPolygon(GEOSGeometry* shell, GEOSGeometry** holes, unsigned int nholes) - GEOSGeometry *GEOSGeom_createLinearRing(GEOSCoordSequence* s) + GEOSGeometry *GEOSGeom_createLinearRing(GEOSCoordSequence* s) void GEOSGeom_destroy(GEOSGeometry* g) -# Topology operations - return NULL on exception. + # Topology operations: Return NULL on exception. GEOSGeometry *GEOSIntersection(GEOSGeometry* g1, GEOSGeometry* g2) GEOSGeometry *GEOSSimplify(GEOSGeometry* g1, double tolerance) GEOSGeometry *GEOSBuffer(GEOSGeometry* g1, double width, int quadsegs) GEOSGeometry *GEOSTopologyPreserveSimplify(GEOSGeometry* g1, double tolerance) -# Binary/Unary predicate - return 2 on exception, 1 on true, 0 on false + # Binary/Unary predicate: Return 2 on exception, 1 on true, 0 on false. char GEOSIntersects(GEOSGeometry* g1, GEOSGeometry* g2) char GEOSWithin(GEOSGeometry* g1, GEOSGeometry* g2) char GEOSContains(GEOSGeometry* g1, GEOSGeometry* g2) @@ -86,28 +86,29 @@ cdef extern from "geos_c.h": char GEOSisValid(GEOSGeometry* g1) char GEOSisSimple(GEOSGeometry* g1) char GEOSisRing(GEOSGeometry* g1) -# Geometry info + # Geometry info. char *GEOSGeomType(GEOSGeometry* g1) int GEOSGeomTypeId(GEOSGeometry* g1) -# Functions: Return 0 on exception, 1 otherwise + # Functions: Return 0 on exception, 1 otherwise. int GEOSArea(GEOSGeometry* g1, double *area) int GEOSLength(GEOSGeometry* g1, double *length) -# returns -1 on error and 1 for non-multi geoms + # Returns -1 on error and 1 for non-multi geoms. int GEOSGetNumGeometries(GEOSGeometry* g1) -# Return NULL on exception, Geometry must be a Collection. -# Returned object is a pointer to internal storage: -# it must NOT be destroyed directly. - GEOSGeometry *GEOSGetGeometryN(GEOSGeometry* g, int n) + # Return NULL on exception, Geometry must be a Collection. + # Returned object is a pointer to internal storage: + # it must NOT be destroyed directly. + GEOSGeometry *GEOSGetGeometryN(GEOSGeometry* g, int n) int GEOSGetNumInteriorRings(GEOSGeometry* g1) -# Return NULL on exception, Geometry must be a Polygon. -# Returned object is a pointer to internal storage: -# it must NOT be destroyed directly. - GEOSGeometry *GEOSGetExteriorRing(GEOSGeometry* g) -# Return NULL on exception. -# Geometry must be a LineString, LinearRing or Point. - GEOSCoordSequence *GEOSGeom_getCoordSeq(const GEOSGeometry* g) + # Return NULL on exception, Geometry must be a Polygon. + # Returned object is a pointer to internal storage: + # it must NOT be destroyed directly. + GEOSGeometry *GEOSGetExteriorRing(GEOSGeometry* g) + # Return NULL on exception. + # Geometry must be a LineString, LinearRing or Point. + GEOSCoordSequence *GEOSGeom_getCoordSeq(const GEOSGeometry* g) int GEOSCoordSeq_getSize(const GEOSCoordSequence *s, unsigned int *size) + # Cython 3: Next cdef needs "noexcept" declaration unless # the compiler directive "legacy_implicit_noexcept" is used # ("noexcept" syntax supported since Cython 0.29.31). @@ -121,6 +122,7 @@ cdef void notice_h(const char *fmt, ...): # warn_msg = format #sys.stdout.write('GEOS_NOTICE: %s\n' % warn_msg) + # Cython 3: Next cdef needs "noexcept" declaration unless # the compiler directive "legacy_implicit_noexcept" is used # ("noexcept" syntax supported since Cython 0.29.31). @@ -135,18 +137,22 @@ cdef void error_h(const char *fmt, char*msg): warn_msg = format sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg) -# check library version + +# Check library version. cdef geos_version(): return PyBytes_FromString(GEOSversion()) -__geos_version__ = geos_version() # module variable. + +# Module variables. +__geos_version__ = geos_version() __geos_major_version__ = GEOS_VERSION_MAJOR -#if __geos_version__ != "2.2.3-CAPI-1.1.1": -# raise ValueError('version 2.2.3 of the geos library is required') -# intialize GEOS (parameters are notice and error function callbacks). + +# Initialize GEOS (parameters are notice and error function callbacks). initGEOS(notice_h, error_h) + cdef class BaseGeometry: + cdef GEOSGeometry *_geom cdef unsigned int _npts cdef public object boundary @@ -168,7 +174,7 @@ cdef class BaseGeometry: cdef char answer g1 = self._geom g2 = geom._geom - answer = GEOSWithin(g1, g2) + answer = GEOSWithin(g1, g2) if answer: return True else: @@ -190,7 +196,7 @@ cdef class BaseGeometry: elif typeid == GEOS_LINESTRING: b = _get_coords(g3) p = LineString(b) - # for multi-geom structures, just return first one. + # For multi-geom structures, just return first one. elif typeid == GEOS_MULTIPOLYGON: numgeoms = GEOSGetNumGeometries(g3) gout = GEOSGetGeometryN(g3, 0) @@ -215,7 +221,7 @@ cdef class BaseGeometry: cdef int numgeoms, i, typeid g1 = self._geom tolerance = tol - g3 = GEOSSimplify(g1,tolerance) + g3 = GEOSSimplify(g1, tolerance) typeid = GEOSGeomTypeId(g3) if typeid == GEOS_POLYGON: b = _get_coords(g3) @@ -223,7 +229,7 @@ cdef class BaseGeometry: elif typeid == GEOS_LINESTRING: b = _get_coords(g3) p = LineString(b) - # for multi-geom structures, just return first one. + # For multi-geom structures, just return first one. elif typeid == GEOS_MULTIPOLYGON: numgeoms = GEOSGetNumGeometries(g3) gout = GEOSGetGeometryN(g3, 0) @@ -254,7 +260,7 @@ cdef class BaseGeometry: elif typeid == GEOS_LINESTRING: b = _get_coords(g3) p = LineString(b) - # for multi-geom structures, just return first one. + # For multi-geom structures, just return first one. elif typeid == GEOS_MULTIPOLYGON: numgeoms = GEOSGetNumGeometries(g3) gout = GEOSGetGeometryN(g3, 0) @@ -277,7 +283,7 @@ cdef class BaseGeometry: cdef char answer g1 = self._geom g2 = geom._geom - answer = GEOSIntersects(g1, g2) + answer = GEOSIntersects(g1, g2) if answer: return True else: @@ -292,7 +298,7 @@ cdef class BaseGeometry: cdef int numgeoms, i, typeid g1 = self._geom g2 = geom._geom - g3 = GEOSIntersection(g1, g2) + g3 = GEOSIntersection(g1, g2) typeid = GEOSGeomTypeId(g3) if typeid == GEOS_POLYGON: b = _get_coords(g3) @@ -305,7 +311,7 @@ cdef class BaseGeometry: elif typeid == GEOS_MULTIPOLYGON: numgeoms = GEOSGetNumGeometries(g3) pout = [] - for i from 0 <= i < numgeoms: + for i in range(numgeoms): gout = GEOSGetGeometryN(g3, i) b = _get_coords(gout) p = Polygon(b) @@ -313,7 +319,7 @@ cdef class BaseGeometry: elif typeid == GEOS_MULTILINESTRING: numgeoms = GEOSGetNumGeometries(g3) pout = [] - for i from 0 <= i < numgeoms: + for i in range(numgeoms): gout = GEOSGetGeometryN(g3, i) b = _get_coords(gout) p = LineString(b) @@ -321,7 +327,7 @@ cdef class BaseGeometry: elif typeid == GEOS_GEOMETRYCOLLECTION: numgeoms = GEOSGetNumGeometries(g3) pout = [] - for i from 0 <= i < numgeoms: + for i in range(numgeoms): gout = GEOSGetGeometryN(g3, i) typeid = GEOSGeomTypeId(gout) if typeid == GEOS_POLYGON: @@ -359,8 +365,9 @@ cdef class BaseGeometry: def __reduce__(self): """special method that allows geos instance to be pickled""" - return (self.__class__,(self.boundary,)) - + return (self.__class__, (self.boundary,)) + + cdef class Polygon(BaseGeometry): def __init__(self, ndarray b): @@ -370,32 +377,28 @@ cdef class Polygon(BaseGeometry): cdef GEOSCoordSequence *cs cdef GEOSGeometry *lr - - - # make sure data is contiguous. - # if not, make a local copy. + # Make sure data is contiguous. If not, make a local copy. if not PyArray_ISCONTIGUOUS(b): b = b.copy() m = b.shape[0] - + # Add closing coordinates to sequence? - if m > 0 and (b[-1,0] != b[0,0] or b[-1,1] != b[0,1]): + if m > 0 and (b[-1, 0] != b[0, 0] or b[-1, 1] != b[0, 1]): M = m + 1 else: M = m self._npts = M - # Create a coordinate sequence + # Create a coordinate sequence. cs = GEOSCoordSeq_create(M, 2) - # add to coordinate sequence + # Add to coordinate sequence. bbuffer = b.data - for i from 0 <= i < m: - dx = bbuffer[2*i] - dy = bbuffer[2*i+1] - # Because of a bug in the GEOS C API, - # always set X before Y + for i in range(m): + dx = bbuffer[2 * i] + dy = bbuffer[2 * i + 1] + # Because of a bug in the GEOS C API, always set X before Y. GEOSCoordSeq_setX(cs, i, dx) GEOSCoordSeq_setY(cs, i, dy) @@ -403,69 +406,76 @@ cdef class Polygon(BaseGeometry): if M > m: dx = bbuffer[0] dy = bbuffer[1] - GEOSCoordSeq_setX(cs, M-1, dx) - GEOSCoordSeq_setY(cs, M-1, dy) + GEOSCoordSeq_setX(cs, M - 1, dx) + GEOSCoordSeq_setY(cs, M - 1, dy) - # create LinearRing + # Create LinearRing. lr = GEOSGeom_createLinearRing(cs) - # create Polygon from LinearRing (assuming no holes) - self._geom = GEOSGeom_createPolygon(lr,NULL,0) + # Create Polygon from LinearRing (assuming no holes). + self._geom = GEOSGeom_createPolygon(lr, NULL, 0) self.boundary = b - def area(self): cdef double area GEOSArea(self._geom, &area) return area + cdef class LineString(BaseGeometry): + def __init__(self, ndarray b): + cdef double dx, dy cdef GEOSCoordSequence *cs cdef int i, M cdef double *bbuffer - # make sure data is contiguous. - # if not, make a local copy. + # Make sure data is contiguous. If not, make a local copy. if not PyArray_ISCONTIGUOUS(b): b = b.copy() M = b.shape[0] self._npts = M - # Create a coordinate sequence + # Create a coordinate sequence. cs = GEOSCoordSeq_create(M, 2) - # add to coordinate sequence + # Add to coordinate sequence. bbuffer = b.data - for i from 0 <= i < M: - dx = bbuffer[2*i] - dy = bbuffer[2*i+1] - # Because of a bug in the GEOS C API, - # always set X before Y + for i in range(M): + dx = bbuffer[2 * i] + dy = bbuffer[2 * i + 1] + # Because of a bug in the GEOS C API, always set X before Y. GEOSCoordSeq_setX(cs, i, dx) GEOSCoordSeq_setY(cs, i, dy) - # create LineString + # Create LineString. self._geom = GEOSGeom_createLineString(cs) self.boundary = b + cdef class Point(BaseGeometry): - cdef public x,y + + cdef public x, y def __init__(self, b): + cdef double dx, dy cdef GEOSCoordSequence *cs - # Create a coordinate sequence + + # Create a coordinate sequence. cs = GEOSCoordSeq_create(1, 2) - dx = b[0]; dy = b[1] + dx = b[0] + dy = b[1] GEOSCoordSeq_setX(cs, 0, dx) GEOSCoordSeq_setY(cs, 0, dy) self._geom = GEOSGeom_createPoint(cs) self._npts = 1 self.boundary = b + cdef _get_coords(const GEOSGeometry *geom): + cdef const GEOSCoordSequence *cs cdef const GEOSGeometry *lr cdef unsigned int i, M @@ -478,11 +488,11 @@ cdef _get_coords(const GEOSGeometry *geom): else: cs = GEOSGeom_getCoordSeq(geom) GEOSCoordSeq_getSize(cs, &M) - b = numpy.empty((M,2), numpy.float64) + b = numpy.empty((M, 2), numpy.float64) bbuffer = b.data - for i from 0 <= i < M: + for i in range(M): GEOSCoordSeq_getX(cs, i, &dx) GEOSCoordSeq_getY(cs, i, &dy) - bbuffer[2*i] = dx - bbuffer[2*i+1] = dy + bbuffer[2 * i] = dx + bbuffer[2 * i + 1] = dy return b From 0c030581cab629af1e9424dfea44e95bb5820a7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sun, 7 Jan 2024 11:44:28 +0100 Subject: [PATCH 078/210] Update matplotlib upper pin to 3.9 --- CHANGELOG.md | 1 + packages/basemap/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 738c3009c..d59ff915e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ https://semver.org/spec/v2.0.0.html - Upgrade `pillow` upper limit to 10.2.0. - Update library dependencies: - Upgrade upper limit for `numpy` to 1.27.0. + - Upgrade upper limit for `matplotlib` to 3.9.0. - Downgrade upper limit for `pyproj` to 2.2.0 for Python 2.7. - Set dependency on `packaging` as replacement for `distutils`. - Update build dependencies: diff --git a/packages/basemap/requirements.txt b/packages/basemap/requirements.txt index 242b6e4d8..3c028489e 100644 --- a/packages/basemap/requirements.txt +++ b/packages/basemap/requirements.txt @@ -18,7 +18,7 @@ matplotlib >= 1.5, < 3.0; python_version == "2.7" matplotlib >= 1.5, < 2.0; python_version == "3.2" matplotlib >= 1.5, < 2.0; python_version == "3.3" matplotlib >= 1.5, < 3.0; python_version == "3.4" -matplotlib >= 1.5, < 3.8; python_version >= "3.5" +matplotlib >= 1.5, < 3.9; python_version >= "3.5" pyproj >= 1.9.3, < 2.1.0; python_version == "2.6" pyproj >= 1.9.3, < 2.2.0; python_version == "2.7" From 8682c409bdebe46fd1b944f153817e9d54e0e2d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sun, 7 Jan 2024 12:48:14 +0100 Subject: [PATCH 079/210] Fix QuadContourSet breaking change becoming Artist subclass Solves GitHub issue #594. --- CHANGELOG.md | 6 ++++ .../src/mpl_toolkits/basemap/__init__.py | 31 ++++++++++++++----- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d59ff915e..294cbe4c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,6 +72,10 @@ https://semver.org/spec/v2.0.0.html Clang 16 and GCC 14 (PR [#595] by @fweimer-rh). - Apply basic cleanup of `_geoslib.pyx` source code (i.e. basic linting, removal of commented code, version update). +- Fix breaking change from `matplotlib` 3.8 due to the promotion of + `QuadContourSet` objects into `Artist` objects, which affected + `Basemap.contour`, `Basemap.contourf` and `Basemap.nightshade` + (solves issue [#594]). ### Removed - Attribute `__version__` in `mpl_toolkits.basemap.proj` module. @@ -1077,6 +1081,8 @@ https://semver.org/spec/v2.0.0.html [#595]: https://github.com/matplotlib/basemap/pull/595 +[#594] +https://github.com/matplotlib/basemap/issues/594 [#593]: https://github.com/matplotlib/basemap/pull/593 [#592]: diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index d88c13f71..25796b1ab 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -31,6 +31,7 @@ import numpy.ma as ma import matplotlib as mpl +from matplotlib.artist import Artist from matplotlib.collections import LineCollection from matplotlib.collections import PolyCollection from matplotlib.image import imread @@ -3592,7 +3593,11 @@ def contour(self,x,y,data,*args,**kwargs): # set axes limits to fit map region. self.set_axes_limits(ax=ax) # clip to map limbs - CS.collections,c = self._cliplimb(ax,CS.collections) + if isinstance(CS, Artist): + # Since MPL 3.8, `QuadContourSet` objects are `Artist` objects too. + CS, c = self._cliplimb(ax, CS) + else: + CS.collections, c = self._cliplimb(ax, CS.collections) return CS @_transform @@ -3688,7 +3693,11 @@ def contourf(self,x,y,data,*args,**kwargs): # set axes limits to fit map region. self.set_axes_limits(ax=ax) # clip to map limbs - CS.collections,c = self._cliplimb(ax,CS.collections) + if isinstance(CS, Artist): + # Since MPL 3.8, `QuadContourSet` objects are `Artist` objects too. + CS, c = self._cliplimb(ax, CS) + else: + CS.collections, c = self._cliplimb(ax, CS.collections) return CS @_transformuv @@ -4733,12 +4742,18 @@ def nightshade(self,date,color="k",delta=0.25,alpha=0.5,ax=None,zorder=2): # contour the day-night grid, coloring the night area # with the specified color and transparency. CS = self.contourf(x,y,daynight,1,colors=[color],alpha=alpha,ax=ax) - # set zorder on ContourSet collections show night shading - # is on top. - for c in CS.collections: - c.set_zorder(zorder) - # clip to map limbs - CS.collections,c = self._cliplimb(ax,CS.collections) + if isinstance(CS, Artist): + # Since MPL 3.8, `QuadContourSet` objects are `Artist` objects too. + CS.set_zorder(zorder) + # clip to map limbs + CS, c = self._cliplimb(ax, CS) + else: + # set zorder on ContourSet collections show night shading + # is on top. + for c in CS.collections: + c.set_zorder(zorder) + # clip to map limbs + CS.collections, c = self._cliplimb(ax, CS.collections) return CS def _check_ax(self): From b0724a24d8c3b1aa60bc8b25c41f8e14130f965a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sun, 7 Jan 2024 17:43:14 +0100 Subject: [PATCH 080/210] Add tests covering bugfix for MPL 3.8 --- CHANGELOG.md | 4 +- .../test/mpl_toolkits/basemap/test_Basemap.py | 44 +++++++++++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 294cbe4c9..e23816295 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,7 +75,7 @@ https://semver.org/spec/v2.0.0.html - Fix breaking change from `matplotlib` 3.8 due to the promotion of `QuadContourSet` objects into `Artist` objects, which affected `Basemap.contour`, `Basemap.contourf` and `Basemap.nightshade` - (solves issue [#594]). + (solves issue [#594], thanks to @qianwu2 and @rcomer). ### Removed - Attribute `__version__` in `mpl_toolkits.basemap.proj` module. @@ -1081,7 +1081,7 @@ https://semver.org/spec/v2.0.0.html [#595]: https://github.com/matplotlib/basemap/pull/595 -[#594] +[#594]: https://github.com/matplotlib/basemap/issues/594 [#593]: https://github.com/matplotlib/basemap/pull/593 diff --git a/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py b/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py index e614d982a..2565c1569 100644 --- a/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py +++ b/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py @@ -1,5 +1,6 @@ """Import test for the :mod:`mpl_toolkits.basemap.Basemap` class.""" +import datetime as dt try: import unittest2 as unittest except ImportError: @@ -9,6 +10,7 @@ import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.collections import LineCollection +from matplotlib.contour import QuadContourSet from matplotlib.image import AxesImage from matplotlib.patches import Polygon from mpl_toolkits.basemap import Basemap @@ -204,6 +206,48 @@ def test_shadedrelief_with_custom_axes(self): _, axs = plt.subplots() self.test_shadedrelief(axs=axs, axslen0=10) + def _test_generic_contour_function(self, function): + """Generic test for the `contour` and `contourf` methods.""" + + bmap = Basemap(projection="ortho", lat_0=45, lon_0=-100, resolution=None) + + # Create a regular lat/lon grid. + nlats = 73 + nlons = 145 + delta = 2 * np.pi / (nlons - 1) + indx = np.indices((nlats, nlons)) + lats = (0.5 * np.pi - delta * indx[0, :, :]) + lons = (delta * indx[1, :, :]) + + # Create some data the regular lat/lon grid. + mean = 0.50 * np.cos(2 * lats) * ((np.sin(2 * lats))**2 + 2) + wave = 0.75 * np.cos(4 * lons) * np.sin(2 * lats)**8 + data = mean + wave + + # Compute native map projection coordinates of lat/lon grid. + x, y = bmap(np.degrees(lons), np.degrees(lats)) + + # Contour data over the map and check output. + cset = getattr(bmap, function)(x, y, data, 15) + self.assertIsInstance(cset, QuadContourSet) + + def test_contour(self): + """Test drawing contours on a map.""" + + self._test_generic_contour_function("contour") + + def test_contourf(self): + """Test drawing filled contours on a map.""" + + self._test_generic_contour_function("contourf") + + def test_nightshade(self): + """Test drawing the day/night terminator and night shade on a map.""" + + bmap = Basemap(projection="mill", lon_0=180) + cset = bmap.nightshade(date=dt.datetime(1970, 1, 1)) + self.assertIsInstance(cset, QuadContourSet) + class TestMplToolkitsBasemapBasemapCall(unittest.TestCase): """Unittest class for :meth:`mpl_toolkits.basemap.Basemap.__call__`.""" From 232f1818d6eeaf5951b68af80cd78c44353f68bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sun, 7 Jan 2024 20:07:14 +0100 Subject: [PATCH 081/210] Reformat CHANGELOG since 1.3.0 --- CHANGELOG.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e23816295..4ddb4c9a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -258,21 +258,21 @@ https://semver.org/spec/v2.0.0.html ### Added - Precompiled binary wheels available in PyPI. -- Complete workflow to build the project wheels for Windows and GNU/Linux - using GitHub Actions. +- Complete workflow to build the project wheels for Windows and + GNU/Linux using GitHub Actions. ### Changed -- Reorganise the package structure. In summary, the former `basemap` package - is split in three: +- Reorganise the package structure. In summary, the former `basemap` + package is split in three: - `basemap` itself contains the Python modules. - - `basemap-data` contains the mandatory data assets required by `basemap` - to provide minimal functionality. + - `basemap-data` contains the mandatory data assets required by + `basemap` to provide minimal functionality. - `basemap-data-hires` contains the high-resolution data assets. - This change together with the precompiled binary wheels in PyPI should solve - most of the former installation problems (see issues [#403], [#405], [#422], - [#436], [#445], [#456], [#461], [#488], [#489], [#491], [#510], [#513], - [#525], [#526] and [#535]). + This change together with the precompiled binary wheels in PyPI should + solve most of the former installation problems (see issues [#403], + [#405], [#422], [#436], [#445], [#456], [#461], [#488], [#489], + [#491], [#510], [#513], [#525], [#526] and [#535]). - Upgrade default GEOS library dependency to 3.5.1. - Update and clarify licenses. In summary: - `basemap`: MIT license. @@ -284,14 +284,14 @@ https://semver.org/spec/v2.0.0.html ### Fixed - Fix `Basemap.pcolormesh` for `"ortho"` projection (PR [#476]). - Fix `Basemap.arcgisimage` for cylindrical coordinates (PR [#505]). -- Force `setup.py` to cythonize `_geoslib.pyx` at compile time (issues [#487], - [#518] and [#521]). -- Update `README` files and apply corrections and changes to outdated content - (issue [#179]). +- Force `setup.py` to cythonize `_geoslib.pyx` at compile time (issues + [#487], [#518] and [#521]). +- Update `README` files and apply corrections and changes to outdated + content (issue [#179]). ### Removed -- Bundled GEOS source code. The same source code can be downloaded using the - `GeosLibrary` class in `utils` (issue [#228]). +- Bundled GEOS source code. The same source code can be downloaded using + the `GeosLibrary` class in `utils` (issue [#228]). - Precompiled `_geoslib.c` file (issue [#437]). ## [1.2.2] - 2020-08-04 From 91390d88badfac7a1378350a19a01b4331923dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sun, 7 Jan 2024 20:08:15 +0100 Subject: [PATCH 082/210] Upgrade from Debian 9 to 10 in basemap-for-manylinux workflow --- .github/workflows/basemap-for-manylinux.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index 2773e52c8..9b8ad941f 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -44,7 +44,7 @@ jobs: max-parallel: 3 fail-fast: false needs: checkout - container: "pylegacy/python:${{ matrix.python-version }}-debian-9" + container: "pylegacy/python:${{ matrix.python-version }}-debian-10" steps: - name: Download checkout @@ -218,7 +218,7 @@ jobs: fail-fast: false needs: build runs-on: ubuntu-latest - container: "pylegacy/${{ matrix.arch }}-python:3.8-debian-9" + container: "pylegacy/${{ matrix.arch }}-python:3.8-debian-10" steps: - name: Download GEOS artifacts @@ -263,15 +263,15 @@ jobs: # Missing precompiled binaries for `lxml`. - arch: "x64" python-version: "3.12" - # Missing precompiled binaries for `numpy`, `matplotlib`, `pyproj`, - # `pillow` and `lxml`. + # Missing precompiled binaries for `numpy`, `matplotlib`, + # `pyproj`, `pillow` and `lxml`. - arch: "x86" python-version: "3.12" max-parallel: 3 fail-fast: false needs: repair runs-on: ubuntu-latest - container: "pylegacy/${{ matrix.arch }}-python:${{ matrix.python-version }}-debian-9" + container: "pylegacy/${{ matrix.arch }}-python:${{ matrix.python-version }}-debian-10" steps: - name: Download checkout @@ -320,7 +320,7 @@ jobs: coverage: needs: test runs-on: ubuntu-latest - container: "pylegacy/python:3.8-debian-9" + container: "pylegacy/python:3.8-debian-10" steps: - name: Checkout @@ -353,7 +353,7 @@ jobs: docs: needs: test runs-on: ubuntu-latest - container: "pylegacy/python:3.8-debian-9" + container: "pylegacy/python:3.8-debian-10" steps: - name: Download checkout @@ -421,7 +421,7 @@ jobs: if: startsWith(github.event.ref, 'refs/tags/v') needs: test runs-on: ubuntu-latest - container: "pylegacy/${{ matrix.arch }}-python:${{ matrix.python-version }}-debian-9" + container: "pylegacy/${{ matrix.arch }}-python:${{ matrix.python-version }}-debian-10" environment: PyPI steps: - From 8fa267f43327bbef19f67541be0944f2e47c7164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sun, 7 Jan 2024 20:08:39 +0100 Subject: [PATCH 083/210] Enable manylinux tests for Python 3.12 and x64 --- .github/workflows/basemap-for-manylinux.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index 9b8ad941f..35243d8a5 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -260,9 +260,6 @@ jobs: python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] exclude: - # Missing precompiled binaries for `lxml`. - - arch: "x64" - python-version: "3.12" # Missing precompiled binaries for `numpy`, `matplotlib`, # `pyproj`, `pillow` and `lxml`. - arch: "x86" From e74c4e9ce6dd3f092f9fec8624ebdca15d976a20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 8 Jan 2024 11:39:42 +0100 Subject: [PATCH 084/210] Add missing issue reference to CHANGELOG --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ddb4c9a7..4969982d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ https://semver.org/spec/v2.0.0.html ## [Unreleased] ### Added -- Support for Python 3.12. +- Support for Python 3.12 (solves issue [#590]). - Complete support for `basemap` in `conda-forge` channel for the major platforms on x64 and for MacOS on arm64 (solves issue [#286]). - Precompiled wheels for MacOS x64 and arm64 on PyPI (solves issues @@ -1089,6 +1089,8 @@ https://github.com/matplotlib/basemap/pull/593 https://github.com/matplotlib/basemap/issues/592 [#591]: https://github.com/matplotlib/basemap/issues/591 +[#590]: +https://github.com/matplotlib/basemap/issues/590 [#589]: https://github.com/matplotlib/basemap/issues/589 [#583]: From cba0ebcd77063d004e8f6ff4734a1c62047ae8ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 8 Jan 2024 13:05:32 +0100 Subject: [PATCH 085/210] Update copyright notices With this commit, I would like to state more clearly that contributions are currently performed on behalf of the Matplotlib development team. The selection of start/end years for the copyright headers are based on the first/last time that each copyright holder committed to this repository. --- LICENSE | 3 ++- packages/basemap/LICENSE | 3 ++- packages/basemap/doc/source/conf.py | 2 +- packages/basemap/utils/GeosLibrary.py | 6 +++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/LICENSE b/LICENSE index b74d728bb..120eb7e3f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,5 @@ -Copyright (c) 2011 Jeffrey Whitaker +Copyright (c) 2011-2014 Jeffrey Whitaker +Copyright (c) 2015-2024 The Matplotlib development team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/packages/basemap/LICENSE b/packages/basemap/LICENSE index b74d728bb..120eb7e3f 100644 --- a/packages/basemap/LICENSE +++ b/packages/basemap/LICENSE @@ -1,4 +1,5 @@ -Copyright (c) 2011 Jeffrey Whitaker +Copyright (c) 2011-2014 Jeffrey Whitaker +Copyright (c) 2015-2024 The Matplotlib development team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/packages/basemap/doc/source/conf.py b/packages/basemap/doc/source/conf.py index 8f46e913e..460d15c92 100644 --- a/packages/basemap/doc/source/conf.py +++ b/packages/basemap/doc/source/conf.py @@ -22,7 +22,7 @@ # -- Project information ----------------------------------------------- project = myself.__name__.rsplit(".", 1)[-1] -copyright = "2011 Jeffrey Whitaker; 2016-2024 The Matplotlib development team" +copyright = "2011-2014 Jeffrey Whitaker; 2015-2024 The Matplotlib development team" author = "Jeffrey Whitaker" # The short X.Y version diff --git a/packages/basemap/utils/GeosLibrary.py b/packages/basemap/utils/GeosLibrary.py index 6fab5945c..4db6b88e9 100644 --- a/packages/basemap/utils/GeosLibrary.py +++ b/packages/basemap/utils/GeosLibrary.py @@ -2,17 +2,17 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2021-2024 Víctor Molina García - +# # GeosLibrary.py is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. - +# # GeosLibrary.py is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. - +# # You should have received a copy of the GNU Lesser General Public License # along with GeosLibrary.py. If not, see . # From 4633f3e4a6ff40e464cbcaa098f6fdf029aa765a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 8 Jan 2024 16:56:53 +0100 Subject: [PATCH 086/210] Sanitise _setlatlab function --- .../src/mpl_toolkits/basemap/__init__.py | 58 ++++++++++--------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index 25796b1ab..cb0017354 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -5353,39 +5353,43 @@ def _setlonlab(fmt,lon,labelstyle): lonlab = lonlabstr%lon return lonlab -def _setlatlab(fmt,lat,labelstyle): - # set lat label string (called by Basemap.drawparallels) - try: # fmt is a function that returns a formatted string - latlab = fmt(lat) - except: # fmt is a format string. - if lat<0: - if mpl.rcParams['text.usetex']: - if labelstyle=='+/-': - latlabstr = r'${\/-%s\/^{\circ}}$'%fmt + +def _setlatlab(fmt, lat, labelstyle): + """Set latitude label string (called by :meth:`Basemap.drawparallels`).""" + + try: + # `fmt` is a function that returns a formatted string. + latlab = fmt(lat) + except: + # `fmt` is a format string. + if lat < 0: + if mpl.rcParams["text.usetex"]: + if labelstyle == "+/-": + latlabstr = r"${\/-%s\/^{\circ}}$" % fmt else: - latlabstr = r'${%s\/^{\circ}\/S}$'%fmt + latlabstr = r"${%s\/^{\circ}\/S}$" % fmt else: - if labelstyle=='+/-': - latlabstr = u'-%s\N{DEGREE SIGN}'%fmt + if labelstyle == "+/-": + latlabstr = u"-%s\N{DEGREE SIGN}" % fmt else: - latlabstr = u'%s\N{DEGREE SIGN}S'%fmt - latlab = latlabstr%np.fabs(lat) - elif lat>0: - if mpl.rcParams['text.usetex']: - if labelstyle=='+/-': - latlabstr = r'${\/+%s\/^{\circ}}$'%fmt + latlabstr = u"%s\N{DEGREE SIGN}S" % fmt + latlab = latlabstr % np.fabs(lat) + elif lat > 0: + if mpl.rcParams["text.usetex"]: + if labelstyle == "+/-": + latlabstr = r"${\/+%s\/^{\circ}}$" % fmt else: - latlabstr = r'${%s\/^{\circ}\/N}$'%fmt + latlabstr = r"${%s\/^{\circ}\/N}$" % fmt else: - if labelstyle=='+/-': - latlabstr = u'+%s\N{DEGREE SIGN}'%fmt + if labelstyle == "+/-": + latlabstr = u"+%s\N{DEGREE SIGN}" % fmt else: - latlabstr = u'%s\N{DEGREE SIGN}N'%fmt - latlab = latlabstr%lat + latlabstr = u"%s\N{DEGREE SIGN}N" % fmt + latlab = latlabstr % lat else: - if mpl.rcParams['text.usetex']: - latlabstr = r'${%s\/^{\circ}}$'%fmt + if mpl.rcParams["text.usetex"]: + latlabstr = r"${%s\/^{\circ}}$" % fmt else: - latlabstr = u'%s\N{DEGREE SIGN}'%fmt - latlab = latlabstr%lat + latlabstr = u"%s\N{DEGREE SIGN}" % fmt + latlab = latlabstr % lat return latlab From b1b009bd0c3b88ec7fbbd4b0e25a48dced515bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 8 Jan 2024 17:05:09 +0100 Subject: [PATCH 087/210] Sanitise _setlonlab function --- .../src/mpl_toolkits/basemap/__init__.py | 56 ++++++++++--------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index cb0017354..491e956bf 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -5316,41 +5316,45 @@ def __delitem__(self,key): self[key].remove() super(_dict, self).__delitem__(key) -def _setlonlab(fmt,lon,labelstyle): - # set lon label string (called by Basemap.drawmeridians) - try: # fmt is a function that returns a formatted string + +def _setlonlab(fmt, lon, labelstyle): + """Set longitude label string (called by :meth:`Basemap.drawmeridians`).""" + + try: + # `fmt` is a function that returns a formatted string. lonlab = fmt(lon) - except: # fmt is a format string. - if lon>180: - if mpl.rcParams['text.usetex']: - if labelstyle=='+/-': - lonlabstr = r'${\/-%s\/^{\circ}}$'%fmt + except: + # `fmt` is a format string. + if lon > 180: + if mpl.rcParams["text.usetex"]: + if labelstyle == "+/-": + lonlabstr = r"${\/-%s\/^{\circ}}$" % fmt else: - lonlabstr = r'${%s\/^{\circ}\/W}$'%fmt + lonlabstr = r"${%s\/^{\circ}\/W}$" % fmt else: - if labelstyle=='+/-': - lonlabstr = u'-%s\N{DEGREE SIGN}'%fmt + if labelstyle == "+/-": + lonlabstr = u"-%s\N{DEGREE SIGN}" % fmt else: - lonlabstr = u'%s\N{DEGREE SIGN}W'%fmt - lonlab = lonlabstr%np.fabs(lon-360) - elif lon<180 and lon != 0: - if mpl.rcParams['text.usetex']: - if labelstyle=='+/-': - lonlabstr = r'${\/+%s\/^{\circ}}$'%fmt + lonlabstr = u"%s\N{DEGREE SIGN}W" % fmt + lonlab = lonlabstr % np.fabs(lon - 360) + elif lon < 180 and lon != 0: + if mpl.rcParams["text.usetex"]: + if labelstyle == "+/-": + lonlabstr = r"${\/+%s\/^{\circ}}$" % fmt else: - lonlabstr = r'${%s\/^{\circ}\/E}$'%fmt + lonlabstr = r"${%s\/^{\circ}\/E}$" % fmt else: - if labelstyle=='+/-': - lonlabstr = u'+%s\N{DEGREE SIGN}'%fmt + if labelstyle == "+/-": + lonlabstr = u"+%s\N{DEGREE SIGN}" % fmt else: - lonlabstr = u'%s\N{DEGREE SIGN}E'%fmt - lonlab = lonlabstr%lon + lonlabstr = u"%s\N{DEGREE SIGN}E" % fmt + lonlab = lonlabstr % lon else: - if mpl.rcParams['text.usetex']: - lonlabstr = r'${%s\/^{\circ}}$'%fmt + if mpl.rcParams["text.usetex"]: + lonlabstr = r"${%s\/^{\circ}}$" % fmt else: - lonlabstr = u'%s\N{DEGREE SIGN}'%fmt - lonlab = lonlabstr%lon + lonlabstr = u"%s\N{DEGREE SIGN}" % fmt + lonlab = lonlabstr % lon return lonlab From 8c12bb4c1e10ec4e80b510b0dd7f5327f96e9974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 8 Jan 2024 19:24:55 +0100 Subject: [PATCH 088/210] Replace unicode literals in _setlatlab --- packages/basemap/src/mpl_toolkits/basemap/__init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index 491e956bf..7648de980 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -5366,6 +5366,7 @@ def _setlatlab(fmt, lat, labelstyle): latlab = fmt(lat) except: # `fmt` is a format string. + degchar = b"\xc2\xb0".decode("utf-8") if lat < 0: if mpl.rcParams["text.usetex"]: if labelstyle == "+/-": @@ -5374,9 +5375,9 @@ def _setlatlab(fmt, lat, labelstyle): latlabstr = r"${%s\/^{\circ}\/S}$" % fmt else: if labelstyle == "+/-": - latlabstr = u"-%s\N{DEGREE SIGN}" % fmt + latlabstr = r"-%s%s" % (fmt, degchar) else: - latlabstr = u"%s\N{DEGREE SIGN}S" % fmt + latlabstr = r"%s%sS" % (fmt, degchar) latlab = latlabstr % np.fabs(lat) elif lat > 0: if mpl.rcParams["text.usetex"]: @@ -5386,14 +5387,14 @@ def _setlatlab(fmt, lat, labelstyle): latlabstr = r"${%s\/^{\circ}\/N}$" % fmt else: if labelstyle == "+/-": - latlabstr = u"+%s\N{DEGREE SIGN}" % fmt + latlabstr = r"+%s%s" % (fmt, degchar) else: - latlabstr = u"%s\N{DEGREE SIGN}N" % fmt + latlabstr = r"%s%sN" % (fmt, degchar) latlab = latlabstr % lat else: if mpl.rcParams["text.usetex"]: latlabstr = r"${%s\/^{\circ}}$" % fmt else: - latlabstr = u"%s\N{DEGREE SIGN}" % fmt + latlabstr = r"%s%s" % (fmt, degchar) latlab = latlabstr % lat return latlab From 8ec80c629fe24a55ba8ba8dcda5ee43c027424f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 8 Jan 2024 19:25:08 +0100 Subject: [PATCH 089/210] Replace unicode literals in _setlonlab --- packages/basemap/src/mpl_toolkits/basemap/__init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index 7648de980..7c6c0108d 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -5325,6 +5325,7 @@ def _setlonlab(fmt, lon, labelstyle): lonlab = fmt(lon) except: # `fmt` is a format string. + degchar = b"\xc2\xb0".decode("utf-8") if lon > 180: if mpl.rcParams["text.usetex"]: if labelstyle == "+/-": @@ -5333,9 +5334,9 @@ def _setlonlab(fmt, lon, labelstyle): lonlabstr = r"${%s\/^{\circ}\/W}$" % fmt else: if labelstyle == "+/-": - lonlabstr = u"-%s\N{DEGREE SIGN}" % fmt + lonlabstr = r"-%s%s" % (fmt, degchar) else: - lonlabstr = u"%s\N{DEGREE SIGN}W" % fmt + lonlabstr = r"%s%sW" % (fmt, degchar) lonlab = lonlabstr % np.fabs(lon - 360) elif lon < 180 and lon != 0: if mpl.rcParams["text.usetex"]: @@ -5345,15 +5346,15 @@ def _setlonlab(fmt, lon, labelstyle): lonlabstr = r"${%s\/^{\circ}\/E}$" % fmt else: if labelstyle == "+/-": - lonlabstr = u"+%s\N{DEGREE SIGN}" % fmt + lonlabstr = r"+%s%s" % (fmt, degchar) else: - lonlabstr = u"%s\N{DEGREE SIGN}E" % fmt + lonlabstr = r"%s%sE" % (fmt, degchar) lonlab = lonlabstr % lon else: if mpl.rcParams["text.usetex"]: lonlabstr = r"${%s\/^{\circ}}$" % fmt else: - lonlabstr = u"%s\N{DEGREE SIGN}" % fmt + lonlabstr = r"%s%s" % (fmt, degchar) lonlab = lonlabstr % lon return lonlab From 84e98209f18a4f8b91043c41112993e39a4b8a53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 8 Jan 2024 19:53:07 +0100 Subject: [PATCH 090/210] Replace unicode literals in Basemap.drawmapscale --- .../basemap/src/mpl_toolkits/basemap/__init__.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index 7c6c0108d..e0a4e1e15 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -4528,20 +4528,21 @@ def drawmapscale(self,lon,lat,lon0,lat0,length,barstyle='simple',\ xc,yc = self(lon,lat) # make sure lon_0 between -180 and 180 lon_0 = ((lon0+360) % 360) - 360 + degchar = b"\xc2\xb0".decode("utf-8") if lat0>0: if lon>0: - lonlatstr = u'%g\N{DEGREE SIGN}N, %g\N{DEGREE SIGN}E' % (lat0,lon_0) + lonlatstr = '%g%sN, %g%sE' % (lat0, degchar, lon_0, degchar) elif lon<0: - lonlatstr = u'%g\N{DEGREE SIGN}N, %g\N{DEGREE SIGN}W' % (lat0,lon_0) + lonlatstr = '%g%sN, %g%sW' % (lat0, degchar, lon_0, degchar) else: - lonlatstr = u'%g\N{DEGREE SIGN}, %g\N{DEGREE SIGN}W' % (lat0,lon_0) + lonlatstr = '%g%s, %g%sW' % (lat0, degchar, lon_0, degchar) else: if lon>0: - lonlatstr = u'%g\N{DEGREE SIGN}S, %g\N{DEGREE SIGN}E' % (lat0,lon_0) + lonlatstr = '%g%sS, %g%sE' % (lat0, degchar, lon_0, degchar) elif lon<0: - lonlatstr = u'%g\N{DEGREE SIGN}S, %g\N{DEGREE SIGN}W' % (lat0,lon_0) + lonlatstr = '%g%sS, %g%sW' % (lat0, degchar, lon_0, degchar) else: - lonlatstr = u'%g\N{DEGREE SIGN}S, %g\N{DEGREE SIGN}' % (lat0,lon_0) + lonlatstr = '%g%sS, %g%s' % (lat0, degchar, lon_0, degchar) # left edge of scale lon1,lat1 = self(x0-length/2,y0,inverse=True) x1,y1 = self(lon1,lat1) From c2d4174eb568d96882fd4ad8b142e11be70cbf41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 8 Jan 2024 20:13:15 +0100 Subject: [PATCH 091/210] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4969982d7..fad8f287e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -78,6 +78,7 @@ https://semver.org/spec/v2.0.0.html (solves issue [#594], thanks to @qianwu2 and @rcomer). ### Removed +- Use of unicode literals within the library. - Attribute `__version__` in `mpl_toolkits.basemap.proj` module. - Module `mpl_toolkits.basemap.test`, whose content is migrated to the test suite in the `test` folder. From b5a71eec09a4f413c2e9ed4ee86e16cc387c2e1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 9 Jan 2024 10:15:03 +0100 Subject: [PATCH 092/210] Prepare for release 1.4.0 --- CHANGELOG.md | 6 ++++-- packages/basemap/README.md | 4 ++-- packages/basemap/src/_geoslib.pyx | 2 +- packages/basemap/src/mpl_toolkits/basemap/__init__.py | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fad8f287e..bf6bec7e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ https://keepachangelog.com/en/1.0.0/ https://semver.org/spec/v2.0.0.html -## [Unreleased] +## [1.4.0] - 2024-01-09 ### Added - Support for Python 3.12 (solves issue [#590]). @@ -1230,7 +1230,9 @@ https://github.com/matplotlib/basemap/issues/228 https://github.com/matplotlib/basemap/issues/179 [Unreleased]: -https://github.com/matplotlib/basemap/compare/v1.3.9...develop +https://github.com/matplotlib/basemap/compare/v1.4.0...develop +[1.4.0]: +https://github.com/matplotlib/basemap/compare/v1.3.9...v1.4.0 [1.3.9]: https://github.com/matplotlib/basemap/compare/v1.3.8...v1.3.9 [1.3.8]: diff --git a/packages/basemap/README.md b/packages/basemap/README.md index cfe0f6bf0..622e56303 100644 --- a/packages/basemap/README.md +++ b/packages/basemap/README.md @@ -45,6 +45,6 @@ https://spdx.org/licenses/LGPL-2.1-only.html https://spdx.org/licenses/MIT.html [`LICENSE`]: -https://github.com/matplotlib/basemap/blob/v1.3.9/packages/basemap/LICENSE +https://github.com/matplotlib/basemap/blob/v1.4.0/packages/basemap/LICENSE [`LICENSE.geos`]: -https://github.com/matplotlib/basemap/blob/v1.3.9/packages/basemap/LICENSE.geos +https://github.com/matplotlib/basemap/blob/v1.4.0/packages/basemap/LICENSE.geos diff --git a/packages/basemap/src/_geoslib.pyx b/packages/basemap/src/_geoslib.pyx index c82de52d2..f91dd333b 100644 --- a/packages/basemap/src/_geoslib.pyx +++ b/packages/basemap/src/_geoslib.pyx @@ -2,7 +2,7 @@ import sys import numpy cimport numpy as cnp -__version__ = "1.4.0-dev" +__version__ = "1.4.0" # Need some Python C-API functions for strings. diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index e0a4e1e15..e1ce7afc6 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -48,7 +48,7 @@ from . proj import Proj -__version__ = "1.4.0-dev" +__version__ = "1.4.0" # basemap data files now installed in lib/matplotlib/toolkits/basemap/data # check to see if environment variable BASEMAPDATA set to a directory, From 82e3231ad5f4e1a3286ce274999604b2b810c460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 9 Jan 2024 14:12:07 +0100 Subject: [PATCH 093/210] Start next development cycle 1.5.0-dev --- CHANGELOG.md | 2 ++ packages/basemap/src/_geoslib.pyx | 2 +- packages/basemap/src/mpl_toolkits/basemap/__init__.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf6bec7e2..7fc3aeb71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ https://keepachangelog.com/en/1.0.0/ https://semver.org/spec/v2.0.0.html +## [Unreleased] + ## [1.4.0] - 2024-01-09 ### Added diff --git a/packages/basemap/src/_geoslib.pyx b/packages/basemap/src/_geoslib.pyx index f91dd333b..676ac4d4b 100644 --- a/packages/basemap/src/_geoslib.pyx +++ b/packages/basemap/src/_geoslib.pyx @@ -2,7 +2,7 @@ import sys import numpy cimport numpy as cnp -__version__ = "1.4.0" +__version__ = "1.5.0-dev" # Need some Python C-API functions for strings. diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index e1ce7afc6..75bcecf9e 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -48,7 +48,7 @@ from . proj import Proj -__version__ = "1.4.0" +__version__ = "1.5.0-dev" # basemap data files now installed in lib/matplotlib/toolkits/basemap/data # check to see if environment variable BASEMAPDATA set to a directory, From f331bf9d023fee48a8832b4ddf4a66ccf3e5f9de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 10 Jan 2024 14:21:46 +0100 Subject: [PATCH 094/210] Add two closed issues to 1.4.0 CHANGELOG --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fc3aeb71..bb8dc0e40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,8 @@ https://semver.org/spec/v2.0.0.html [#447] and [#574]). - Renewed documentation, with fixes for the broken links and examples, an improved section on the installation process, and without the - deprecation/sunsetting section (solves issues [#527] and [#568]). + deprecation/sunsetting section (solves issues [#438], [#471], [#527] + and [#568]). - Optional argument `encoding_errors` for `Basemap.readshapefile` method (PR [#554] by @guziy, implements request [#552]). - Optional argument `cachedir` for `Basemap.arcgisimage` method to allow @@ -1196,6 +1197,8 @@ https://github.com/matplotlib/basemap/issues/487 https://github.com/matplotlib/basemap/issues/481 [#476]: https://github.com/matplotlib/basemap/pull/476 +[#471]: +https://github.com/matplotlib/basemap/issues/471 [#463]: https://github.com/matplotlib/basemap/issues/463 [#461]: @@ -1210,6 +1213,8 @@ https://github.com/matplotlib/basemap/issues/445 https://github.com/matplotlib/basemap/issues/444 [#443]: https://github.com/matplotlib/basemap/issues/443 +[#438]: +https://github.com/matplotlib/basemap/issues/438 [#437]: https://github.com/matplotlib/basemap/issues/437 [#436]: From fdd8647b092571c31b29ddad46f7235b679e3519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 11 Jan 2024 13:58:42 +0100 Subject: [PATCH 095/210] Update README with latest wheels available in PyPI --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0f6c19781..21b98ad39 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,9 @@ python -m pip install basemap-data python -m pip install basemap-data-hires ``` -Precompiled `basemap` binary wheels for Windows and GNU/Linux are also -available in PyPI (architectures x86 and x64, Python 2.7 and 3.5+): +Precompiled `basemap` binary wheels for Windows and GNU/Linux +(architectures x86 and x64, Python 2.7 and 3.5+) as well as for MacOS +(architectures x64 and arm64, Python 3.9+) are also available in PyPI: ```sh python -m pip install basemap ``` From a3112f147b57206b8e10ee8b9abebde040fee0b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 11 Jan 2024 14:00:26 +0100 Subject: [PATCH 096/210] Exclude .DS_Store folders from distributables --- CHANGELOG.md | 3 +++ packages/basemap/MANIFEST.in | 1 + 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb8dc0e40..4aa0075f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ https://semver.org/spec/v2.0.0.html ## [Unreleased] +### Fixed +- Set recursive exclusion for `.DS_Store` folders in `MANIFEST.in`. + ## [1.4.0] - 2024-01-09 ### Added diff --git a/packages/basemap/MANIFEST.in b/packages/basemap/MANIFEST.in index 0ea74f384..93b419369 100644 --- a/packages/basemap/MANIFEST.in +++ b/packages/basemap/MANIFEST.in @@ -4,5 +4,6 @@ recursive-exclude doc/build * recursive-include test * recursive-include utils *.py recursive-exclude **/__pycache__ * +recursive-exclude **/.DS_Store * exclude **/*.pyc exclude **/.gitkeep From dc87639b3f6c082a4f9fb035318abffeffa42922 Mon Sep 17 00:00:00 2001 From: nitram96 Date: Thu, 8 Feb 2024 14:51:12 +0000 Subject: [PATCH 097/210] fixed bugs with using cachedir in arcgisimage. cachedir is no longer ignored if verbose is false, if a cached image is found now correctly shows it using self.imshow(), now uses os.path.join to join cachedir and filename, so a backslash is no longer required at the end of cachedir --- packages/basemap/src/mpl_toolkits/basemap/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index 75bcecf9e..88963acff 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -4351,12 +4351,13 @@ def arcgisimage(self,server='http://server.arcgisonline.com/ArcGIS',\ os.makedirs(cachedir) # Check if the image is already in the cachedir folder. - cache_path = cachedir + filename + cache_path = os.path.join(cachedir, filename) - if os.path.isfile(cache_path) and verbose: - print('Image already in cache') + if os.path.isfile(cache_path): + if verbose: + print('Image already in cache') img = Image.open(cache_path) - return basemap.imshow(img, ax=ax, origin='upper') + return self.imshow(img, ax=ax, origin='upper') # Retrieve image from remote server. import contextlib From d5ba71fd38f5bcb2551c7dab09a55f6f417ac763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 10:56:53 +0100 Subject: [PATCH 098/210] Apply basic PyLint corrections to Basemap.arcgisimage method --- .../src/mpl_toolkits/basemap/__init__.py | 61 ++++++++++--------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index 88963acff..e13cbc37f 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -4257,9 +4257,9 @@ def pil_to_array(*args, **kwargs): im,c = self._cliplimb(ax,im) return im - def arcgisimage(self,server='http://server.arcgisonline.com/ArcGIS',\ - service='World_Imagery',xpixels=400,ypixels=None,\ - dpi=96,cachedir=None,verbose=False,**kwargs): + def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", + service="World_Imagery", xpixels=400, ypixels=None, + dpi=96, cachedir=None, verbose=False, **kwargs): """ Retrieve an image using the ArcGIS Server REST API and display it on the map. In order to use this method, the Basemap instance must be @@ -4285,7 +4285,8 @@ def arcgisimage(self,server='http://server.arcgisonline.com/ArcGIS',\ map projection region. dpi The device resolution of the exported image (dots per inch, default 96). - cachedir An optional directory to use as cache folder for the retrieved images. + cachedir An optional directory to use as cache folder for the + retrieved images. verbose if True, print URL used to retrieve image (default False). ============== ==================================================== @@ -4295,7 +4296,7 @@ def arcgisimage(self,server='http://server.arcgisonline.com/ArcGIS',\ returns a matplotlib.image.AxesImage instance. """ - # fix PIL import on some versions of OSX and scipy + # Fix PIL import on some versions of OSX and scipy. try: from PIL import Image except ImportError: @@ -4305,28 +4306,30 @@ def arcgisimage(self,server='http://server.arcgisonline.com/ArcGIS',\ raise ImportError("arcgisimage method requires PIL " "(http://pillow.readthedocs.io)") - if not hasattr(self,'epsg'): + if not hasattr(self, "epsg"): raise ValueError("the Basemap instance must be created using " "an EPSG code (http://spatialreference.org) " "in order to use the wmsmap method") - ax = kwargs.pop('ax', None) or self._check_ax() - # find the x,y values at the corner points. + + ax = kwargs.pop("ax", None) or self._check_ax() + + # Find the (x, y) values at the corner points. with warnings.catch_warnings(): warnings.simplefilter("ignore", category=FutureWarning) p = pyproj.Proj(init="epsg:%s" % self.epsg, preserve_units=True) - xmin,ymin = p(self.llcrnrlon,self.llcrnrlat) - xmax,ymax = p(self.urcrnrlon,self.urcrnrlat) + xmin, ymin = p(self.llcrnrlon, self.llcrnrlat) + xmax, ymax = p(self.urcrnrlon, self.urcrnrlat) if self.projection in _cylproj: - Dateline =\ - _geoslib.Point(self(180.,0.5*(self.llcrnrlat+self.urcrnrlat))) - hasDateline = Dateline.within(self._boundarypolyxy) - if hasDateline: + dateline = _geoslib.Point(self(180., 0.5 * (self.llcrnrlat + self.urcrnrlat))) + if dateline.within(self._boundarypolyxy): raise ValueError("arcgisimage cannot handle images that cross " "the dateline for cylindrical projections") - # ypixels not given, find by scaling xpixels by the map aspect ratio. + + # If ypixels is not given, compute it with xpixels and aspect ratio. if ypixels is None: - ypixels = int(self.aspect*xpixels) - # construct a URL using the ArcGIS Server REST API. + ypixels = int(self.aspect * xpixels) + + # Construct a URL using the ArcGIS Server REST API. basemap_url = \ "%s/rest/services/%s/MapServer/export?\ bbox=%s,%s,%s,%s&\ @@ -4337,27 +4340,29 @@ def arcgisimage(self,server='http://server.arcgisonline.com/ArcGIS',\ format=png32&\ transparent=true&\ f=image" %\ -(server,service,xmin,ymin,xmax,ymax,self.epsg,self.epsg,xpixels,ypixels,dpi) - # print URL? - if verbose: print(basemap_url) +(server, service, xmin, ymin, xmax, ymax, self.epsg, self.epsg, xpixels, ypixels, dpi) + + # Print URL in verbose mode. + if verbose: + print(basemap_url) + + if cachedir is not None: - if cachedir != None: # Generate a filename for the cached file. filename = "%s-bbox-%s-%s-%s-%s-bboxsr%s-imagesr%s-size-%s-%s-dpi%s.png" %\ - (service,xmin,ymin,xmax,ymax,self.epsg,self.epsg,xpixels,ypixels,dpi) + (service, xmin, ymin, xmax, ymax, self.epsg, self.epsg, xpixels, ypixels, dpi) - # Check if the cache directory exists, if not create it. + # Check if the cache directory exists, if not create it. if not os.path.exists(cachedir): os.makedirs(cachedir) # Check if the image is already in the cachedir folder. cache_path = os.path.join(cachedir, filename) - if os.path.isfile(cache_path): if verbose: - print('Image already in cache') + print("Image already in cache") img = Image.open(cache_path) - return self.imshow(img, ax=ax, origin='upper') + return self.imshow(img, ax=ax, origin="upper") # Retrieve image from remote server. import contextlib @@ -4365,11 +4370,11 @@ def arcgisimage(self,server='http://server.arcgisonline.com/ArcGIS',\ with contextlib.closing(conn): img = Image.open(conn) # Save to cache if requested. - if cachedir != None: + if cachedir is not None: img.save(cache_path) # Return AxesImage instance. - return self.imshow(img, ax=ax, origin='upper') + return self.imshow(img, ax=ax, origin="upper") def wmsimage(self,server,\ xpixels=400,ypixels=None,\ From d4eae27751352f260f9d5c9d271a5ecd592c92cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 11:19:38 +0100 Subject: [PATCH 099/210] Apply basic Flake8 corrections to Basemap.arcgisimage method --- .../src/mpl_toolkits/basemap/__init__.py | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index e13cbc37f..7562500cd 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -4330,17 +4330,17 @@ def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", ypixels = int(self.aspect * xpixels) # Construct a URL using the ArcGIS Server REST API. - basemap_url = \ -"%s/rest/services/%s/MapServer/export?\ -bbox=%s,%s,%s,%s&\ -bboxSR=%s&\ -imageSR=%s&\ -size=%s,%s&\ -dpi=%s&\ -format=png32&\ -transparent=true&\ -f=image" %\ -(server, service, xmin, ymin, xmax, ymax, self.epsg, self.epsg, xpixels, ypixels, dpi) + basemap_url = "".join([ + "%s/rest/services/%s/MapServer/export?", + "bbox=%s,%s,%s,%s&", + "bboxSR=%s&", + "imageSR=%s&", + "size=%s,%s&", + "dpi=%s&", + "format=png32&", + "transparent=true&", + "f=image", + ]) % (server, service, xmin, ymin, xmax, ymax, self.epsg, self.epsg, xpixels, ypixels, dpi) # Print URL in verbose mode. if verbose: @@ -4349,8 +4349,8 @@ def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", if cachedir is not None: # Generate a filename for the cached file. - filename = "%s-bbox-%s-%s-%s-%s-bboxsr%s-imagesr%s-size-%s-%s-dpi%s.png" %\ - (service, xmin, ymin, xmax, ymax, self.epsg, self.epsg, xpixels, ypixels, dpi) + filename = "%s-bbox-%s-%s-%s-%s-bboxsr%s-imagesr%s-size-%s-%s-dpi%s.png" % \ + (service, xmin, ymin, xmax, ymax, self.epsg, self.epsg, xpixels, ypixels, dpi) # Check if the cache directory exists, if not create it. if not os.path.exists(cachedir): From 27ffdb875bb5196758ffc98546242162aa33e5f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 11:53:50 +0100 Subject: [PATCH 100/210] Clean Basemap.arcgisimage docstring and comments --- .../src/mpl_toolkits/basemap/__init__.py | 82 ++++++++++--------- 1 file changed, 44 insertions(+), 38 deletions(-) diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index 7562500cd..bec68ab2e 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -4260,40 +4260,50 @@ def pil_to_array(*args, **kwargs): def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", service="World_Imagery", xpixels=400, ypixels=None, dpi=96, cachedir=None, verbose=False, **kwargs): - """ - Retrieve an image using the ArcGIS Server REST API and display it on - the map. In order to use this method, the Basemap instance must be - created using the ``epsg`` keyword to define the map projection, unless - the ``cyl`` projection is used (in which case the epsg code 4326 is - assumed). + r"""Display background image using ArcGIS Server REST API. - .. tabularcolumns:: |l|L| + In order to use this method, the :class:`Basemap` instance + must be created using the ``epsg`` keyword to define the + map projection, unless the "cyl" projection is used (in + which case the EPSG code 4326 is assumed). - ============== ==================================================== - Keywords Description - ============== ==================================================== - server web map server URL (default - http://server.arcgisonline.com/ArcGIS). - service service (image type) hosted on server (default - 'World_Imagery', which is NASA 'Blue Marble' - image). - xpixels requested number of image pixels in x-direction - (default 400). - ypixels requested number of image pixels in y-direction. - Default (None) is to infer the number from - from xpixels and the aspect ratio of the - map projection region. - dpi The device resolution of the exported image (dots per - inch, default 96). - cachedir An optional directory to use as cache folder for the - retrieved images. - verbose if True, print URL used to retrieve image (default - False). - ============== ==================================================== + Parameters + ---------- - Extra keyword ``ax`` can be used to override the default axis instance. + server : str, optional + base URL of the web map server - returns a matplotlib.image.AxesImage instance. + service : str, optional + service (image type) hosted by the server + + xpixels : int, optional + requested number of image pixels in the `x`-direction + + ypixels : int, optional + requested number of image pixels in the `y`-direction; + if not given, it is inferred from ``xpixels`` and the + aspect ratio of the map projection region + + dpi : int, optional + device resolution of the exported image + + cachedir : str, optional + if given, directory to use as cache folder for the images + retrieved from the server + + verbose : bool, optional + if True, print debugging information + + \**kwargs : dict, optional + keyword-only arguments; currently, only ``ax`` is supported + to override the default :class:`matplotlib.axes.Axes` + instance + + Returns + ------- + + aximg : matplotlib.image.AxesImage + image axes instance """ # Fix PIL import on some versions of OSX and scipy. @@ -4313,7 +4323,7 @@ def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", ax = kwargs.pop("ax", None) or self._check_ax() - # Find the (x, y) values at the corner points. + # Find the `(x, y)` values at the corner points. with warnings.catch_warnings(): warnings.simplefilter("ignore", category=FutureWarning) p = pyproj.Proj(init="epsg:%s" % self.epsg, preserve_units=True) @@ -4346,17 +4356,15 @@ def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", if verbose: print(basemap_url) + # Try to return fast if cache is enabled. if cachedir is not None: - # Generate a filename for the cached file. filename = "%s-bbox-%s-%s-%s-%s-bboxsr%s-imagesr%s-size-%s-%s-dpi%s.png" % \ (service, xmin, ymin, xmax, ymax, self.epsg, self.epsg, xpixels, ypixels, dpi) - # Check if the cache directory exists, if not create it. if not os.path.exists(cachedir): os.makedirs(cachedir) - - # Check if the image is already in the cachedir folder. + # Return fast if the image is already in the cache. cache_path = os.path.join(cachedir, filename) if os.path.isfile(cache_path): if verbose: @@ -4364,7 +4372,7 @@ def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", img = Image.open(cache_path) return self.imshow(img, ax=ax, origin="upper") - # Retrieve image from remote server. + # Retrieve image from the remote server. import contextlib conn = urlopen(basemap_url) with contextlib.closing(conn): @@ -4372,8 +4380,6 @@ def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", # Save to cache if requested. if cachedir is not None: img.save(cache_path) - - # Return AxesImage instance. return self.imshow(img, ax=ax, origin="upper") def wmsimage(self,server,\ From d9c9ee74cbe5c38e5ecb4a166f4012c9f65acc22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 12:39:13 +0100 Subject: [PATCH 101/210] Add basic test for Basemap.arcgisimage with cache directory --- .../src/mpl_toolkits/basemap/__init__.py | 4 +-- .../test/mpl_toolkits/basemap/test_Basemap.py | 36 +++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index bec68ab2e..efcc6f9c8 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -4353,7 +4353,7 @@ def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", ]) % (server, service, xmin, ymin, xmax, ymax, self.epsg, self.epsg, xpixels, ypixels, dpi) # Print URL in verbose mode. - if verbose: + if verbose: # pragma: no cover print(basemap_url) # Try to return fast if cache is enabled. @@ -4367,7 +4367,7 @@ def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", # Return fast if the image is already in the cache. cache_path = os.path.join(cachedir, filename) if os.path.isfile(cache_path): - if verbose: + if verbose: # pragma: no cover print("Image already in cache") img = Image.open(cache_path) return self.imshow(img, ax=ax, origin="upper") diff --git a/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py b/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py index 2565c1569..1579cfb5d 100644 --- a/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py +++ b/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py @@ -1,5 +1,8 @@ """Import test for the :mod:`mpl_toolkits.basemap.Basemap` class.""" +import os +import shutil +import tempfile import datetime as dt try: import unittest2 as unittest @@ -145,6 +148,39 @@ def test_arcgisimage_with_cyl(self, axs=None, axslen0=10): axs_children = axs_obj.get_children() self.assertEqual(len(axs_children), axslen0 + 1) + @unittest.skipIf(PIL is None, reason="pillow unavailable") + def test_arcgisimage_with_cyl_using_cache(self, axs=None, axslen0=10): + """Test showing an ArcGIS image as background.""" + + axs_obj = plt.gca() if axs is None else axs + axs_children = axs_obj.get_children() + self.assertEqual(len(axs_children), axslen0) + + bmap = Basemap(ax=axs, projection="cyl", resolution=None, + llcrnrlon=-90, llcrnrlat=30, + urcrnrlon=-60, urcrnrlat=60) + + cachedir = tempfile.mkdtemp(prefix="tmp-basemap-cachedir-") + try: + # Check that the cache is initially empty. + self.assertEqual(len(os.listdir(cachedir)), 0) + # Check that the first call populates the cache. + img = bmap.arcgisimage(verbose=False, cachedir=cachedir) + self.assertEqual(len(os.listdir(cachedir)), 1) + # Check output properties after the first call. + self.assertIsInstance(img, AxesImage) + axs_children = axs_obj.get_children() + self.assertEqual(len(axs_children), axslen0 + 1) + # Check that the second call does not update the cache. + img = bmap.arcgisimage(verbose=False, cachedir=cachedir) + self.assertEqual(len(os.listdir(cachedir)), 1) + # Check output properties after the second call. + self.assertIsInstance(img, AxesImage) + axs_children = axs_obj.get_children() + self.assertEqual(len(axs_children), axslen0 + 2) + finally: + shutil.rmtree(cachedir) + def _test_basemap_data_warpimage(self, method, axs=None, axslen0=10): """Test drawing a map background from :mod:`basemap_data`.""" From 0131763aa7d71de0c3b189f489228e9b55f767c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 12:49:20 +0100 Subject: [PATCH 102/210] Fix block location Basemap.arcgisimage for cachedir creation --- packages/basemap/src/mpl_toolkits/basemap/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index efcc6f9c8..a7050beed 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -4361,9 +4361,6 @@ def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", # Generate a filename for the cached file. filename = "%s-bbox-%s-%s-%s-%s-bboxsr%s-imagesr%s-size-%s-%s-dpi%s.png" % \ (service, xmin, ymin, xmax, ymax, self.epsg, self.epsg, xpixels, ypixels, dpi) - # Check if the cache directory exists, if not create it. - if not os.path.exists(cachedir): - os.makedirs(cachedir) # Return fast if the image is already in the cache. cache_path = os.path.join(cachedir, filename) if os.path.isfile(cache_path): @@ -4379,6 +4376,9 @@ def arcgisimage(self, server="http://server.arcgisonline.com/ArcGIS", img = Image.open(conn) # Save to cache if requested. if cachedir is not None: + # Check if the cache directory exists, if not create it. + if not os.path.exists(cachedir): + os.makedirs(cachedir) img.save(cache_path) return self.imshow(img, ax=ax, origin="upper") From ec15505506a9570d74abbb28e0c76a7529d16bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 12:49:46 +0100 Subject: [PATCH 103/210] Add test for Basemap.arcgisimage with on-the-fly cachedir creation --- .../test/mpl_toolkits/basemap/test_Basemap.py | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py b/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py index 1579cfb5d..6a94d291f 100644 --- a/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py +++ b/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py @@ -149,7 +149,7 @@ def test_arcgisimage_with_cyl(self, axs=None, axslen0=10): self.assertEqual(len(axs_children), axslen0 + 1) @unittest.skipIf(PIL is None, reason="pillow unavailable") - def test_arcgisimage_with_cyl_using_cache(self, axs=None, axslen0=10): + def test_arcgisimage_with_cyl_using_cache(self, existing=False, axs=None, axslen0=10): """Test showing an ArcGIS image as background.""" axs_obj = plt.gca() if axs is None else axs @@ -160,10 +160,13 @@ def test_arcgisimage_with_cyl_using_cache(self, axs=None, axslen0=10): llcrnrlon=-90, llcrnrlat=30, urcrnrlon=-60, urcrnrlat=60) - cachedir = tempfile.mkdtemp(prefix="tmp-basemap-cachedir-") - try: - # Check that the cache is initially empty. + # Create cache directory string and check it is empty. + tmpdir = tempfile.mkdtemp(prefix="tmp-basemap-cachedir-") + cachedir = tmpdir if existing else os.path.join(tmpdir, "cachedir") + if os.path.isdir(cachedir): self.assertEqual(len(os.listdir(cachedir)), 0) + + try: # Check that the first call populates the cache. img = bmap.arcgisimage(verbose=False, cachedir=cachedir) self.assertEqual(len(os.listdir(cachedir)), 1) @@ -179,7 +182,14 @@ def test_arcgisimage_with_cyl_using_cache(self, axs=None, axslen0=10): axs_children = axs_obj.get_children() self.assertEqual(len(axs_children), axslen0 + 2) finally: - shutil.rmtree(cachedir) + if os.path.isdir(tmpdir): + shutil.rmtree(tmpdir) + + @unittest.skipIf(PIL is None, reason="pillow unavailable") + def test_arcgisimage_with_cyl_using_cache_already_existing(self): + """Test showing an ArcGIS image as background.""" + + self.test_arcgisimage_with_cyl_using_cache(existing=True) def _test_basemap_data_warpimage(self, method, axs=None, axslen0=10): """Test drawing a map background from :mod:`basemap_data`.""" From a9583bbd67437d75b6f339d0b4af3e2aec9f27ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 14:13:15 +0100 Subject: [PATCH 104/210] Update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4aa0075f2..42c394c56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ https://semver.org/spec/v2.0.0.html ### Fixed - Set recursive exclusion for `.DS_Store` folders in `MANIFEST.in`. +- Fix broken implementation and docstrings of `Basemap.arcgisimage` + method (PR [#598] by @nitram96). ## [1.4.0] - 2024-01-09 @@ -1086,6 +1088,8 @@ https://semver.org/spec/v2.0.0.html - Fix glitches in drawing of parallels and meridians. +[#598]: +https://github.com/matplotlib/basemap/pull/598 [#595]: https://github.com/matplotlib/basemap/pull/595 [#594]: From 0e8a4bb820ee4d3ecf1c3d62013dfa1490a3e705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 14:14:31 +0100 Subject: [PATCH 105/210] Update actions/checkout to v4 --- .github/workflows/basemap-data-hires.yml | 2 +- .github/workflows/basemap-data.yml | 2 +- .github/workflows/basemap-for-windows.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/basemap-data-hires.yml b/.github/workflows/basemap-data-hires.yml index a17c75bef..feb560f0e 100644 --- a/.github/workflows/basemap-data-hires.yml +++ b/.github/workflows/basemap-data-hires.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Upload checkout uses: actions/upload-artifact@v3 diff --git a/.github/workflows/basemap-data.yml b/.github/workflows/basemap-data.yml index 60fabb8ad..df6af7a43 100644 --- a/.github/workflows/basemap-data.yml +++ b/.github/workflows/basemap-data.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Upload checkout uses: actions/upload-artifact@v3 diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml index 69b23d645..250d77b30 100644 --- a/.github/workflows/basemap-for-windows.yml +++ b/.github/workflows/basemap-for-windows.yml @@ -29,7 +29,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Upload checkout uses: actions/upload-artifact@v3 From 6583fdfd961d9279e4a0c216a8392608964acf9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 14:15:59 +0100 Subject: [PATCH 106/210] Update actions/upload-artifact to v4 --- .github/workflows/basemap-data-hires.yml | 4 ++-- .github/workflows/basemap-data.yml | 4 ++-- .github/workflows/basemap-for-windows.yml | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/basemap-data-hires.yml b/.github/workflows/basemap-data-hires.yml index feb560f0e..7835c62ca 100644 --- a/.github/workflows/basemap-data-hires.yml +++ b/.github/workflows/basemap-data-hires.yml @@ -30,7 +30,7 @@ jobs: uses: actions/checkout@v4 - name: Upload checkout - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: checkout path: . @@ -59,7 +59,7 @@ jobs: pip wheel -w dist --no-deps dist/*.zip - name: Upload build artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: artifacts-build path: ${{ env.PKGDIR }}/dist diff --git a/.github/workflows/basemap-data.yml b/.github/workflows/basemap-data.yml index df6af7a43..74b7f4a3b 100644 --- a/.github/workflows/basemap-data.yml +++ b/.github/workflows/basemap-data.yml @@ -30,7 +30,7 @@ jobs: uses: actions/checkout@v4 - name: Upload checkout - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: checkout path: . @@ -59,7 +59,7 @@ jobs: pip wheel -w dist --no-deps dist/*.zip - name: Upload build artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: artifacts-build path: ${{ env.PKGDIR }}/dist diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml index 250d77b30..486bc5fe9 100644 --- a/.github/workflows/basemap-for-windows.yml +++ b/.github/workflows/basemap-for-windows.yml @@ -32,7 +32,7 @@ jobs: uses: actions/checkout@v4 - name: Upload checkout - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: checkout path: . @@ -137,7 +137,7 @@ jobs: python -c "import utils; utils.GeosLibrary('3.6.5').build('extern', toolset='${{ matrix.msvc-toolset }}', njobs=16)" - name: Upload GEOS artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: artifacts-geos-${{ matrix.arch }}-msvc${{ matrix.msvc-toolset }} path: ${{ env.PKGDIR }}/extern @@ -212,7 +212,7 @@ jobs: python -m pip wheel -w dist --no-deps (Get-Item dist/*.zip) - name: Upload build artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} path: ${{ env.PKGDIR }}/dist From 76622daac1f8c182b29129bc71e6544a2d40b9c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 14:17:07 +0100 Subject: [PATCH 107/210] Update actions/download-artifact to v4 --- .github/workflows/basemap-data-hires.yml | 8 ++++---- .github/workflows/basemap-data.yml | 8 ++++---- .github/workflows/basemap-for-windows.yml | 14 +++++++------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/basemap-data-hires.yml b/.github/workflows/basemap-data-hires.yml index 7835c62ca..6f7e5401f 100644 --- a/.github/workflows/basemap-data-hires.yml +++ b/.github/workflows/basemap-data-hires.yml @@ -47,7 +47,7 @@ jobs: steps: - name: Download checkout - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: checkout path: . @@ -78,13 +78,13 @@ jobs: steps: - name: Download checkout - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: checkout path: . - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: artifacts-build path: ${{ env.PKGDIR }}/dist @@ -111,7 +111,7 @@ jobs: steps: - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: artifacts-build path: ${{ env.PKGDIR }}/dist diff --git a/.github/workflows/basemap-data.yml b/.github/workflows/basemap-data.yml index 74b7f4a3b..0d1885c47 100644 --- a/.github/workflows/basemap-data.yml +++ b/.github/workflows/basemap-data.yml @@ -47,7 +47,7 @@ jobs: steps: - name: Download checkout - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: checkout path: . @@ -78,13 +78,13 @@ jobs: steps: - name: Download checkout - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: checkout path: . - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: artifacts-build path: ${{ env.PKGDIR }}/dist @@ -111,7 +111,7 @@ jobs: steps: - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: artifacts-build path: ${{ env.PKGDIR }}/dist diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml index 486bc5fe9..f77a2aa50 100644 --- a/.github/workflows/basemap-for-windows.yml +++ b/.github/workflows/basemap-for-windows.yml @@ -49,7 +49,7 @@ jobs: steps: - name: Download checkout - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: checkout path: . @@ -109,7 +109,7 @@ jobs: steps: - name: Download checkout - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: checkout path: . @@ -156,7 +156,7 @@ jobs: steps: - name: Download checkout - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: checkout path: . @@ -198,7 +198,7 @@ jobs: toolset: ${{ env.msvc-toolset }} - name: Download GEOS artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: artifacts-geos-${{ matrix.arch }}-msvc${{ env.msvc-toolset }} path: ${{ env.PKGDIR }}/extern @@ -235,13 +235,13 @@ jobs: steps: - name: Download checkout - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: checkout path: . - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} path: ${{ env.PKGDIR }}/dist @@ -301,7 +301,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} path: ${{ env.PKGDIR }}/dist From 21dd8083cbcd07b0492f4ccff8dd3d795645aba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 14:20:29 +0100 Subject: [PATCH 108/210] Update basemap-data workflows to use Debian 10 --- .github/workflows/basemap-data-hires.yml | 6 +++--- .github/workflows/basemap-data.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/basemap-data-hires.yml b/.github/workflows/basemap-data-hires.yml index 6f7e5401f..445b04232 100644 --- a/.github/workflows/basemap-data-hires.yml +++ b/.github/workflows/basemap-data-hires.yml @@ -43,7 +43,7 @@ jobs: max-parallel: 1 needs: checkout runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-9" + container: "pylegacy/python:${{ matrix.python-version }}-debian-10" steps: - name: Download checkout @@ -74,7 +74,7 @@ jobs: fail-fast: false needs: build runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-9" + container: "pylegacy/python:${{ matrix.python-version }}-debian-10" steps: - name: Download checkout @@ -106,7 +106,7 @@ jobs: if: startsWith(github.event.ref, 'refs/tags/v') needs: test runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-9" + container: "pylegacy/python:${{ matrix.python-version }}-debian-10" environment: PyPI steps: - diff --git a/.github/workflows/basemap-data.yml b/.github/workflows/basemap-data.yml index 0d1885c47..366393121 100644 --- a/.github/workflows/basemap-data.yml +++ b/.github/workflows/basemap-data.yml @@ -43,7 +43,7 @@ jobs: max-parallel: 1 needs: checkout runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-9" + container: "pylegacy/python:${{ matrix.python-version }}-debian-10" steps: - name: Download checkout @@ -74,7 +74,7 @@ jobs: fail-fast: false needs: build runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-9" + container: "pylegacy/python:${{ matrix.python-version }}-debian-10" steps: - name: Download checkout @@ -106,7 +106,7 @@ jobs: if: startsWith(github.event.ref, 'refs/tags/v') needs: test runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-9" + container: "pylegacy/python:${{ matrix.python-version }}-debian-10" environment: PyPI steps: - From 4a4ce7b7827ecf5837a15c43f912e70752486f47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 14:35:47 +0100 Subject: [PATCH 109/210] Update CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42c394c56..c99fb4c2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,12 @@ https://semver.org/spec/v2.0.0.html ## [Unreleased] +### Changed +- Update workflow actions from v3 to v4 if possible (`actions/checkout`, + `actions/upload-artifact` and `actions/download-artifact`). +- Update base image for `basemap-data` and `basemap-data-hires` + GitHub workflows to use Debian 10. + ### Fixed - Set recursive exclusion for `.DS_Store` folders in `MANIFEST.in`. - Fix broken implementation and docstrings of `Basemap.arcgisimage` From be2ed1854258676bf380fac4bf22f5cc4f052da9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 14:40:05 +0100 Subject: [PATCH 110/210] Update jwlawson/actions-setup-cmake from v1.13 to v2.0 --- .github/workflows/basemap-for-windows.yml | 2 +- CHANGELOG.md | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml index f77a2aa50..e766dada0 100644 --- a/.github/workflows/basemap-for-windows.yml +++ b/.github/workflows/basemap-for-windows.yml @@ -121,7 +121,7 @@ jobs: toolset: ${{ matrix.msvc-toolset }} - name: Set CMake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2.0 with: cmake-version: "3.24.2" - diff --git a/CHANGELOG.md b/CHANGELOG.md index c99fb4c2f..75738f7c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,8 +13,10 @@ https://semver.org/spec/v2.0.0.html ## [Unreleased] ### Changed -- Update workflow actions from v3 to v4 if possible (`actions/checkout`, - `actions/upload-artifact` and `actions/download-artifact`). +- Update workflow actions to use NodeJS 20: + - Update base actions from v3 to v4 when possible (`actions/checkout`, + `actions/upload-artifact` and `actions/download-artifact`). + - Update `jwlawson/actions-setup-cmake` from v1.13 to v2.0. - Update base image for `basemap-data` and `basemap-data-hires` GitHub workflows to use Debian 10. From 2a9798dcb069038c92688ecdd582d0e82579ad66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 22:55:04 +0100 Subject: [PATCH 111/210] Update actions/upload-artifact v1 to v4 in Windows workflow --- .github/workflows/basemap-for-windows.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml index e766dada0..92eb337fc 100644 --- a/.github/workflows/basemap-for-windows.yml +++ b/.github/workflows/basemap-for-windows.yml @@ -269,16 +269,16 @@ jobs: name: Test package run: | cd ${{ env.PKGDIR }} - $env:COVERAGE_FILE = ".coverage.${{ matrix.python-version }}" + $env:COVERAGE_FILE = ".coverage.${{ matrix.arch }}.${{ matrix.python-version }}" python -m pytest ` --cov="mpl_toolkits.basemap" --cov-report=term ` --ignore=dist --ignore=build - name: Upload test artifacts - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: - name: test - path: ${{ env.PKGDIR }}/.coverage.${{ matrix.python-version }} + name: artifacts-test-${{ matrix.arch }}-${{ matrix.python-version }} + path: ${{ env.PKGDIR }}/.coverage.${{ matrix.arch }}.${{ matrix.python-version }} upload: strategy: From 29e4a4e5baebc55c224c845afda74512482352a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 14 Feb 2024 22:58:27 +0100 Subject: [PATCH 112/210] Rename artifacts in basemap-for-manylinux workflow --- .github/workflows/basemap-for-manylinux.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index 35243d8a5..e247df2d1 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -311,7 +311,7 @@ jobs: name: Upload test artifacts uses: actions/upload-artifact@v1 with: - name: test + name: artifacts-test path: ${{ env.PKGDIR }}/.coverage.${{ matrix.python-version }} coverage: @@ -326,7 +326,7 @@ jobs: name: Download test artifacts uses: actions/download-artifact@v1 with: - name: test + name: artifacts-test path: ${{ env.PKGDIR }} - name: Install test requirements @@ -344,7 +344,7 @@ jobs: name: Upload coverage artifacts uses: actions/upload-artifact@v1 with: - name: coverage + name: artifacts-coverage path: ${{ env.PKGDIR }}/htmlcov docs: @@ -383,13 +383,13 @@ jobs: name: Upload docs artifacts uses: actions/upload-artifact@v1 with: - name: docs + name: artifacts-docs path: ${{ env.PKGDIR }}/public - name: Upload github-pages artifact uses: actions/upload-pages-artifact@v2 with: - name: github-pages + name: artifacts-github-pages path: ${{ env.PKGDIR }}/public pages: From 44b5e78f7dd2e28d6fe0d8972c3de4d6a6807e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 15 Feb 2024 09:27:57 +0100 Subject: [PATCH 113/210] Update pages actions from v2 to v3 --- .github/workflows/basemap-for-manylinux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index e247df2d1..cdd577b17 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -387,7 +387,7 @@ jobs: path: ${{ env.PKGDIR }}/public - name: Upload github-pages artifact - uses: actions/upload-pages-artifact@v2 + uses: actions/upload-pages-artifact@v3 with: name: artifacts-github-pages path: ${{ env.PKGDIR }}/public @@ -404,7 +404,7 @@ jobs: id-token: write steps: - name: Deploy github-pages - uses: actions/deploy-pages@v2 + uses: actions/deploy-pages@v3 id: deployment upload: From 32065ce8c4991922d6e1d9ecde2010b8b4c1fdb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 15 Feb 2024 12:44:46 +0100 Subject: [PATCH 114/210] Prepare for hotfix 1.4.1 --- CHANGELOG.md | 6 ++++-- packages/basemap/README.md | 4 ++-- packages/basemap/requirements-doc.txt | 2 +- packages/basemap/src/_geoslib.pyx | 2 +- packages/basemap/src/mpl_toolkits/basemap/__init__.py | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75738f7c9..d9bdc4fa9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ https://keepachangelog.com/en/1.0.0/ https://semver.org/spec/v2.0.0.html -## [Unreleased] +## [1.4.1] - 2024-02-15 ### Changed - Update workflow actions to use NodeJS 20: @@ -1252,7 +1252,9 @@ https://github.com/matplotlib/basemap/issues/228 https://github.com/matplotlib/basemap/issues/179 [Unreleased]: -https://github.com/matplotlib/basemap/compare/v1.4.0...develop +https://github.com/matplotlib/basemap/compare/v1.4.1...develop +[1.4.1]: +https://github.com/matplotlib/basemap/compare/v1.4.0...v1.4.1 [1.4.0]: https://github.com/matplotlib/basemap/compare/v1.3.9...v1.4.0 [1.3.9]: diff --git a/packages/basemap/README.md b/packages/basemap/README.md index 622e56303..be631e774 100644 --- a/packages/basemap/README.md +++ b/packages/basemap/README.md @@ -45,6 +45,6 @@ https://spdx.org/licenses/LGPL-2.1-only.html https://spdx.org/licenses/MIT.html [`LICENSE`]: -https://github.com/matplotlib/basemap/blob/v1.4.0/packages/basemap/LICENSE +https://github.com/matplotlib/basemap/blob/v1.4.1/packages/basemap/LICENSE [`LICENSE.geos`]: -https://github.com/matplotlib/basemap/blob/v1.4.0/packages/basemap/LICENSE.geos +https://github.com/matplotlib/basemap/blob/v1.4.1/packages/basemap/LICENSE.geos diff --git a/packages/basemap/requirements-doc.txt b/packages/basemap/requirements-doc.txt index 229abc2ac..385d1e158 100644 --- a/packages/basemap/requirements-doc.txt +++ b/packages/basemap/requirements-doc.txt @@ -2,5 +2,5 @@ sphinx >= 5.3, < 7.2; python_version >= "3.8" furo >= 2022.4.7, < 2023.9.11; python_version >= "3.8" scipy >= 1.2, < 1.12; python_version >= "3.5" -netCDF4 >= 1.5.6, < 1.7.0; python_version >= "3.6" cftime >= 1.4.0, < 1.7.0; python_version >= "3.6" +netCDF4 >= 1.5.6, < 1.7.0; python_version >= "3.6" diff --git a/packages/basemap/src/_geoslib.pyx b/packages/basemap/src/_geoslib.pyx index 676ac4d4b..1e2ced532 100644 --- a/packages/basemap/src/_geoslib.pyx +++ b/packages/basemap/src/_geoslib.pyx @@ -2,7 +2,7 @@ import sys import numpy cimport numpy as cnp -__version__ = "1.5.0-dev" +__version__ = "1.4.1" # Need some Python C-API functions for strings. diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index a7050beed..651a2dd5a 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -48,7 +48,7 @@ from . proj import Proj -__version__ = "1.5.0-dev" +__version__ = "1.4.1" # basemap data files now installed in lib/matplotlib/toolkits/basemap/data # check to see if environment variable BASEMAPDATA set to a directory, From 01b2218c7db034bb71f62c1ce4ae0a1d942a837a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 15 Feb 2024 13:18:15 +0100 Subject: [PATCH 115/210] Add Python 3.12 to basemap-data workflows --- .github/workflows/basemap-data-hires.yml | 2 +- .github/workflows/basemap-data.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/basemap-data-hires.yml b/.github/workflows/basemap-data-hires.yml index 445b04232..a33ddb149 100644 --- a/.github/workflows/basemap-data-hires.yml +++ b/.github/workflows/basemap-data-hires.yml @@ -69,7 +69,7 @@ jobs: matrix: python-version: ["2.6", "2.7", "3.2", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", - "3.9", "3.10", "3.11"] + "3.9", "3.10", "3.11", "3.12"] max-parallel: 3 fail-fast: false needs: build diff --git a/.github/workflows/basemap-data.yml b/.github/workflows/basemap-data.yml index 366393121..629213f31 100644 --- a/.github/workflows/basemap-data.yml +++ b/.github/workflows/basemap-data.yml @@ -69,7 +69,7 @@ jobs: matrix: python-version: ["2.6", "2.7", "3.2", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", - "3.9", "3.10", "3.11"] + "3.9", "3.10", "3.11", "3.12"] max-parallel: 3 fail-fast: false needs: build From 6bf7ba332ca1e0962dfd1b92f98943c7850804c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 15 Feb 2024 14:40:44 +0100 Subject: [PATCH 116/210] Set version back to 1.5.0-dev --- CHANGELOG.md | 2 ++ packages/basemap/src/_geoslib.pyx | 2 +- packages/basemap/src/mpl_toolkits/basemap/__init__.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9bdc4fa9..4244ab5a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ https://keepachangelog.com/en/1.0.0/ https://semver.org/spec/v2.0.0.html +## [Unreleased] + ## [1.4.1] - 2024-02-15 ### Changed diff --git a/packages/basemap/src/_geoslib.pyx b/packages/basemap/src/_geoslib.pyx index 1e2ced532..676ac4d4b 100644 --- a/packages/basemap/src/_geoslib.pyx +++ b/packages/basemap/src/_geoslib.pyx @@ -2,7 +2,7 @@ import sys import numpy cimport numpy as cnp -__version__ = "1.4.1" +__version__ = "1.5.0-dev" # Need some Python C-API functions for strings. diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index 651a2dd5a..a7050beed 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -48,7 +48,7 @@ from . proj import Proj -__version__ = "1.4.1" +__version__ = "1.5.0-dev" # basemap data files now installed in lib/matplotlib/toolkits/basemap/data # check to see if environment variable BASEMAPDATA set to a directory, From 4b85706b70ab7a4e6e8fd3def392d576793230df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 15 Feb 2024 15:37:47 +0100 Subject: [PATCH 117/210] Revert name change for github-pages artifact --- .github/workflows/basemap-for-manylinux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index cdd577b17..617568c9a 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -389,7 +389,7 @@ jobs: name: Upload github-pages artifact uses: actions/upload-pages-artifact@v3 with: - name: artifacts-github-pages + name: github-pages path: ${{ env.PKGDIR }}/public pages: From 6e9f2f8f662f6fa35e4c47ce5c9475a9eb8e9318 Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Mon, 11 Mar 2024 19:02:57 +0100 Subject: [PATCH 118/210] Allow packaging version 24.0 --- packages/basemap/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/basemap/requirements.txt b/packages/basemap/requirements.txt index 3c028489e..7e10e9c1b 100644 --- a/packages/basemap/requirements.txt +++ b/packages/basemap/requirements.txt @@ -35,4 +35,4 @@ packaging >= 16.0, < 21.0; python_version == "2.7" packaging >= 16.0, < 17.0; python_version == "3.2" packaging >= 16.0, < 17.0; python_version == "3.3" packaging >= 16.0, < 21.0; python_version == "3.4" -packaging >= 16.0, < 24.0; python_version >= "3.5" +packaging >= 16.0, < 25.0; python_version >= "3.5" From cbe0cb6fc45b34e30675bad65a770ac292cb155d Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Thu, 8 Jun 2023 16:42:59 -0500 Subject: [PATCH 119/210] Convert to new style namespace packages --- packages/basemap/setup.py | 4 ++-- packages/basemap/src/mpl_toolkits/__init__.py | 6 ------ packages/basemap_data/setup.py | 4 ++-- packages/basemap_data/src/mpl_toolkits/__init__.py | 4 ---- .../basemap_data/src/mpl_toolkits/basemap_data/__init__.py | 4 ---- packages/basemap_data_hires/setup.py | 4 ++-- packages/basemap_data_hires/src/mpl_toolkits/__init__.py | 4 ---- .../src/mpl_toolkits/basemap_data/__init__.py | 4 ---- 8 files changed, 6 insertions(+), 28 deletions(-) delete mode 100644 packages/basemap/src/mpl_toolkits/__init__.py delete mode 100644 packages/basemap_data/src/mpl_toolkits/__init__.py delete mode 100644 packages/basemap_data/src/mpl_toolkits/basemap_data/__init__.py delete mode 100644 packages/basemap_data_hires/src/mpl_toolkits/__init__.py delete mode 100644 packages/basemap_data_hires/src/mpl_toolkits/basemap_data/__init__.py diff --git a/packages/basemap/setup.py b/packages/basemap/setup.py index 4c98a8776..e32646b5d 100644 --- a/packages/basemap/setup.py +++ b/packages/basemap/setup.py @@ -10,7 +10,7 @@ import glob import warnings from setuptools import setup -from setuptools import find_packages +from setuptools import find_namespace_packages from setuptools.command.sdist import sdist from setuptools.extension import Extension @@ -230,7 +230,7 @@ def run(self): "package_dir": {"": "src"}, "packages": - find_packages(where="src"), + find_namespace_packages(where="src"), "ext_modules": ext_modules, "data_files": diff --git a/packages/basemap/src/mpl_toolkits/__init__.py b/packages/basemap/src/mpl_toolkits/__init__.py deleted file mode 100644 index b5cd40f18..000000000 --- a/packages/basemap/src/mpl_toolkits/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -from __future__ import (absolute_import, division, print_function) - -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - pass # must not have setuptools diff --git a/packages/basemap_data/setup.py b/packages/basemap_data/setup.py index 2d8e4e620..9a5ad0343 100644 --- a/packages/basemap_data/setup.py +++ b/packages/basemap_data/setup.py @@ -7,7 +7,7 @@ import os import itertools from setuptools import setup -from setuptools import find_packages +from setuptools import find_namespace_packages def get_content(name, splitlines=False): @@ -114,7 +114,7 @@ def get_content(name, splitlines=False): "package_dir": {"": "src"}, "packages": - find_packages(where="src"), + find_namespace_packages(where="src"), "package_data": { "mpl_toolkits.basemap_data": data_files, diff --git a/packages/basemap_data/src/mpl_toolkits/__init__.py b/packages/basemap_data/src/mpl_toolkits/__init__.py deleted file mode 100644 index 02de4115d..000000000 --- a/packages/basemap_data/src/mpl_toolkits/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - pass # must not have setuptools diff --git a/packages/basemap_data/src/mpl_toolkits/basemap_data/__init__.py b/packages/basemap_data/src/mpl_toolkits/basemap_data/__init__.py deleted file mode 100644 index 02de4115d..000000000 --- a/packages/basemap_data/src/mpl_toolkits/basemap_data/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - pass # must not have setuptools diff --git a/packages/basemap_data_hires/setup.py b/packages/basemap_data_hires/setup.py index 7dbe83cf6..b36a0b11b 100644 --- a/packages/basemap_data_hires/setup.py +++ b/packages/basemap_data_hires/setup.py @@ -7,7 +7,7 @@ import os import itertools from setuptools import setup -from setuptools import find_packages +from setuptools import find_namespace_packages def get_content(name, splitlines=False): @@ -92,7 +92,7 @@ def get_content(name, splitlines=False): "package_dir": {"": "src"}, "packages": - find_packages(where="src"), + find_namespace_packages(where="src"), "package_data": { "mpl_toolkits.basemap_data": data_files, diff --git a/packages/basemap_data_hires/src/mpl_toolkits/__init__.py b/packages/basemap_data_hires/src/mpl_toolkits/__init__.py deleted file mode 100644 index 02de4115d..000000000 --- a/packages/basemap_data_hires/src/mpl_toolkits/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - pass # must not have setuptools diff --git a/packages/basemap_data_hires/src/mpl_toolkits/basemap_data/__init__.py b/packages/basemap_data_hires/src/mpl_toolkits/basemap_data/__init__.py deleted file mode 100644 index 02de4115d..000000000 --- a/packages/basemap_data_hires/src/mpl_toolkits/basemap_data/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - pass # must not have setuptools From 422827b14deb35bc526c8450ba4a1e562fd1e8d1 Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Thu, 8 Jun 2023 17:47:57 -0500 Subject: [PATCH 120/210] remove namespace_packages key from setup --- packages/basemap/setup.py | 3 --- packages/basemap_data/setup.py | 3 --- packages/basemap_data_hires/setup.py | 3 --- 3 files changed, 9 deletions(-) diff --git a/packages/basemap/setup.py b/packages/basemap/setup.py index e32646b5d..b48d04224 100644 --- a/packages/basemap/setup.py +++ b/packages/basemap/setup.py @@ -224,9 +224,6 @@ def run(self): "maps", "plots", ], - "namespace_packages": [ - "mpl_toolkits", - ], "package_dir": {"": "src"}, "packages": diff --git a/packages/basemap_data/setup.py b/packages/basemap_data/setup.py index 9a5ad0343..dc50f9040 100644 --- a/packages/basemap_data/setup.py +++ b/packages/basemap_data/setup.py @@ -108,9 +108,6 @@ def get_content(name, splitlines=False): "maps", "plots", ], - "namespace_packages": [ - "mpl_toolkits.basemap_data", - ], "package_dir": {"": "src"}, "packages": diff --git a/packages/basemap_data_hires/setup.py b/packages/basemap_data_hires/setup.py index b36a0b11b..a841bf1d4 100644 --- a/packages/basemap_data_hires/setup.py +++ b/packages/basemap_data_hires/setup.py @@ -86,9 +86,6 @@ def get_content(name, splitlines=False): "maps", "plots", ], - "namespace_packages": [ - "mpl_toolkits.basemap_data", - ], "package_dir": {"": "src"}, "packages": From 43ed6a5e21a7c84603b4f72e0a37c239eca35cb2 Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Wed, 5 Jun 2024 12:32:23 -0500 Subject: [PATCH 121/210] Adjust CI to only test on python 3.5+ --- .github/workflows/basemap-data-hires.yml | 7 +++---- .github/workflows/basemap-data.yml | 7 +++---- .github/workflows/basemap-for-manylinux.yml | 12 +++++------- .github/workflows/basemap-for-windows.yml | 20 ++++++-------------- 4 files changed, 17 insertions(+), 29 deletions(-) diff --git a/.github/workflows/basemap-data-hires.yml b/.github/workflows/basemap-data-hires.yml index a33ddb149..25b2dd395 100644 --- a/.github/workflows/basemap-data-hires.yml +++ b/.github/workflows/basemap-data-hires.yml @@ -39,7 +39,7 @@ jobs: strategy: matrix: python-version: - ["2.7"] + ["3.5"] max-parallel: 1 needs: checkout runs-on: ubuntu-latest @@ -68,8 +68,7 @@ jobs: strategy: matrix: python-version: - ["2.6", "2.7", "3.2", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", - "3.9", "3.10", "3.11", "3.12"] + ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] max-parallel: 3 fail-fast: false needs: build @@ -101,7 +100,7 @@ jobs: strategy: matrix: python-version: - ["2.7"] + ["3.5"] max-parallel: 1 if: startsWith(github.event.ref, 'refs/tags/v') needs: test diff --git a/.github/workflows/basemap-data.yml b/.github/workflows/basemap-data.yml index 629213f31..8bacb6331 100644 --- a/.github/workflows/basemap-data.yml +++ b/.github/workflows/basemap-data.yml @@ -39,7 +39,7 @@ jobs: strategy: matrix: python-version: - ["2.7"] + ["3.5"] max-parallel: 1 needs: checkout runs-on: ubuntu-latest @@ -68,8 +68,7 @@ jobs: strategy: matrix: python-version: - ["2.6", "2.7", "3.2", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", - "3.9", "3.10", "3.11", "3.12"] + ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] max-parallel: 3 fail-fast: false needs: build @@ -101,7 +100,7 @@ jobs: strategy: matrix: python-version: - ["2.7"] + ["3.5"] max-parallel: 1 if: startsWith(github.event.ref, 'refs/tags/v') needs: test diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index cdd577b17..9fb2c82aa 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -40,7 +40,7 @@ jobs: strategy: matrix: python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] max-parallel: 3 fail-fast: false needs: checkout @@ -132,7 +132,7 @@ jobs: arch: ["x64", "x86"] python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] max-parallel: 3 fail-fast: false needs: build-geos @@ -164,8 +164,6 @@ jobs: x86) arch="i686" ;; esac case "${{ matrix.python-version }}" in - 2.6|3.[23]) pkgvers=1.11.3; tag=manylinux1 ;; - 2.7|3.[456789]) pkgvers=1.16.6; tag=manylinux1 ;; 3.10) pkgvers=1.21.4; tag=manylinux1 ;; 3.11) pkgvers=1.23.3; tag=manylinux_2_17 ;; *) pkgvers=1.26.1; tag=manylinux_2_28 ;; @@ -213,7 +211,7 @@ jobs: arch: ["x64", "x86"] python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] max-parallel: 3 fail-fast: false needs: build @@ -258,7 +256,7 @@ jobs: arch: ["x64", "x86"] python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] exclude: # Missing precompiled binaries for `numpy`, `matplotlib`, # `pyproj`, `pillow` and `lxml`. @@ -413,7 +411,7 @@ jobs: arch: ["x64", "x86"] python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] max-parallel: 1 if: startsWith(github.event.ref, 'refs/tags/v') needs: test diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml index 92eb337fc..4b35b8020 100644 --- a/.github/workflows/basemap-for-windows.yml +++ b/.github/workflows/basemap-for-windows.yml @@ -42,7 +42,7 @@ jobs: strategy: matrix: python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] max-parallel: 3 fail-fast: false needs: checkout @@ -96,10 +96,8 @@ jobs: arch: ["x64", "x86"] msvc-toolset: - ["9.0", "14.0"] + ["14.0"] include: - - msvc-toolset: "9.0" - python-version: "2.7" - msvc-toolset: "14.0" python-version: "3.5" max-parallel: 4 @@ -148,7 +146,7 @@ jobs: arch: ["x64", "x86"] python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] max-parallel: 3 fail-fast: false needs: build-geos @@ -174,8 +172,6 @@ jobs: name: Build old numpy from source run: | Switch -regex ("${{ matrix.python-version }}") { - "^2\.6|3\.[123]$" { Set-Variable -Name "pkgvers" -Value "1.11.3" } - "^2\.7|3\.[456789]$" { Set-Variable -Name "pkgvers" -Value "1.16.6" } "^3\.10$" { Set-Variable -Name "pkgvers" -Value "1.21.4" } "^3\.11$" { Set-Variable -Name "pkgvers" -Value "1.23.3" } default { Set-Variable -Name "pkgvers" -Value "1.26.1" } @@ -185,11 +181,7 @@ jobs: - name: Set MSVC toolset version run: | - if ("${{ matrix.python-version }}" -eq "2.7") { - echo "msvc-toolset=9.0" >> $env:GITHUB_ENV - } else { - echo "msvc-toolset=14.0" >> $env:GITHUB_ENV - } + echo "msvc-toolset=14.0" >> $env:GITHUB_ENV - name: Set MSVC toolset uses: pylegacy/actions/setup-msvc@v2 @@ -223,7 +215,7 @@ jobs: arch: ["x64", "x86"] python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] exclude: # Missing precompiled binaries for `numpy` and `matplotlib`. - arch: "x86" @@ -286,7 +278,7 @@ jobs: arch: ["x64", "x86"] python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] max-parallel: 1 if: startsWith(github.event.ref, 'refs/tags/v') needs: test From 87a5b91c90ec5a6d29e71fd9f668690eed0ebc20 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 18 Feb 2025 12:57:10 +0100 Subject: [PATCH 122/210] unified build and modernizes to CIBUILD --- .github/workflows/build.yml | 149 ++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..6716a6ec8 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,149 @@ +name: Build +env: + GEOS_VERSION: "3.6.5" + +on: + push: + paths: + - ".github/workflows/**" + - "packages/basemap/**" + - "packages/basemap_data/**" + - "packages/basemap_data_hires/**" + pull_request: + paths: + - ".github/workflows/**" + - "packages/basemap/**" + - "packages/basemap_data/**" + - "packages/basemap_data_hires/**" + workflow_dispatch: + +jobs: + build_data: + name: Build data packages + runs-on: ubuntu-latest + strategy: + matrix: + package: [basemap_data, basemap_data_hires] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.8" + + - name: Install build dependencies + run: | + python -m pip install --upgrade pip + pip install build wheel + + - name: Build package + run: | + cd packages/${{ matrix.package }} + python -m build --wheel --sdist + + - uses: actions/upload-artifact@v4 + with: + path: packages/${{ matrix.package }}/dist/* + name: dist-${{ matrix.package }} + + build_basemap: + name: Build basemap wheels (${{ matrix.os }}) + needs: [build_data] + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + include: + - os: ubuntu-latest + before_all: | + echo "Starting BEFORE_ALL script" + cd "{package}" + export GEOS_DIR="$(pwd)/extern" + echo "GEOS_DIR set to: $GEOS_DIR" + python -c "import sys; sys.path.append('utils'); from GeosLibrary import GeosLibrary; GeosLibrary('3.6.5', root='extern').build('extern', njobs=16)" + environment: >- + CFLAGS="-I/project/packages/basemap/extern/include -I/project/packages/basemap/extern/include/geos" + LDFLAGS="-L/project/packages/basemap/extern/lib" + PIP_DEFAULT_TIMEOUT=10 + PIP_DISABLE_PIP_VERSION_CHECK=1 + PIP_PREFER_BINARY=1 + PIP_RETRIES=0 + PYTHONUNBUFFERED=1 + PYTHONWARNINGS="ignore:DEPRECATION" + + - os: windows-latest + before_all: >- + pwsh -Command " + Write-Host 'Starting BEFORE_ALL script'; + $pwd = Get-Location; + Write-Host 'Current directory:' $pwd; + Set-Location '{package}'; + $env:GEOS_DIR = '{package}/extern'; + python -c 'import sys, os; sys.path.append(\"utils\"); from GeosLibrary import GeosLibrary; GeosLibrary(\"3.6.5\").build(\"extern\", njobs=16)' + " + environment: >- + GEOS_DIR="D:/a/basemap/basemap/packages/basemap/extern" + CFLAGS="-ID:/a/basemap/basemap/packages/basemap/extern/include -ID:/a/basemap/basemap/packages/basemap/extern/include/geos/include" + LDFLAGS="-LD:/a/basemap/basemap/packages/basemap/extern/lib" + PIP_DEFAULT_TIMEOUT=10 + PIP_DISABLE_PIP_VERSION_CHECK=1 + PIP_PREFER_BINARY=1 + PIP_RETRIES=0 + PYTHONUNBUFFERED=1 + PYTHONWARNINGS="ignore:DEPRECATION" + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.9" + + - name: Build wheels + uses: pypa/cibuildwheel@v2.22.0 + env: + CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9" + CIBW_ARCHS_LINUX: auto64 + CIBW_BUILD_VERBOSITY: 1 + CIBW_BUILD: "cp39* cp310* cp311* cp312*" + CIBW_SKIP: "pp* *-musllinux_* *-win32 *-manylinux_i686 *-musllinux_i686 *-aarch64 *-armv7l" + CIBW_BEFORE_ALL: ${{ matrix.before_all }} + CIBW_ENVIRONMENT: ${{ matrix.environment }} + CIBW_BUILD_REQUIRES: "cython>=0.29,<3.1" + CIBW_REPAIR_WHEEL_COMMAND: "" + with: + package-dir: packages/basemap + + - uses: actions/upload-artifact@v4 + with: + path: ./wheelhouse/*.whl + name: wheels-basemap-${{ matrix.os }} + + upload_pypi: + needs: [build_data, build_basemap] + runs-on: ubuntu-latest + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + strategy: + matrix: + package: [basemap, basemap_data, basemap_data_hires] + include: + - package: basemap + artifact_pattern: "wheels-basemap-*" + - package: basemap_data + artifact_pattern: "dist-basemap_data" + - package: basemap_data_hires + artifact_pattern: "dist-basemap_data_hires" + steps: + - uses: actions/download-artifact@v4 + with: + pattern: ${{ matrix.artifact_pattern }} + path: dist + merge-multiple: true + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_TOKEN }} From ff3680f1ab43163b2984b622e89de368a8ebf677 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 18 Feb 2025 12:57:36 +0100 Subject: [PATCH 123/210] removed eol support and set numpy standard --- packages/basemap/pyproject.toml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/basemap/pyproject.toml b/packages/basemap/pyproject.toml index 6a50e2c78..89a9c07da 100644 --- a/packages/basemap/pyproject.toml +++ b/packages/basemap/pyproject.toml @@ -2,14 +2,7 @@ requires = [ 'setuptools', 'wheel', - 'numpy == 1.26.1; python_version >= "3.12"', - 'numpy == 1.23.3; python_version == "3.11"', - 'numpy == 1.21.4; python_version == "3.10"', - 'numpy == 1.21.4; sys_platform == "darwin" and (python_version >= "3.7" and python_version <= "3.9")', - 'numpy == 1.16.6; sys_platform != "darwin" and (python_version >= "3.7" and python_version <= "3.9")', - 'numpy == 1.16.6; python_version == "2.7" or (python_version >= "3.4" and python_version <= "3.6")', - 'numpy == 1.11.3; python_version == "2.6" or (python_version >= "3.2" and python_version <= "3.3")', + 'numpy >= 2.0.0; python_version >= "3.9"', 'cython >= 0.29, < 3.1; python_version >= "3.3" or python_version < "3.0"', - 'cython >= 0.26, < 0.27; python_version == "3.2"' ] build-backend = "setuptools.build_meta" From 7bf4d9a0c540f77af7ec875dd2113b6755845ee4 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 18 Feb 2025 12:58:00 +0100 Subject: [PATCH 124/210] update dependencies and remove eol support --- packages/basemap/requirements.txt | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/packages/basemap/requirements.txt b/packages/basemap/requirements.txt index 7e10e9c1b..78a1ce0d3 100644 --- a/packages/basemap/requirements.txt +++ b/packages/basemap/requirements.txt @@ -1,38 +1,10 @@ basemap_data >= 1.3.2, < 1.4 -numpy >= 1.11, < 1.12; python_version == "2.6" -numpy >= 1.16, < 1.17; python_version == "2.7" -numpy >= 1.11, < 1.12; python_version == "3.2" -numpy >= 1.11, < 1.12; python_version == "3.3" -numpy >= 1.15, < 1.17; python_version == "3.4" -numpy >= 1.16, < 1.19; python_version == "3.5" -numpy >= 1.19, < 1.20; python_version == "3.6" -numpy >= 1.21, < 1.22; python_version == "3.7" -numpy >= 1.21, < 1.27; python_version >= "3.8" - -cycler < 0.11; python_version == "3.2" -pyparsing >= 1.5, < 2.4.1; python_version == "2.6" -pyparsing >= 1.5, < 2.3.1; python_version == "3.2" -matplotlib >= 1.5, < 2.0; python_version == "2.6" -matplotlib >= 1.5, < 3.0; python_version == "2.7" -matplotlib >= 1.5, < 2.0; python_version == "3.2" -matplotlib >= 1.5, < 2.0; python_version == "3.3" -matplotlib >= 1.5, < 3.0; python_version == "3.4" +numpy >= 2.0.0; python_version >= "3.9" matplotlib >= 1.5, < 3.9; python_version >= "3.5" -pyproj >= 1.9.3, < 2.1.0; python_version == "2.6" -pyproj >= 1.9.3, < 2.2.0; python_version == "2.7" -pyproj >= 1.9.3, < 1.9.6; python_version == "3.2" -pyproj >= 1.9.3, < 2.1.0; python_version == "3.3" -pyproj >= 1.9.3, < 2.1.0; python_version == "3.4" pyproj >= 1.9.3, < 3.7.0; python_version >= "3.5" -pyshp >= 1.2, < 2.0; python_version == "2.6" pyshp >= 1.2, < 2.4; python_version >= "2.7" -packaging >= 16.0, < 17.0; python_version == "2.6" -packaging >= 16.0, < 21.0; python_version == "2.7" -packaging >= 16.0, < 17.0; python_version == "3.2" -packaging >= 16.0, < 17.0; python_version == "3.3" -packaging >= 16.0, < 21.0; python_version == "3.4" packaging >= 16.0, < 25.0; python_version >= "3.5" From 5330c58bda668f1cfb055aa41154f2f1421bad5b Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 18 Feb 2025 13:18:09 +0100 Subject: [PATCH 125/210] add necessary noexcept for more recent cython --- packages/basemap/src/_geoslib.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/basemap/src/_geoslib.pyx b/packages/basemap/src/_geoslib.pyx index 676ac4d4b..6d1e36914 100644 --- a/packages/basemap/src/_geoslib.pyx +++ b/packages/basemap/src/_geoslib.pyx @@ -112,7 +112,7 @@ cdef extern from "geos_c.h": # Cython 3: Next cdef needs "noexcept" declaration unless # the compiler directive "legacy_implicit_noexcept" is used # ("noexcept" syntax supported since Cython 0.29.31). -cdef void notice_h(const char *fmt, ...): +cdef void notice_h(const char *fmt, ...) noexcept: pass #format = PyBytes_FromString(fmt) #message = PyBytes_FromString(msg) From b3871cbfc4f529dd886713301f402551006ff93f Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 18 Feb 2025 13:20:26 +0100 Subject: [PATCH 126/210] cleanup old workflows --- .github/workflows/basemap-for-manylinux.yml | 449 -------------------- .github/workflows/basemap-for-windows.yml | 326 -------------- 2 files changed, 775 deletions(-) delete mode 100644 .github/workflows/basemap-for-manylinux.yml delete mode 100644 .github/workflows/basemap-for-windows.yml diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml deleted file mode 100644 index 617568c9a..000000000 --- a/.github/workflows/basemap-for-manylinux.yml +++ /dev/null @@ -1,449 +0,0 @@ -name: basemap-for-manylinux - -env: - PKGDIR: "packages/basemap" - PIP_DEFAULT_TIMEOUT: 10 - PIP_DISABLE_PIP_VERSION_CHECK: 1 - PIP_PREFER_BINARY: 1 - PIP_RETRIES: 0 - PYTHONUNBUFFERED: "1" - PYTHONWARNINGS: "ignore:DEPRECATION" - -on: - push: - paths: - - ".github/workflows/basemap-for-manylinux.yml" - - "packages/basemap/**" - pull_request: - paths: - - ".github/workflows/basemap-for-manylinux.yml" - - "packages/basemap/**" - workflow_dispatch: - -jobs: - - checkout: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v1 - - - name: Upload checkout - uses: actions/upload-artifact@v1 - with: - name: checkout - path: . - - lint: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - max-parallel: 3 - fail-fast: false - needs: checkout - container: "pylegacy/python:${{ matrix.python-version }}-debian-10" - steps: - - - name: Download checkout - uses: actions/download-artifact@v1 - with: - name: checkout - path: . - - - name: Install lint requirements - run: | - cd ${{ env.PKGDIR }} - pip install -r requirements-lint.txt - - - name: Install library requirements - run: | - cd ${{ env.PKGDIR }} - pip install -r requirements.txt - - - name: Run Flake8 - run: | - cd ${{ env.PKGDIR }} - if [ -x "$(command -v flake8)" ]; then - flake8 src/mpl_toolkits/basemap/cm.py src/mpl_toolkits/basemap/diagnostic.py src/mpl_toolkits/basemap/proj.py src/mpl_toolkits/basemap/solar.py test; - fi - - - name: Run PyLint - run: | - cd ${{ env.PKGDIR }} - if [ -x "$(command -v pylint)" ]; then - pylint src/mpl_toolkits/basemap/cm.py src/mpl_toolkits/basemap/diagnostic.py src/mpl_toolkits/basemap/proj.py src/mpl_toolkits/basemap/solar.py test; - fi - - build-geos: - strategy: - matrix: - arch: - ["x64", "x86"] - max-parallel: 2 - fail-fast: false - needs: lint - runs-on: ubuntu-latest - container: "pylegacy/${{ matrix.arch }}-python:3.8-debian-4" - steps: - - - name: Download checkout - uses: actions/download-artifact@v1 - with: - name: checkout - path: . - - - name: Install CMake 3.6.2 - run: | - apt-get update - apt-get install -y libidn11 - pkgvers=3.6.2 - pkgname=cmake - pkgcode=cmake-${pkgvers} - case "${{ matrix.arch }}" in - x86) pkgfile=${pkgcode}-Linux-i386.tar.gz;; - *) pkgfile=${pkgcode}-Linux-x86_64.tar.gz;; - esac - wget https://github.com/Kitware/CMake/releases/download/v${pkgvers}/${pkgfile} -P /tmp - tar -xf /tmp/${pkgfile} --strip-components=1 -C /usr - rm -rf /tmp/${pkgfile} - - - name: Install GCC toolchain - run: | - apt-get update - apt-get install -y gcc g++ make - - - name: Build GEOS from source - run: | - cd ${{ env.PKGDIR }} - python -c "import utils; utils.GeosLibrary('3.6.5').build('extern', njobs=16)" - - - name: Upload GEOS artifacts - uses: actions/upload-artifact@v1 - with: - name: artifacts-geos-${{ matrix.arch }} - path: ${{ env.PKGDIR }}/extern - - build: - strategy: - matrix: - arch: - ["x64", "x86"] - python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - max-parallel: 3 - fail-fast: false - needs: build-geos - runs-on: ubuntu-latest - container: "pylegacy/${{ matrix.arch }}-python:${{ matrix.python-version }}-debian-4" - steps: - - - name: Download checkout - uses: actions/download-artifact@v1 - with: - name: checkout - path: . - - - name: Download GEOS artifacts - uses: actions/download-artifact@v1 - with: - name: artifacts-geos-${{ matrix.arch }} - path: ${{ env.PKGDIR }}/extern - - - name: Install GCC toolchain - run: | - apt-get update - apt-get install -y gcc g++ make - - - name: Build old numpy from source - run: | - case "${{ matrix.arch }}" in - x64) arch="x86_64" ;; - x86) arch="i686" ;; - esac - case "${{ matrix.python-version }}" in - 2.6|3.[23]) pkgvers=1.11.3; tag=manylinux1 ;; - 2.7|3.[456789]) pkgvers=1.16.6; tag=manylinux1 ;; - 3.10) pkgvers=1.21.4; tag=manylinux1 ;; - 3.11) pkgvers=1.23.3; tag=manylinux_2_17 ;; - *) pkgvers=1.26.1; tag=manylinux_2_28 ;; - esac - case "${{ matrix.python-version }}" in - 3.11|3.12) - # Dirty solution to get NumPy headers for Python 3.11 and 3.12. - kwds="--plat=${tag}_${arch}" - pip download --no-deps ${kwds} "numpy==${pkgvers}" - oldpkgfile=$(ls *.whl | head -n1) - newpkgfile=$(echo "${oldpkgfile}" | sed "s/${tag}/linux/") - mv "${oldpkgfile}" "${newpkgfile}" - pip install "${newpkgfile}" - rm "${newpkgfile}" - ;; - *) - pip install "numpy == ${pkgvers}" - ;; - esac - - - name: Build wheel - run: | - sitepkgdir=$(pip show numpy 2>/dev/null | grep Location: | cut -d' ' -f2) - export GEOS_DIR="${GITHUB_WORKSPACE}/${{ env.PKGDIR }}/extern" - export NUMPY_INCLUDE_PATH=${sitepkgdir}/numpy/core/include - case "${{ matrix.python-version }}" in - 3.11|3.12) - kwds="--no-build-isolation" - pip install setuptools wheel "cython >= 0.29, < 3.1" - ;; - esac - cd ${{ env.PKGDIR }} - python setup.py sdist - pip wheel -w dist --no-deps ${kwds} dist/*.zip - - - name: Upload build artifacts - uses: actions/upload-artifact@v1 - with: - name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} - path: ${{ env.PKGDIR }}/dist - - repair: - strategy: - matrix: - arch: - ["x64", "x86"] - python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - max-parallel: 3 - fail-fast: false - needs: build - runs-on: ubuntu-latest - container: "pylegacy/${{ matrix.arch }}-python:3.8-debian-10" - steps: - - - name: Download GEOS artifacts - uses: actions/download-artifact@v1 - with: - name: artifacts-geos-${{ matrix.arch }} - path: ${{ env.PKGDIR }}/extern - - - name: Download build artifacts - uses: actions/download-artifact@v1 - with: - name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} - path: ${{ env.PKGDIR }}/dist - - - name: Install auditwheel - run: | - apt-get update - apt-get install -y unzip - pip install patchelf - pip install "auditwheel < 4.0" - - - name: Repair wheel - run: | - cd ${{ env.PKGDIR }} - export LD_LIBRARY_PATH="$(readlink -f extern/lib)" - auditwheel repair -w dist dist/*.whl - - - name: Upload build artifacts - uses: actions/upload-artifact@v1 - with: - name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} - path: ${{ env.PKGDIR }}/dist - - test: - strategy: - matrix: - arch: - ["x64", "x86"] - python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - exclude: - # Missing precompiled binaries for `numpy`, `matplotlib`, - # `pyproj`, `pillow` and `lxml`. - - arch: "x86" - python-version: "3.12" - max-parallel: 3 - fail-fast: false - needs: repair - runs-on: ubuntu-latest - container: "pylegacy/${{ matrix.arch }}-python:${{ matrix.python-version }}-debian-10" - steps: - - - name: Download checkout - uses: actions/download-artifact@v1 - with: - name: checkout - path: . - - - name: Download build artifacts - uses: actions/download-artifact@v1 - with: - name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} - path: ${{ env.PKGDIR }}/dist - - - name: Install numpy from source - run: | - apt-get update - apt-get install -y gcc g++ make - pip install "numpy < 1.24" - if: matrix.arch == 'x86' && (matrix.python-version >= '3.8' || matrix.python-version >= '3.10') - - - name: Install test requirements - run: | - cd ${{ env.PKGDIR }} - pip install -r requirements-test.txt - - - name: Install package (full) - run: | - whlpath=$(ls ${{ env.PKGDIR }}/dist/*-manylinux1*.whl | head -n1) - pip install "${whlpath}[owslib,pillow]" - - - name: Test package - run: | - cd ${{ env.PKGDIR }} - export COVERAGE_FILE=.coverage.${{ matrix.python-version }} - python -m pytest \ - --cov="mpl_toolkits.basemap" --cov-report=term \ - --ignore=dist --ignore=build - - - name: Upload test artifacts - uses: actions/upload-artifact@v1 - with: - name: artifacts-test - path: ${{ env.PKGDIR }}/.coverage.${{ matrix.python-version }} - - coverage: - needs: test - runs-on: ubuntu-latest - container: "pylegacy/python:3.8-debian-10" - steps: - - - name: Checkout - uses: actions/checkout@v1 - - - name: Download test artifacts - uses: actions/download-artifact@v1 - with: - name: artifacts-test - path: ${{ env.PKGDIR }} - - - name: Install test requirements - run: | - cd ${{ env.PKGDIR }} - pip install -r requirements-test.txt - - - name: Compute combined coverage - run: | - cd ${{ env.PKGDIR }} - coverage combine - coverage html - coverage report - - - name: Upload coverage artifacts - uses: actions/upload-artifact@v1 - with: - name: artifacts-coverage - path: ${{ env.PKGDIR }}/htmlcov - - docs: - needs: test - runs-on: ubuntu-latest - container: "pylegacy/python:3.8-debian-10" - steps: - - - name: Download checkout - uses: actions/download-artifact@v1 - with: - name: checkout - path: . - - - name: Install doc requirements - run: | - cd ${{ env.PKGDIR }} - pip install -r requirements-doc.txt - - - name: Download build artifacts - uses: actions/download-artifact@v1 - with: - name: artifacts-build-x64-3.8 - path: ${{ env.PKGDIR }}/dist - - - name: Install package - run: | - cd ${{ env.PKGDIR }} - pip install dist/*-manylinux1*.whl - - - name: Run sphinx - run: | - cd ${{ env.PKGDIR }} - python -m sphinx doc/source public - - - name: Upload docs artifacts - uses: actions/upload-artifact@v1 - with: - name: artifacts-docs - path: ${{ env.PKGDIR }}/public - - - name: Upload github-pages artifact - uses: actions/upload-pages-artifact@v3 - with: - name: github-pages - path: ${{ env.PKGDIR }}/public - - pages: - if: startsWith(github.event.ref, 'refs/tags/v') - needs: docs - runs-on: ubuntu-latest - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - permissions: - pages: write - id-token: write - steps: - - name: Deploy github-pages - uses: actions/deploy-pages@v3 - id: deployment - - upload: - strategy: - matrix: - arch: - ["x64", "x86"] - python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - max-parallel: 1 - if: startsWith(github.event.ref, 'refs/tags/v') - needs: test - runs-on: ubuntu-latest - container: "pylegacy/${{ matrix.arch }}-python:${{ matrix.python-version }}-debian-10" - environment: PyPI - steps: - - - name: Download build artifacts - uses: actions/download-artifact@v1 - with: - name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} - path: ${{ env.PKGDIR }}/dist - - - name: Install upload requirements - run: | - pip install twine - - - name: Check distributables - run: | - python -m twine check \ - ${{ env.PKGDIR }}/dist/*.zip \ - ${{ env.PKGDIR }}/dist/*-manylinux1*.whl - - - name: Upload distributables - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: "${{ secrets.PYPI_TOKEN }}" - TWINE_REPOSITORY_URL: "${{ secrets.PYPI_REPOSITORY_URL }}" - run: | - python -m twine upload --skip-existing \ - ${{ env.PKGDIR }}/dist/*.zip \ - ${{ env.PKGDIR }}/dist/*-manylinux1*.whl diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml deleted file mode 100644 index 92eb337fc..000000000 --- a/.github/workflows/basemap-for-windows.yml +++ /dev/null @@ -1,326 +0,0 @@ -name: basemap-for-windows - -env: - PKGDIR: "packages/basemap" - PIP_DEFAULT_TIMEOUT: 10 - PIP_DISABLE_PIP_VERSION_CHECK: 1 - PIP_PREFER_BINARY: 1 - PIP_RETRIES: 0 - PYTHONUNBUFFERED: "1" - PYTHONWARNINGS: "ignore:DEPRECATION" - -on: - push: - paths: - - ".github/workflows/basemap-for-windows.yml" - - "!packages/basemap/doc/**" - - "packages/basemap/**" - pull_request: - paths: - - ".github/workflows/basemap-for-windows.yml" - - "!packages/basemap/doc/**" - - "packages/basemap/**" - workflow_dispatch: - -jobs: - - checkout: - runs-on: windows-2019 - steps: - - - name: Checkout - uses: actions/checkout@v4 - - - name: Upload checkout - uses: actions/upload-artifact@v4 - with: - name: checkout - path: . - - lint: - runs-on: windows-2019 - strategy: - matrix: - python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - max-parallel: 3 - fail-fast: false - needs: checkout - steps: - - - name: Download checkout - uses: actions/download-artifact@v4 - with: - name: checkout - path: . - - - name: Set Python - uses: pylegacy/actions/setup-pyenv-win@v2 - with: - architecture: ${{ matrix.arch }} - python-version: ${{ matrix.python-version }} - - - name: Set Python base packages - run: | - python -m pip install --upgrade pip setuptools wheel - - - name: Install lint requirements - run: | - cd ${{ env.PKGDIR }} - python -m pip install -r requirements-lint.txt - - - name: Install library requirements - run: | - cd ${{ env.PKGDIR }} - python -m pip install -r requirements.txt - - - name: Run Flake8 - run: | - cd ${{ env.PKGDIR }} - if (Get-Command flake8 -errorAction SilentlyContinue) - { - flake8 src/mpl_toolkits/basemap/cm.py src/mpl_toolkits/basemap/diagnostic.py src/mpl_toolkits/basemap/proj.py src/mpl_toolkits/basemap/solar.py test; - } - - - name: Run PyLint - run: | - cd ${{ env.PKGDIR }} - if (Get-Command pylint -errorAction SilentlyContinue) - { - pylint src/mpl_toolkits/basemap/cm.py src/mpl_toolkits/basemap/diagnostic.py src/mpl_toolkits/basemap/proj.py src/mpl_toolkits/basemap/solar.py test; - } - - build-geos: - strategy: - matrix: - arch: - ["x64", "x86"] - msvc-toolset: - ["9.0", "14.0"] - include: - - msvc-toolset: "9.0" - python-version: "2.7" - - msvc-toolset: "14.0" - python-version: "3.5" - max-parallel: 4 - fail-fast: false - needs: lint - runs-on: windows-2019 - steps: - - - name: Download checkout - uses: actions/download-artifact@v4 - with: - name: checkout - path: . - - - name: Set MSVC toolset - uses: pylegacy/actions/setup-msvc@v2 - with: - arch: ${{ matrix.arch }} - toolset: ${{ matrix.msvc-toolset }} - - - name: Set CMake - uses: jwlawson/actions-setup-cmake@v2.0 - with: - cmake-version: "3.24.2" - - - name: Set Python - uses: pylegacy/actions/setup-pyenv-win@v2 - with: - architecture: ${{ matrix.arch }} - python-version: ${{ matrix.python-version }} - - - name: Build GEOS from source - run: | - cd ${{ env.PKGDIR }} - python -c "import utils; utils.GeosLibrary('3.6.5').build('extern', toolset='${{ matrix.msvc-toolset }}', njobs=16)" - - - name: Upload GEOS artifacts - uses: actions/upload-artifact@v4 - with: - name: artifacts-geos-${{ matrix.arch }}-msvc${{ matrix.msvc-toolset }} - path: ${{ env.PKGDIR }}/extern - - build: - strategy: - matrix: - arch: - ["x64", "x86"] - python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - max-parallel: 3 - fail-fast: false - needs: build-geos - runs-on: windows-2019 - steps: - - - name: Download checkout - uses: actions/download-artifact@v4 - with: - name: checkout - path: . - - - name: Set Python - uses: pylegacy/actions/setup-pyenv-win@v2 - with: - architecture: ${{ matrix.arch }} - python-version: ${{ matrix.python-version }} - - - name: Set Python base packages - run: | - python -m pip install --upgrade pip setuptools wheel - - - name: Build old numpy from source - run: | - Switch -regex ("${{ matrix.python-version }}") { - "^2\.6|3\.[123]$" { Set-Variable -Name "pkgvers" -Value "1.11.3" } - "^2\.7|3\.[456789]$" { Set-Variable -Name "pkgvers" -Value "1.16.6" } - "^3\.10$" { Set-Variable -Name "pkgvers" -Value "1.21.4" } - "^3\.11$" { Set-Variable -Name "pkgvers" -Value "1.23.3" } - default { Set-Variable -Name "pkgvers" -Value "1.26.1" } - } - $env:SETUPTOOLS_USE_DISTUTILS = "stdlib" - python -m pip install "numpy == ${pkgvers}" - - - name: Set MSVC toolset version - run: | - if ("${{ matrix.python-version }}" -eq "2.7") { - echo "msvc-toolset=9.0" >> $env:GITHUB_ENV - } else { - echo "msvc-toolset=14.0" >> $env:GITHUB_ENV - } - - - name: Set MSVC toolset - uses: pylegacy/actions/setup-msvc@v2 - with: - arch: ${{ matrix.arch }} - toolset: ${{ env.msvc-toolset }} - - - name: Download GEOS artifacts - uses: actions/download-artifact@v4 - with: - name: artifacts-geos-${{ matrix.arch }}-msvc${{ env.msvc-toolset }} - path: ${{ env.PKGDIR }}/extern - - - name: Build sdist and wheel - run: | - cd ${{ env.PKGDIR }} - $env:GEOS_DIR = "$env:GITHUB_WORKSPACE/${{ env.PKGDIR }}/extern" - python -m pip install -r requirements-setup.txt - python setup.py sdist - python -m pip wheel -w dist --no-deps (Get-Item dist/*.zip) - - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} - path: ${{ env.PKGDIR }}/dist - - test: - strategy: - matrix: - arch: - ["x64", "x86"] - python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - exclude: - # Missing precompiled binaries for `numpy` and `matplotlib`. - - arch: "x86" - python-version: "3.12" - max-parallel: 3 - fail-fast: false - needs: build - runs-on: windows-2019 - steps: - - - name: Download checkout - uses: actions/download-artifact@v4 - with: - name: checkout - path: . - - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} - path: ${{ env.PKGDIR }}/dist - - - name: Set Python - uses: pylegacy/actions/setup-pyenv-win@v2 - with: - architecture: ${{ matrix.arch }} - python-version: ${{ matrix.python-version }} - - - name: Set Python base packages - run: | - python -m pip install --upgrade pip setuptools wheel - - - name: Install test requirements - run: | - cd ${{ env.PKGDIR }} - pip install -r requirements-test.txt - - - name: Install package (full) - run: | - $whlpath = "$(Get-Item ${{ env.PKGDIR }}/dist/*-win*.whl)" - python -m pip install "${whlpath}[owslib,pillow]" - - - name: Test package - run: | - cd ${{ env.PKGDIR }} - $env:COVERAGE_FILE = ".coverage.${{ matrix.arch }}.${{ matrix.python-version }}" - python -m pytest ` - --cov="mpl_toolkits.basemap" --cov-report=term ` - --ignore=dist --ignore=build - - - name: Upload test artifacts - uses: actions/upload-artifact@v4 - with: - name: artifacts-test-${{ matrix.arch }}-${{ matrix.python-version }} - path: ${{ env.PKGDIR }}/.coverage.${{ matrix.arch }}.${{ matrix.python-version }} - - upload: - strategy: - matrix: - arch: - ["x64", "x86"] - python-version: - ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - max-parallel: 1 - if: startsWith(github.event.ref, 'refs/tags/v') - needs: test - runs-on: windows-2019 - environment: PyPI - steps: - - - name: Set Python - uses: pylegacy/actions/setup-pyenv-win@v2 - with: - architecture: ${{ matrix.arch }} - python-version: ${{ matrix.python-version }} - - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} - path: ${{ env.PKGDIR }}/dist - - - name: Install upload requirements - run: | - python -m pip install twine - - - name: Check distributables - run: | - python -m twine check ` - ${{ env.PKGDIR }}/dist/*.zip ` - ${{ env.PKGDIR }}/dist/*.whl - - - name: Upload distributables - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: "${{ secrets.PYPI_TOKEN }}" - TWINE_REPOSITORY_URL: "${{ secrets.PYPI_REPOSITORY_URL }}" - run: | - python -m twine upload --skip-existing ` - ${{ env.PKGDIR }}/dist/*.whl From 4830331ffb15fb4798934b1065b42fdf0d468c9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 18 Feb 2025 18:43:51 +0100 Subject: [PATCH 127/210] Change Python version in setup step to 3.9 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6716a6ec8..a19cab4f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.8" + python-version: "3.9" - name: Install build dependencies run: | From 121ecb2f23ca963271cb059b2f64695539fc9a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 18 Feb 2025 18:45:01 +0100 Subject: [PATCH 128/210] Restrict numpy version in pyproject.toml build requirements --- packages/basemap/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/basemap/pyproject.toml b/packages/basemap/pyproject.toml index 89a9c07da..62fefffed 100644 --- a/packages/basemap/pyproject.toml +++ b/packages/basemap/pyproject.toml @@ -2,7 +2,7 @@ requires = [ 'setuptools', 'wheel', - 'numpy >= 2.0.0; python_version >= "3.9"', + 'numpy == 2.0.0', 'cython >= 0.29, < 3.1; python_version >= "3.3" or python_version < "3.0"', ] build-backend = "setuptools.build_meta" From 980584234d27abf1b60e20a52a0bb597fd31a9b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 18 Feb 2025 18:45:29 +0100 Subject: [PATCH 129/210] Clean Cython conditions in pyproject.toml build requirements --- packages/basemap/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/basemap/pyproject.toml b/packages/basemap/pyproject.toml index 62fefffed..8ab927ff8 100644 --- a/packages/basemap/pyproject.toml +++ b/packages/basemap/pyproject.toml @@ -3,6 +3,6 @@ requires = [ 'setuptools', 'wheel', 'numpy == 2.0.0', - 'cython >= 0.29, < 3.1; python_version >= "3.3" or python_version < "3.0"', + 'cython >= 0.29, < 3.1', ] build-backend = "setuptools.build_meta" From bac26196ba69a639edaceb6bc608a113b1988157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 18 Feb 2025 18:47:54 +0100 Subject: [PATCH 130/210] Update python_requires in setup.py files --- packages/basemap/setup.py | 4 +--- packages/basemap_data/setup.py | 4 +--- packages/basemap_data_hires/setup.py | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/basemap/setup.py b/packages/basemap/setup.py index 4c98a8776..8d2bebdd0 100644 --- a/packages/basemap/setup.py +++ b/packages/basemap/setup.py @@ -237,9 +237,7 @@ def run(self): data_files, "python_requires": ", ".join([ - ">=2.6", - "!=3.0.*", - "!=3.1.*", + ">=3.9", "<3.13", ]), "setup_requires": diff --git a/packages/basemap_data/setup.py b/packages/basemap_data/setup.py index 2d8e4e620..2286b7419 100644 --- a/packages/basemap_data/setup.py +++ b/packages/basemap_data/setup.py @@ -121,9 +121,7 @@ def get_content(name, splitlines=False): }, "python_requires": ", ".join([ - ">=2.6", - "!=3.0.*", - "!=3.1.*", + ">=3.9", "<4", ]), "project_urls": { diff --git a/packages/basemap_data_hires/setup.py b/packages/basemap_data_hires/setup.py index 7dbe83cf6..5dc8009ad 100644 --- a/packages/basemap_data_hires/setup.py +++ b/packages/basemap_data_hires/setup.py @@ -99,9 +99,7 @@ def get_content(name, splitlines=False): }, "python_requires": ", ".join([ - ">=2.6", - "!=3.0.*", - "!=3.1.*", + ">=3.9", "<4", ]), "project_urls": { From ddc58bf076bf71041091df29fc662ea7bee8f919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 18 Feb 2025 19:04:11 +0100 Subject: [PATCH 131/210] Remove CIBW_REPAIR_WHEEL_COMMAND entry in build.yml Based on the `cibuildwheel` docs: https://cibuildwheel.pypa.io/en/stable/options/ If `CIBW_REPAIR_WHEEL_COMMAND` is not specified, then the default behaviour for Linux is our desired behaviour: auditwheel repair -w {dest_dir} {wheel} Because `CIBW_REPAIR_WHEEL_COMMAND` was set before to "", the repair step was being skipped. --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a19cab4f3..723638074 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -113,7 +113,6 @@ jobs: CIBW_BEFORE_ALL: ${{ matrix.before_all }} CIBW_ENVIRONMENT: ${{ matrix.environment }} CIBW_BUILD_REQUIRES: "cython>=0.29,<3.1" - CIBW_REPAIR_WHEEL_COMMAND: "" with: package-dir: packages/basemap From 1010b530c42203b87fd46621e042776630cd35a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 18 Feb 2025 19:14:32 +0100 Subject: [PATCH 132/210] Ensure auditwheel can find libraries to bundle This is done by forcing the value of `LD_LIBRARY_PATH` temporarily to the location of the GEOS shared library. --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 723638074..593f34517 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,6 +65,7 @@ jobs: environment: >- CFLAGS="-I/project/packages/basemap/extern/include -I/project/packages/basemap/extern/include/geos" LDFLAGS="-L/project/packages/basemap/extern/lib" + LD_LIBRARY_PATH="/project/packages/basemap/extern/lib" PIP_DEFAULT_TIMEOUT=10 PIP_DISABLE_PIP_VERSION_CHECK=1 PIP_PREFER_BINARY=1 From a856f41957aeb2dc6f0788b62e8e0d3daaf93e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 18 Feb 2025 19:30:14 +0100 Subject: [PATCH 133/210] Remove old workflows building the data packages --- .github/workflows/basemap-data-hires.yml | 137 ----------------------- .github/workflows/basemap-data.yml | 137 ----------------------- 2 files changed, 274 deletions(-) delete mode 100644 .github/workflows/basemap-data-hires.yml delete mode 100644 .github/workflows/basemap-data.yml diff --git a/.github/workflows/basemap-data-hires.yml b/.github/workflows/basemap-data-hires.yml deleted file mode 100644 index a33ddb149..000000000 --- a/.github/workflows/basemap-data-hires.yml +++ /dev/null @@ -1,137 +0,0 @@ -name: basemap-data-hires - -env: - PKGDIR: "packages/basemap_data_hires" - PIP_DEFAULT_TIMEOUT: 10 - PIP_DISABLE_PIP_VERSION_CHECK: 1 - PIP_PREFER_BINARY: 1 - PIP_RETRIES: 0 - PYTHONUNBUFFERED: "1" - PYTHONWARNINGS: "ignore:DEPRECATION" - -on: - push: - paths: - - ".github/workflows/basemap-data-hires.yml" - - "packages/basemap_data_hires/**" - pull_request: - paths: - - ".github/workflows/basemap-data-hires.yml" - - "packages/basemap_data_hires/**" - workflow_dispatch: - -jobs: - - checkout: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v4 - - - name: Upload checkout - uses: actions/upload-artifact@v4 - with: - name: checkout - path: . - - build: - strategy: - matrix: - python-version: - ["2.7"] - max-parallel: 1 - needs: checkout - runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-10" - steps: - - - name: Download checkout - uses: actions/download-artifact@v4 - with: - name: checkout - path: . - - - name: Build sdist and wheel - run: | - cd ${{ env.PKGDIR }} - python setup.py sdist - pip wheel -w dist --no-deps dist/*.zip - - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: artifacts-build - path: ${{ env.PKGDIR }}/dist - - test: - strategy: - matrix: - python-version: - ["2.6", "2.7", "3.2", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", - "3.9", "3.10", "3.11", "3.12"] - max-parallel: 3 - fail-fast: false - needs: build - runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-10" - steps: - - - name: Download checkout - uses: actions/download-artifact@v4 - with: - name: checkout - path: . - - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: artifacts-build - path: ${{ env.PKGDIR }}/dist - - - name: Install package - run: | - pip install ${{ env.PKGDIR }}/dist/*.whl - - - name: Test package - run: | - python -c "from mpl_toolkits import basemap_data; print(basemap_data)" - - upload: - strategy: - matrix: - python-version: - ["2.7"] - max-parallel: 1 - if: startsWith(github.event.ref, 'refs/tags/v') - needs: test - runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-10" - environment: PyPI - steps: - - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: artifacts-build - path: ${{ env.PKGDIR }}/dist - - - name: Install upload requirements - run: | - pip install twine - - - name: Check distributables - run: | - python -m twine check \ - ${{ env.PKGDIR }}/dist/*.zip \ - ${{ env.PKGDIR }}/dist/*.whl - - - name: Upload distributables - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: "${{ secrets.PYPI_TOKEN }}" - TWINE_REPOSITORY_URL: "${{ secrets.PYPI_REPOSITORY_URL }}" - run: | - python -m twine upload --skip-existing \ - ${{ env.PKGDIR }}/dist/*.zip \ - ${{ env.PKGDIR }}/dist/*.whl diff --git a/.github/workflows/basemap-data.yml b/.github/workflows/basemap-data.yml deleted file mode 100644 index 629213f31..000000000 --- a/.github/workflows/basemap-data.yml +++ /dev/null @@ -1,137 +0,0 @@ -name: basemap-data - -env: - PKGDIR: "packages/basemap_data" - PIP_DEFAULT_TIMEOUT: 10 - PIP_DISABLE_PIP_VERSION_CHECK: 1 - PIP_PREFER_BINARY: 1 - PIP_RETRIES: 0 - PYTHONUNBUFFERED: "1" - PYTHONWARNINGS: "ignore:DEPRECATION" - -on: - push: - paths: - - ".github/workflows/basemap-data.yml" - - "packages/basemap_data/**" - pull_request: - paths: - - ".github/workflows/basemap-data.yml" - - "packages/basemap_data/**" - workflow_dispatch: - -jobs: - - checkout: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v4 - - - name: Upload checkout - uses: actions/upload-artifact@v4 - with: - name: checkout - path: . - - build: - strategy: - matrix: - python-version: - ["2.7"] - max-parallel: 1 - needs: checkout - runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-10" - steps: - - - name: Download checkout - uses: actions/download-artifact@v4 - with: - name: checkout - path: . - - - name: Build sdist and wheel - run: | - cd ${{ env.PKGDIR }} - python setup.py sdist - pip wheel -w dist --no-deps dist/*.zip - - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: artifacts-build - path: ${{ env.PKGDIR }}/dist - - test: - strategy: - matrix: - python-version: - ["2.6", "2.7", "3.2", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", - "3.9", "3.10", "3.11", "3.12"] - max-parallel: 3 - fail-fast: false - needs: build - runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-10" - steps: - - - name: Download checkout - uses: actions/download-artifact@v4 - with: - name: checkout - path: . - - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: artifacts-build - path: ${{ env.PKGDIR }}/dist - - - name: Install package - run: | - pip install ${{ env.PKGDIR }}/dist/*.whl - - - name: Test package - run: | - python -c "from mpl_toolkits import basemap_data; print(basemap_data)" - - upload: - strategy: - matrix: - python-version: - ["2.7"] - max-parallel: 1 - if: startsWith(github.event.ref, 'refs/tags/v') - needs: test - runs-on: ubuntu-latest - container: "pylegacy/python:${{ matrix.python-version }}-debian-10" - environment: PyPI - steps: - - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: artifacts-build - path: ${{ env.PKGDIR }}/dist - - - name: Install upload requirements - run: | - pip install twine - - - name: Check distributables - run: | - python -m twine check \ - ${{ env.PKGDIR }}/dist/*.zip \ - ${{ env.PKGDIR }}/dist/*.whl - - - name: Upload distributables - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: "${{ secrets.PYPI_TOKEN }}" - TWINE_REPOSITORY_URL: "${{ secrets.PYPI_REPOSITORY_URL }}" - run: | - python -m twine upload --skip-existing \ - ${{ env.PKGDIR }}/dist/*.zip \ - ${{ env.PKGDIR }}/dist/*.whl From 43c5e35b53cf44d1bee631404303bffe3c393e99 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 18 Feb 2025 20:26:20 +0100 Subject: [PATCH 134/210] add sdist --- .github/workflows/build.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 593f34517..a1013f0bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,6 +103,15 @@ jobs: with: python-version: "3.9" + - name: Build SDist + if: matrix.os == 'ubuntu-latest' + run: | + pip install build + mkdir -p wheelhouse + cd packages/basemap + python -m build --sdist + mv dist/* ../../wheelhouse/ + - name: Build wheels uses: pypa/cibuildwheel@v2.22.0 env: @@ -119,7 +128,9 @@ jobs: - uses: actions/upload-artifact@v4 with: - path: ./wheelhouse/*.whl + path: | + ./wheelhouse/*.whl + ./wheelhouse/*.tar.gz name: wheels-basemap-${{ matrix.os }} upload_pypi: From 3b817f905ad1e0517ce198048b8e6d122927ebd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 09:46:12 +0100 Subject: [PATCH 135/210] Add missing GEOS_DIR to build_basemap environment on GNU/Linux --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a1013f0bc..fd8d5ef01 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,6 +63,7 @@ jobs: echo "GEOS_DIR set to: $GEOS_DIR" python -c "import sys; sys.path.append('utils'); from GeosLibrary import GeosLibrary; GeosLibrary('3.6.5', root='extern').build('extern', njobs=16)" environment: >- + GEOS_DIR="/project/packages/basemap/extern" CFLAGS="-I/project/packages/basemap/extern/include -I/project/packages/basemap/extern/include/geos" LDFLAGS="-L/project/packages/basemap/extern/lib" LD_LIBRARY_PATH="/project/packages/basemap/extern/lib" From 55b90161427e28172773f8a85cef320fd568e5a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 10:38:44 +0100 Subject: [PATCH 136/210] Remove CFLAGS and LDFLAGS from workflow environments --- .github/workflows/build.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd8d5ef01..a64b60753 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,10 +62,9 @@ jobs: export GEOS_DIR="$(pwd)/extern" echo "GEOS_DIR set to: $GEOS_DIR" python -c "import sys; sys.path.append('utils'); from GeosLibrary import GeosLibrary; GeosLibrary('3.6.5', root='extern').build('extern', njobs=16)" + # LD_LIBRARY_PATH in environment is needed by auditwheel. environment: >- GEOS_DIR="/project/packages/basemap/extern" - CFLAGS="-I/project/packages/basemap/extern/include -I/project/packages/basemap/extern/include/geos" - LDFLAGS="-L/project/packages/basemap/extern/lib" LD_LIBRARY_PATH="/project/packages/basemap/extern/lib" PIP_DEFAULT_TIMEOUT=10 PIP_DISABLE_PIP_VERSION_CHECK=1 @@ -86,8 +85,6 @@ jobs: " environment: >- GEOS_DIR="D:/a/basemap/basemap/packages/basemap/extern" - CFLAGS="-ID:/a/basemap/basemap/packages/basemap/extern/include -ID:/a/basemap/basemap/packages/basemap/extern/include/geos/include" - LDFLAGS="-LD:/a/basemap/basemap/packages/basemap/extern/lib" PIP_DEFAULT_TIMEOUT=10 PIP_DISABLE_PIP_VERSION_CHECK=1 PIP_PREFER_BINARY=1 From 042e1eb1a61c5e227eccd3334b2cb1d7b628d845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 10:54:34 +0100 Subject: [PATCH 137/210] Refactor pip calls and pip environment variables in new workflow --- .github/workflows/build.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a64b60753..32170579c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,13 +35,12 @@ jobs: - name: Install build dependencies run: | - python -m pip install --upgrade pip - pip install build wheel + python -m pip install build wheel - name: Build package run: | cd packages/${{ matrix.package }} - python -m build --wheel --sdist + python -m build --sdist --wheel - uses: actions/upload-artifact@v4 with: @@ -66,10 +65,8 @@ jobs: environment: >- GEOS_DIR="/project/packages/basemap/extern" LD_LIBRARY_PATH="/project/packages/basemap/extern/lib" - PIP_DEFAULT_TIMEOUT=10 PIP_DISABLE_PIP_VERSION_CHECK=1 PIP_PREFER_BINARY=1 - PIP_RETRIES=0 PYTHONUNBUFFERED=1 PYTHONWARNINGS="ignore:DEPRECATION" @@ -85,10 +82,8 @@ jobs: " environment: >- GEOS_DIR="D:/a/basemap/basemap/packages/basemap/extern" - PIP_DEFAULT_TIMEOUT=10 PIP_DISABLE_PIP_VERSION_CHECK=1 PIP_PREFER_BINARY=1 - PIP_RETRIES=0 PYTHONUNBUFFERED=1 PYTHONWARNINGS="ignore:DEPRECATION" @@ -104,7 +99,7 @@ jobs: - name: Build SDist if: matrix.os == 'ubuntu-latest' run: | - pip install build + python -m pip install build mkdir -p wheelhouse cd packages/basemap python -m build --sdist From 8b7ce96bec1b1c5ed56e1117c84f95cd567c9f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 11:04:14 +0100 Subject: [PATCH 138/210] Remove PIP_DISABLE_PIP_VERSION_CHECK from workflow environment Based on the `cibuildwheel` docs, this environment variable is already defined by `cibuildwheel`: https://cibuildwheel.pypa.io/en/stable/options/#environment --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 32170579c..307014b20 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,7 +65,6 @@ jobs: environment: >- GEOS_DIR="/project/packages/basemap/extern" LD_LIBRARY_PATH="/project/packages/basemap/extern/lib" - PIP_DISABLE_PIP_VERSION_CHECK=1 PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 PYTHONWARNINGS="ignore:DEPRECATION" @@ -82,7 +81,6 @@ jobs: " environment: >- GEOS_DIR="D:/a/basemap/basemap/packages/basemap/extern" - PIP_DISABLE_PIP_VERSION_CHECK=1 PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 PYTHONWARNINGS="ignore:DEPRECATION" From 68a554178621cd75bd1327b3a471020f1582dea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 11:08:07 +0100 Subject: [PATCH 139/210] Remove PYTHONWARNINGS from workflow environment This used to be set in order to silence some deprecation warnings, but now we want these warnings to appear in the logs, to address them as soon as we see them. --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 307014b20..b970e8f96 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -67,7 +67,6 @@ jobs: LD_LIBRARY_PATH="/project/packages/basemap/extern/lib" PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 - PYTHONWARNINGS="ignore:DEPRECATION" - os: windows-latest before_all: >- @@ -83,7 +82,6 @@ jobs: GEOS_DIR="D:/a/basemap/basemap/packages/basemap/extern" PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 - PYTHONWARNINGS="ignore:DEPRECATION" runs-on: ${{ matrix.os }} steps: From ea3437f158a06d46b8daea1b87713250185f8c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 11:44:31 +0100 Subject: [PATCH 140/210] Apply minor refactoring in new workflow --- .github/workflows/build.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b970e8f96..25aecaefa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,6 @@ jobs: strategy: matrix: package: [basemap_data, basemap_data_hires] - steps: - uses: actions/checkout@v4 @@ -33,13 +32,10 @@ jobs: with: python-version: "3.9" - - name: Install build dependencies - run: | - python -m pip install build wheel - - - name: Build package + - name: Build sdist and wheels run: | cd packages/${{ matrix.package }} + python -m pip install build wheel python -m build --sdist --wheel - uses: actions/upload-artifact@v4 @@ -48,7 +44,7 @@ jobs: name: dist-${{ matrix.package }} build_basemap: - name: Build basemap wheels (${{ matrix.os }}) + name: Build basemap package (${{ matrix.os }}) needs: [build_data] strategy: matrix: @@ -67,7 +63,6 @@ jobs: LD_LIBRARY_PATH="/project/packages/basemap/extern/lib" PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 - - os: windows-latest before_all: >- pwsh -Command " @@ -82,7 +77,6 @@ jobs: GEOS_DIR="D:/a/basemap/basemap/packages/basemap/extern" PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 - runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -92,12 +86,12 @@ jobs: with: python-version: "3.9" - - name: Build SDist + - name: Build sdist if: matrix.os == 'ubuntu-latest' run: | - python -m pip install build mkdir -p wheelhouse cd packages/basemap + python -m pip install build python -m build --sdist mv dist/* ../../wheelhouse/ From 1af79b545b1908536c7e7a2d6101b3be4c90a9fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 12:05:24 +0100 Subject: [PATCH 141/210] Simplify cibuildwheel before_all block for GNU/Linux --- .github/workflows/build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 25aecaefa..d716e327a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,10 +53,9 @@ jobs: - os: ubuntu-latest before_all: | echo "Starting BEFORE_ALL script" + echo "GEOS_DIR set to: ${GEOS_DIR}" cd "{package}" - export GEOS_DIR="$(pwd)/extern" - echo "GEOS_DIR set to: $GEOS_DIR" - python -c "import sys; sys.path.append('utils'); from GeosLibrary import GeosLibrary; GeosLibrary('3.6.5', root='extern').build('extern', njobs=16)" + python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" # LD_LIBRARY_PATH in environment is needed by auditwheel. environment: >- GEOS_DIR="/project/packages/basemap/extern" From f78a4b7ffb44de41e578804267085cb39989a317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 12:17:52 +0100 Subject: [PATCH 142/210] Move GEOS_VERSION definition to cibuildwheel GNU/Linux environment --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d716e327a..c89a76e2b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,4 @@ name: Build -env: - GEOS_VERSION: "3.6.5" on: push: @@ -58,6 +56,7 @@ jobs: python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" # LD_LIBRARY_PATH in environment is needed by auditwheel. environment: >- + GEOS_VERSION="3.6.5" GEOS_DIR="/project/packages/basemap/extern" LD_LIBRARY_PATH="/project/packages/basemap/extern/lib" PIP_PREFER_BINARY=1 From 8e85717e64bc876a6d4a9250543bd7197c23d89d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 12:44:36 +0100 Subject: [PATCH 143/210] Simplify cibuildwheel before_all block for Windows --- .github/workflows/build.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c89a76e2b..1b9aa5e5e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,13 +65,11 @@ jobs: before_all: >- pwsh -Command " Write-Host 'Starting BEFORE_ALL script'; - $pwd = Get-Location; - Write-Host 'Current directory:' $pwd; Set-Location '{package}'; - $env:GEOS_DIR = '{package}/extern'; - python -c 'import sys, os; sys.path.append(\"utils\"); from GeosLibrary import GeosLibrary; GeosLibrary(\"3.6.5\").build(\"extern\", njobs=16)' + python -c 'import utils; utils.GeosLibrary(\"${env:GEOS_VERSION}\").build(\"${env:GEOS_DIR}\", njobs=2)' " environment: >- + GEOS_VERSION="3.6.5" GEOS_DIR="D:/a/basemap/basemap/packages/basemap/extern" PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 From 57e0c402c6113e48aa90392417d6545d0339434e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 13:00:46 +0100 Subject: [PATCH 144/210] Edit before_all block in Windows workflow to use pwsh commands directly --- .github/workflows/build.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1b9aa5e5e..93828513f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,11 +63,10 @@ jobs: PYTHONUNBUFFERED=1 - os: windows-latest before_all: >- - pwsh -Command " - Write-Host 'Starting BEFORE_ALL script'; - Set-Location '{package}'; - python -c 'import utils; utils.GeosLibrary(\"${env:GEOS_VERSION}\").build(\"${env:GEOS_DIR}\", njobs=2)' - " + Write-Host "Starting BEFORE_ALL script" + Write-Host "GEOS_DIR set to: ${env:GEOS_DIR}" + Set-Location "{package}" + python -c "import utils; utils.GeosLibrary('${env:GEOS_VERSION}').build('${env:GEOS_DIR}', njobs=2)" environment: >- GEOS_VERSION="3.6.5" GEOS_DIR="D:/a/basemap/basemap/packages/basemap/extern" From 220cdc10203246f431b60a08c7038dbeac3e4dda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 13:32:24 +0100 Subject: [PATCH 145/210] Rewrite before_all block in Windows workflow to use cmd --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93828513f..14d0832ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,11 +62,11 @@ jobs: PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 - os: windows-latest - before_all: >- - Write-Host "Starting BEFORE_ALL script" - Write-Host "GEOS_DIR set to: ${env:GEOS_DIR}" - Set-Location "{package}" - python -c "import utils; utils.GeosLibrary('${env:GEOS_VERSION}').build('${env:GEOS_DIR}', njobs=2)" + before_all: | + echo Starting BEFORE_ALL script + echo GEOS_DIR set to: %GEOS_DIR% + cd "{package}" + python -c "import utils; utils.GeosLibrary('%GEOS_VERSION%').build('%GEOS_DIR%', njobs=2)" environment: >- GEOS_VERSION="3.6.5" GEOS_DIR="D:/a/basemap/basemap/packages/basemap/extern" From 18fe4c4ee1b90dedeb50814fcabefc067a55f762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 19 Feb 2025 14:12:42 +0100 Subject: [PATCH 146/210] Rewrite before_all block in Windows workflow as a one-liner --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 14d0832ba..e10d1f452 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,10 +62,10 @@ jobs: PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 - os: windows-latest - before_all: | - echo Starting BEFORE_ALL script - echo GEOS_DIR set to: %GEOS_DIR% - cd "{package}" + before_all: >- + echo Starting BEFORE_ALL script && + echo GEOS_DIR set to: %GEOS_DIR% && + cd "{package}" && python -c "import utils; utils.GeosLibrary('%GEOS_VERSION%').build('%GEOS_DIR%', njobs=2)" environment: >- GEOS_VERSION="3.6.5" From 37423253e1bc258543a84f70725008002fcb19eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 20 Feb 2025 19:28:25 +0100 Subject: [PATCH 147/210] Refactor handling of artifacts in new workflow --- .github/workflows/build.yml | 38 ++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e10d1f452..a7e9e4e02 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -109,27 +109,39 @@ jobs: path: | ./wheelhouse/*.whl ./wheelhouse/*.tar.gz - name: wheels-basemap-${{ matrix.os }} + name: dist-basemap-${{ matrix.os }} - upload_pypi: + check: + name: Check basemap packages needs: [build_data, build_basemap] runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + path: dist + pattern: "dist-*" + merge-multiple: true + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.9" + + - name: Check packages with twine + run: | + python -m pip install twine + python -m twine check dist/* + + upload: + name: Upload basemap packages + needs: [build_data, build_basemap, check] + runs-on: ubuntu-latest if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') - strategy: - matrix: - package: [basemap, basemap_data, basemap_data_hires] - include: - - package: basemap - artifact_pattern: "wheels-basemap-*" - - package: basemap_data - artifact_pattern: "dist-basemap_data" - - package: basemap_data_hires - artifact_pattern: "dist-basemap_data_hires" steps: - uses: actions/download-artifact@v4 with: - pattern: ${{ matrix.artifact_pattern }} path: dist + pattern: "dist-*" merge-multiple: true - name: Publish to PyPI From 51c1c2bbac601de185a8154870d2492342f55f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 20 Feb 2025 19:40:58 +0100 Subject: [PATCH 148/210] Apply minor modification in twine check --- .github/workflows/build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a7e9e4e02..5841848a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -112,7 +112,7 @@ jobs: name: dist-basemap-${{ matrix.os }} check: - name: Check basemap packages + name: Check packages needs: [build_data, build_basemap] runs-on: ubuntu-latest steps: @@ -130,10 +130,11 @@ jobs: - name: Check packages with twine run: | python -m pip install twine - python -m twine check dist/* + python -m twine check dist/*.tar.gz + python -m twine check dist/*.whl upload: - name: Upload basemap packages + name: Upload packages needs: [build_data, build_basemap, check] runs-on: ubuntu-latest if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') From 35d848f83aa13fee6d3e5ce32e3f07c364db97ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Thu, 20 Feb 2025 20:47:17 +0100 Subject: [PATCH 149/210] Remove unused CIBW_BUILD_REQUIRES environment variable --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5841848a7..28982fcd7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -100,7 +100,6 @@ jobs: CIBW_SKIP: "pp* *-musllinux_* *-win32 *-manylinux_i686 *-musllinux_i686 *-aarch64 *-armv7l" CIBW_BEFORE_ALL: ${{ matrix.before_all }} CIBW_ENVIRONMENT: ${{ matrix.environment }} - CIBW_BUILD_REQUIRES: "cython>=0.29,<3.1" with: package-dir: packages/basemap From 80f45d69dc8daf750dafb8e89866c89279c42aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 21 Feb 2025 19:00:45 +0100 Subject: [PATCH 150/210] Remove unused CIBW_PROJECT_REQUIRES_PYTHON environment variable --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 28982fcd7..b350f2095 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -93,7 +93,6 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.22.0 env: - CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9" CIBW_ARCHS_LINUX: auto64 CIBW_BUILD_VERBOSITY: 1 CIBW_BUILD: "cp39* cp310* cp311* cp312*" From 28c88a8956f570ae664d7fed843ba90b82beeb22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 21 Feb 2025 19:02:44 +0100 Subject: [PATCH 151/210] Make cibuildwheel store wheels in package dist folder --- .github/workflows/build.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b350f2095..9410e5a55 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,7 +38,9 @@ jobs: - uses: actions/upload-artifact@v4 with: - path: packages/${{ matrix.package }}/dist/* + path: | + packages/${{ matrix.package }}/dist/*.tar.gz + packages/${{ matrix.package }}/dist/*.whl name: dist-${{ matrix.package }} build_basemap: @@ -84,11 +86,9 @@ jobs: - name: Build sdist if: matrix.os == 'ubuntu-latest' run: | - mkdir -p wheelhouse cd packages/basemap python -m pip install build python -m build --sdist - mv dist/* ../../wheelhouse/ - name: Build wheels uses: pypa/cibuildwheel@v2.22.0 @@ -100,13 +100,14 @@ jobs: CIBW_BEFORE_ALL: ${{ matrix.before_all }} CIBW_ENVIRONMENT: ${{ matrix.environment }} with: - package-dir: packages/basemap + package-dir: "packages/basemap" + output-dir: "packages/basemap/dist" - uses: actions/upload-artifact@v4 with: path: | - ./wheelhouse/*.whl - ./wheelhouse/*.tar.gz + packages/basemap/dist/*.tar.gz + packages/basemap/dist/*.whl name: dist-basemap-${{ matrix.os }} check: From 21368dc187769aebf267b7cceb67ee501f844043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Fri, 21 Feb 2025 19:48:09 +0100 Subject: [PATCH 152/210] Redefine GEOS_DIR in new workflow using pwd command --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9410e5a55..a0963b565 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,8 +59,8 @@ jobs: # LD_LIBRARY_PATH in environment is needed by auditwheel. environment: >- GEOS_VERSION="3.6.5" - GEOS_DIR="/project/packages/basemap/extern" - LD_LIBRARY_PATH="/project/packages/basemap/extern/lib" + GEOS_DIR="$(pwd)/extern" + LD_LIBRARY_PATH="${GEOS_DIR}/lib" PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 - os: windows-latest @@ -71,7 +71,7 @@ jobs: python -c "import utils; utils.GeosLibrary('%GEOS_VERSION%').build('%GEOS_DIR%', njobs=2)" environment: >- GEOS_VERSION="3.6.5" - GEOS_DIR="D:/a/basemap/basemap/packages/basemap/extern" + GEOS_DIR="$(pwd)/extern" PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 runs-on: ${{ matrix.os }} From bed3d4d29d6b70ad8a174f57b4799c589fc83240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sat, 22 Feb 2025 18:24:59 +0100 Subject: [PATCH 153/210] Unify setup of cibuildwheel environment variables in new workflow --- .github/workflows/build.yml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0963b565..6ce986151 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,24 +56,12 @@ jobs: echo "GEOS_DIR set to: ${GEOS_DIR}" cd "{package}" python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" - # LD_LIBRARY_PATH in environment is needed by auditwheel. - environment: >- - GEOS_VERSION="3.6.5" - GEOS_DIR="$(pwd)/extern" - LD_LIBRARY_PATH="${GEOS_DIR}/lib" - PIP_PREFER_BINARY=1 - PYTHONUNBUFFERED=1 - os: windows-latest before_all: >- echo Starting BEFORE_ALL script && echo GEOS_DIR set to: %GEOS_DIR% && cd "{package}" && python -c "import utils; utils.GeosLibrary('%GEOS_VERSION%').build('%GEOS_DIR%', njobs=2)" - environment: >- - GEOS_VERSION="3.6.5" - GEOS_DIR="$(pwd)/extern" - PIP_PREFER_BINARY=1 - PYTHONUNBUFFERED=1 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -98,7 +86,13 @@ jobs: CIBW_BUILD: "cp39* cp310* cp311* cp312*" CIBW_SKIP: "pp* *-musllinux_* *-win32 *-manylinux_i686 *-musllinux_i686 *-aarch64 *-armv7l" CIBW_BEFORE_ALL: ${{ matrix.before_all }} - CIBW_ENVIRONMENT: ${{ matrix.environment }} + CIBW_ENVIRONMENT: > + GEOS_VERSION="3.6.5" + GEOS_DIR="$(pwd)/extern" + PIP_PREFER_BINARY=1 + PYTHONUNBUFFERED=1 + LD_LIBRARY_PATH="${GEOS_DIR}/lib" + # LD_LIBRARY_PATH in environment is needed by auditwheel (Linux). with: package-dir: "packages/basemap" output-dir: "packages/basemap/dist" From 6170ef07dff13b96901b916fcc12b473d7aa1ae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sat, 22 Feb 2025 18:26:51 +0100 Subject: [PATCH 154/210] Make before_all block use YAML folded style --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6ce986151..e809dec60 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,13 +51,13 @@ jobs: os: [ubuntu-latest, windows-latest] include: - os: ubuntu-latest - before_all: | - echo "Starting BEFORE_ALL script" - echo "GEOS_DIR set to: ${GEOS_DIR}" - cd "{package}" + before_all: > + echo "Starting BEFORE_ALL script" && + echo "GEOS_DIR set to: ${GEOS_DIR}" && + cd "{package}" && python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" - os: windows-latest - before_all: >- + before_all: > echo Starting BEFORE_ALL script && echo GEOS_DIR set to: %GEOS_DIR% && cd "{package}" && From 1a839251bbcb9726aef26e8b50abb1a884f3d847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sat, 22 Feb 2025 18:31:14 +0100 Subject: [PATCH 155/210] Bring back hyphen in YAML folded syntax This ensures that no line break is appended at the end of the multiline string. --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e809dec60..be11641f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,13 +51,13 @@ jobs: os: [ubuntu-latest, windows-latest] include: - os: ubuntu-latest - before_all: > + before_all: >- echo "Starting BEFORE_ALL script" && echo "GEOS_DIR set to: ${GEOS_DIR}" && cd "{package}" && python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" - os: windows-latest - before_all: > + before_all: >- echo Starting BEFORE_ALL script && echo GEOS_DIR set to: %GEOS_DIR% && cd "{package}" && @@ -86,7 +86,7 @@ jobs: CIBW_BUILD: "cp39* cp310* cp311* cp312*" CIBW_SKIP: "pp* *-musllinux_* *-win32 *-manylinux_i686 *-musllinux_i686 *-aarch64 *-armv7l" CIBW_BEFORE_ALL: ${{ matrix.before_all }} - CIBW_ENVIRONMENT: > + CIBW_ENVIRONMENT: >- GEOS_VERSION="3.6.5" GEOS_DIR="$(pwd)/extern" PIP_PREFER_BINARY=1 From 55b9718f4451f80d9e5c52d5bd7737e194031eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sat, 22 Feb 2025 18:35:22 +0100 Subject: [PATCH 156/210] Apply minor reordering in build_data job --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be11641f6..8d7a9810f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,10 +18,10 @@ on: jobs: build_data: name: Build data packages - runs-on: ubuntu-latest strategy: matrix: package: [basemap_data, basemap_data_hires] + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 71694578de69579d9dbce89cb2383366e0f9aa06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Sat, 22 Feb 2025 18:56:58 +0100 Subject: [PATCH 157/210] Remove unused CIBW_ARCHS_LINUX environment variable --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8d7a9810f..23a7a299b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -81,7 +81,6 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.22.0 env: - CIBW_ARCHS_LINUX: auto64 CIBW_BUILD_VERBOSITY: 1 CIBW_BUILD: "cp39* cp310* cp311* cp312*" CIBW_SKIP: "pp* *-musllinux_* *-win32 *-manylinux_i686 *-musllinux_i686 *-aarch64 *-armv7l" From 05e1608cfe0b934a78baf167ce14305c26120e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 08:50:54 +0100 Subject: [PATCH 158/210] Update minimum pin for Cython in requirements The `noexcept` syntax was first included in Cython 3.0, and it was backported only from Cython 0.29.31 onwards. --- packages/basemap/pyproject.toml | 2 +- packages/basemap/requirements-setup.txt | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/basemap/pyproject.toml b/packages/basemap/pyproject.toml index 8ab927ff8..d5dfe2906 100644 --- a/packages/basemap/pyproject.toml +++ b/packages/basemap/pyproject.toml @@ -3,6 +3,6 @@ requires = [ 'setuptools', 'wheel', 'numpy == 2.0.0', - 'cython >= 0.29, < 3.1', + 'cython >= 0.29.31, < 3.1', ] build-backend = "setuptools.build_meta" diff --git a/packages/basemap/requirements-setup.txt b/packages/basemap/requirements-setup.txt index 6f39a1a05..d12bb0661 100644 --- a/packages/basemap/requirements-setup.txt +++ b/packages/basemap/requirements-setup.txt @@ -1,2 +1 @@ -cython >= 0.29, < 3.1; python_version >= "3.3" or python_version < "3.0" -cython >= 0.26, < 0.27; python_version == "3.2" +cython >= 0.29.31, < 3.1 From 31338336fa1a3001621ea54114a62be60c417662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 08:52:30 +0100 Subject: [PATCH 159/210] Remove unneeded legacy_implicit_noexcept in setup.py Since the code is migrated to use `noexcept`, this Cython directive is no longer needed. --- packages/basemap/setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/basemap/setup.py b/packages/basemap/setup.py index 8d2bebdd0..3a16d3d64 100644 --- a/packages/basemap/setup.py +++ b/packages/basemap/setup.py @@ -162,7 +162,6 @@ def run(self): for ext in ext_modules: ext.cython_directives = [ ("language_level", str(sys.version_info[0])), - ("legacy_implicit_noexcept", True), ][:1 + int(cython_major_version >= 3)] # Define all the different requirements. From d6c30d7698b46afcad0111990c8c3e9d3cf5389a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 10:31:37 +0100 Subject: [PATCH 160/210] Update CHANGELOG --- CHANGELOG.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4244ab5a1..d9821539c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,18 @@ https://semver.org/spec/v2.0.0.html ## [Unreleased] +### Added +- Support `numpy` 2.0 (PR [#614] by @cvanelteren, solves issue [#604]). + +### Changed +- **BREAKING CHANGE**: Set Python minimum supported version to 3.9. +- **BREAKING CHANGE**: Migrate `basemap` libraries to use implicit + namespace packages (PR [#576] by @ksunden). +- Migrate workflows to use `cibuildwheel` (PR [#614] by @cvanelteren). + +### Fixed +- Fix Cython extension to use `noexcept` (PR [#615] by @cvanelteren). + ## [1.4.1] - 2024-02-15 ### Changed @@ -1098,6 +1110,12 @@ https://semver.org/spec/v2.0.0.html - Fix glitches in drawing of parallels and meridians. +[#615]: +https://github.com/matplotlib/basemap/pull/615 +[#614]: +https://github.com/matplotlib/basemap/pull/614 +[#604]: +https://github.com/matplotlib/basemap/issues/604 [#598]: https://github.com/matplotlib/basemap/pull/598 [#595]: @@ -1126,6 +1144,8 @@ https://github.com/matplotlib/basemap/pull/580 https://github.com/matplotlib/basemap/issues/579 [#577]: https://github.com/matplotlib/basemap/issues/577 +[#576]: +https://github.com/matplotlib/basemap/pull/576 [#574]: https://github.com/matplotlib/basemap/issues/574 [#573]: From 1b6ee1c61e0bd1c9d2333ce69fa9f65f8c366a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 10:38:08 +0100 Subject: [PATCH 161/210] Remove deprecated bdist_wheel.universal option --- CHANGELOG.md | 3 +++ packages/basemap_data/setup.cfg | 3 --- packages/basemap_data_hires/setup.cfg | 3 --- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9821539c..d3cab477e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,9 @@ https://semver.org/spec/v2.0.0.html ### Fixed - Fix Cython extension to use `noexcept` (PR [#615] by @cvanelteren). +### Removed +- Deprecated `bdist_wheel.universal` option when building wheels. + ## [1.4.1] - 2024-02-15 ### Changed diff --git a/packages/basemap_data/setup.cfg b/packages/basemap_data/setup.cfg index 46fc44d00..e22ef7143 100644 --- a/packages/basemap_data/setup.cfg +++ b/packages/basemap_data/setup.cfg @@ -7,6 +7,3 @@ license_files = [sdist] formats = zip - -[bdist_wheel] -universal = 1 diff --git a/packages/basemap_data_hires/setup.cfg b/packages/basemap_data_hires/setup.cfg index e408a4da9..e43de0337 100644 --- a/packages/basemap_data_hires/setup.cfg +++ b/packages/basemap_data_hires/setup.cfg @@ -5,6 +5,3 @@ license_files = [sdist] formats = zip - -[bdist_wheel] -universal = 1 From 52eb8509c069f143c7f0089583d5693fc5d4abae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 11:15:20 +0100 Subject: [PATCH 162/210] Ensure graceful error in GeosLibrary.__del__ with missing instance attributes --- packages/basemap/utils/GeosLibrary.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/basemap/utils/GeosLibrary.py b/packages/basemap/utils/GeosLibrary.py index 4db6b88e9..0462d6775 100644 --- a/packages/basemap/utils/GeosLibrary.py +++ b/packages/basemap/utils/GeosLibrary.py @@ -1,7 +1,7 @@ #! /usr/bin/env python # -*- coding: utf-8 -*- # -# Copyright (c) 2021-2024 Víctor Molina García +# Copyright (c) 2021-2025 Víctor Molina García # # GeosLibrary.py is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published @@ -62,7 +62,7 @@ def __init__(self, version, root=None): def __del__(self): """Clean up after :class:`GeosLibrary` destruction.""" - if self.temp: + if getattr(self, "temp", None) and getattr(self, "root", None): try: shutil.rmtree(self.root) except OSError: From 2b00aa4a80eb61e05fca8f1d25450b3d3030ee29 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Mon, 24 Feb 2025 13:29:25 +0100 Subject: [PATCH 163/210] rm changes to setup --- .github/workflows/build.yml | 2 ++ packages/basemap/requirements-test.txt | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 23a7a299b..3b5e6ec7c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -85,6 +85,8 @@ jobs: CIBW_BUILD: "cp39* cp310* cp311* cp312*" CIBW_SKIP: "pp* *-musllinux_* *-win32 *-manylinux_i686 *-musllinux_i686 *-aarch64 *-armv7l" CIBW_BEFORE_ALL: ${{ matrix.before_all }} + CIBW_TEST_REQUIRES: pytest + CIBW_TEST_COMMAND: "pytest {project}/packages/basemap" CIBW_ENVIRONMENT: >- GEOS_VERSION="3.6.5" GEOS_DIR="$(pwd)/extern" diff --git a/packages/basemap/requirements-test.txt b/packages/basemap/requirements-test.txt index 7491b2686..f2a52ffeb 100644 --- a/packages/basemap/requirements-test.txt +++ b/packages/basemap/requirements-test.txt @@ -21,3 +21,4 @@ pytest-cov >= 2.5, < 2.6; python_version == "3.2" pytest-cov >= 2.5, < 2.6; python_version == "3.3" pytest-cov >= 2.5, < 2.9; python_version == "3.4" pytest-cov >= 2.9, < 4.2; python_version >= "3.5" +pytest From b13c6a46bbb13b66ef3cfebdc604a5f5f4e8f560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 19:52:53 +0100 Subject: [PATCH 164/210] Invoke pytest in workflow with python -m syntax --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b5e6ec7c..2a83ea8a6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,7 +86,7 @@ jobs: CIBW_SKIP: "pp* *-musllinux_* *-win32 *-manylinux_i686 *-musllinux_i686 *-aarch64 *-armv7l" CIBW_BEFORE_ALL: ${{ matrix.before_all }} CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: "pytest {project}/packages/basemap" + CIBW_TEST_COMMAND: "python -m pytest {project}/packages/basemap" CIBW_ENVIRONMENT: >- GEOS_VERSION="3.6.5" GEOS_DIR="$(pwd)/extern" From beab20689fc4aba669c2b22d43ac2fb9758f564c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 19:54:14 +0100 Subject: [PATCH 165/210] Remove duplicate pytest requirement in requirements-test.txt --- packages/basemap/requirements-test.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/basemap/requirements-test.txt b/packages/basemap/requirements-test.txt index f2a52ffeb..7491b2686 100644 --- a/packages/basemap/requirements-test.txt +++ b/packages/basemap/requirements-test.txt @@ -21,4 +21,3 @@ pytest-cov >= 2.5, < 2.6; python_version == "3.2" pytest-cov >= 2.5, < 2.6; python_version == "3.3" pytest-cov >= 2.5, < 2.9; python_version == "3.4" pytest-cov >= 2.9, < 4.2; python_version >= "3.5" -pytest From 5c6f0724cfe1d52af97099229563972bbcc733e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 19:54:37 +0100 Subject: [PATCH 166/210] Replace CIBW_TEST_REQUIRES with CIBW_TEST_EXTRAS --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2a83ea8a6..ed065d625 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -85,7 +85,7 @@ jobs: CIBW_BUILD: "cp39* cp310* cp311* cp312*" CIBW_SKIP: "pp* *-musllinux_* *-win32 *-manylinux_i686 *-musllinux_i686 *-aarch64 *-armv7l" CIBW_BEFORE_ALL: ${{ matrix.before_all }} - CIBW_TEST_REQUIRES: pytest + CIBW_TEST_EXTRAS: "test" CIBW_TEST_COMMAND: "python -m pytest {project}/packages/basemap" CIBW_ENVIRONMENT: >- GEOS_VERSION="3.6.5" From 64989db1a0434e2295f4198cb8f6f3c9900e63e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 20:19:44 +0100 Subject: [PATCH 167/210] Bump library versions to 2.0.0-dev --- packages/basemap/requirements.txt | 2 +- packages/basemap/src/_geoslib.pyx | 2 +- packages/basemap/src/mpl_toolkits/basemap/__init__.py | 2 +- packages/basemap_data/setup.py | 2 +- packages/basemap_data_hires/setup.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/basemap/requirements.txt b/packages/basemap/requirements.txt index 78a1ce0d3..22a60005e 100644 --- a/packages/basemap/requirements.txt +++ b/packages/basemap/requirements.txt @@ -1,4 +1,4 @@ -basemap_data >= 1.3.2, < 1.4 +basemap_data >= 1.3.2, < 3.0 numpy >= 2.0.0; python_version >= "3.9" matplotlib >= 1.5, < 3.9; python_version >= "3.5" diff --git a/packages/basemap/src/_geoslib.pyx b/packages/basemap/src/_geoslib.pyx index 6d1e36914..1298e6e91 100644 --- a/packages/basemap/src/_geoslib.pyx +++ b/packages/basemap/src/_geoslib.pyx @@ -2,7 +2,7 @@ import sys import numpy cimport numpy as cnp -__version__ = "1.5.0-dev" +__version__ = "2.0.0-dev" # Need some Python C-API functions for strings. diff --git a/packages/basemap/src/mpl_toolkits/basemap/__init__.py b/packages/basemap/src/mpl_toolkits/basemap/__init__.py index a7050beed..3f61c2c4f 100644 --- a/packages/basemap/src/mpl_toolkits/basemap/__init__.py +++ b/packages/basemap/src/mpl_toolkits/basemap/__init__.py @@ -48,7 +48,7 @@ from . proj import Proj -__version__ = "1.5.0-dev" +__version__ = "2.0.0-dev" # basemap data files now installed in lib/matplotlib/toolkits/basemap/data # check to see if environment variable BASEMAPDATA set to a directory, diff --git a/packages/basemap_data/setup.py b/packages/basemap_data/setup.py index 42863fca7..abc05e2d7 100644 --- a/packages/basemap_data/setup.py +++ b/packages/basemap_data/setup.py @@ -73,7 +73,7 @@ def get_content(name, splitlines=False): "name": "basemap_data", "version": - "1.3.2", + "2.0.0-dev", "license": "GNU Lesser General Public License v3 or later (LGPLv3+)", "description": diff --git a/packages/basemap_data_hires/setup.py b/packages/basemap_data_hires/setup.py index 9b8630ff5..159f3ab03 100644 --- a/packages/basemap_data_hires/setup.py +++ b/packages/basemap_data_hires/setup.py @@ -51,7 +51,7 @@ def get_content(name, splitlines=False): "name": "basemap_data_hires", "version": - "1.3.2", + "2.0.0-dev", "license": "GNU Lesser General Public License v3 or later (LGPLv3+)", "description": From 8cd627d5ee03643d685bae54a5abe53a55511831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 20:21:07 +0100 Subject: [PATCH 168/210] Remove remaining empty __init__.py files --- packages/basemap_data/src/__init__.py | 0 packages/basemap_data_hires/src/__init__.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 packages/basemap_data/src/__init__.py delete mode 100644 packages/basemap_data_hires/src/__init__.py diff --git a/packages/basemap_data/src/__init__.py b/packages/basemap_data/src/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/basemap_data_hires/src/__init__.py b/packages/basemap_data_hires/src/__init__.py deleted file mode 100644 index e69de29bb..000000000 From cc403074d3f8f43ccfeddc99e60e6737144d1138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 20:22:29 +0100 Subject: [PATCH 169/210] Remove outdated classifiers in setup.py files --- packages/basemap/setup.py | 1 - packages/basemap_data/setup.py | 1 - packages/basemap_data_hires/setup.py | 1 - 3 files changed, 3 deletions(-) diff --git a/packages/basemap/setup.py b/packages/basemap/setup.py index 44b5d039a..55231eec4 100644 --- a/packages/basemap/setup.py +++ b/packages/basemap/setup.py @@ -213,7 +213,6 @@ def run(self): "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", - "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Visualization", "Topic :: Software Development :: Libraries :: Python Modules", diff --git a/packages/basemap_data/setup.py b/packages/basemap_data/setup.py index abc05e2d7..d56dd243d 100644 --- a/packages/basemap_data/setup.py +++ b/packages/basemap_data/setup.py @@ -98,7 +98,6 @@ def get_content(name, splitlines=False): "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", "Operating System :: OS Independent", - "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Visualization", "Topic :: Software Development :: Libraries :: Python Modules", diff --git a/packages/basemap_data_hires/setup.py b/packages/basemap_data_hires/setup.py index 159f3ab03..7421194d1 100644 --- a/packages/basemap_data_hires/setup.py +++ b/packages/basemap_data_hires/setup.py @@ -76,7 +76,6 @@ def get_content(name, splitlines=False): "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", "Operating System :: OS Independent", - "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Visualization", "Topic :: Software Development :: Libraries :: Python Modules", From 4dfa9325d78fd8ddcff141059ac24d7909448bcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 20:26:50 +0100 Subject: [PATCH 170/210] Remove pleistocenic marker workarounds in basemap setup.py --- packages/basemap/setup.py | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/packages/basemap/setup.py b/packages/basemap/setup.py index 55231eec4..2db26ba6b 100644 --- a/packages/basemap/setup.py +++ b/packages/basemap/setup.py @@ -164,26 +164,6 @@ def run(self): ("language_level", str(sys.version_info[0])), ][:1 + int(cython_major_version >= 3)] -# Define all the different requirements. -setup_requires = get_content("requirements-setup.txt", splitlines=True) -install_requires = get_content("requirements.txt", splitlines=True) -if sys.version_info[:2] == (3, 2): - # Hack for Python 3.2 because pip < 8 cannot handle version markers. - marker1 = '; python_version == "3.2"' - marker2 = '; python_version >= "2.7"' - setup_requires = [ - item.replace(marker1, "").replace(marker2, "") for item in setup_requires - if item.endswith(marker1) or item.endswith(marker2) - or "python_version" not in item] - install_requires = [ - item.replace(marker1, "").replace(marker2, "") for item in install_requires - if item.endswith(marker1) or item.endswith(marker2) - or "python_version" not in item] -else: - marker1 = '; python_version == "3.2"' - setup_requires = [item for item in setup_requires if not item.endswith(marker1)] - install_requires = [item for item in install_requires if not item.endswith(marker1)] - setup(**{ "name": "basemap", @@ -236,9 +216,9 @@ def run(self): "<3.13", ]), "setup_requires": - setup_requires, + get_content("requirements-setup.txt", splitlines=True), "install_requires": - install_requires, + get_content("requirements.txt", splitlines=True), "extras_require": { "doc": get_content("requirements-doc.txt", splitlines=True), From 8ab734d236be4021caca2180838233ff7527e91c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 20:30:02 +0100 Subject: [PATCH 171/210] Remove outdated Cython switches in basemap setup.py --- packages/basemap/setup.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/basemap/setup.py b/packages/basemap/setup.py index 2db26ba6b..1c47e85bf 100644 --- a/packages/basemap/setup.py +++ b/packages/basemap/setup.py @@ -14,12 +14,6 @@ from setuptools.command.sdist import sdist from setuptools.extension import Extension -try: - import Cython - cython_major_version = int(Cython.__version__.split(".", 1)[0]) -except ImportError: - cython_major_version = 0 - def get_content(name, splitlines=False): """Return the file contents with project root as root folder.""" @@ -162,7 +156,7 @@ def run(self): for ext in ext_modules: ext.cython_directives = [ ("language_level", str(sys.version_info[0])), - ][:1 + int(cython_major_version >= 3)] + ] setup(**{ "name": From f197052bd979170ac6a746d8db6879224e9ad8ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 20:41:39 +0100 Subject: [PATCH 172/210] Update library requirements --- CHANGELOG.md | 11 +++++++++++ packages/basemap/requirements.txt | 12 +++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3cab477e..58a34881f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,17 @@ https://semver.org/spec/v2.0.0.html - **BREAKING CHANGE**: Migrate `basemap` libraries to use implicit namespace packages (PR [#576] by @ksunden). - Migrate workflows to use `cibuildwheel` (PR [#614] by @cvanelteren). +- Update library dependencies: + - Upgrade upper limit for `basemap_data` to 3.0. + - Upgrade lower limit for `packaging` to 20.5. + - Upgrade upper limit for `packaging` to 25.0. + - Upgrade lower limit for `numpy` to 2.0. + - Upgrade upper limit for `numpy` to 2.3. + - Upgrade lower limit for `matplotlib` to 3.4. + - Upgrade upper limit for `matplotlib` to 3.11. + - Upgrade lower limit for `pyproj` to 3.0. + - Upgrade upper limit for `pyproj` to 3.8. + - Upgrade lower limit for `pyshp` to 2.0. ### Fixed - Fix Cython extension to use `noexcept` (PR [#615] by @cvanelteren). diff --git a/packages/basemap/requirements.txt b/packages/basemap/requirements.txt index 22a60005e..3f20dc53c 100644 --- a/packages/basemap/requirements.txt +++ b/packages/basemap/requirements.txt @@ -1,10 +1,8 @@ basemap_data >= 1.3.2, < 3.0 +packaging >= 20.5, < 25.0 -numpy >= 2.0.0; python_version >= "3.9" -matplotlib >= 1.5, < 3.9; python_version >= "3.5" +numpy >= 2.0, < 2.3 +matplotlib >= 3.4, < 3.11 -pyproj >= 1.9.3, < 3.7.0; python_version >= "3.5" - -pyshp >= 1.2, < 2.4; python_version >= "2.7" - -packaging >= 16.0, < 25.0; python_version >= "3.5" +pyproj >= 3.0, < 3.8 +pyshp >= 2.0, < 2.4 From ccbe443409e598b1477aaa37ee626c71f44b5df5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 21:02:36 +0100 Subject: [PATCH 173/210] Update test requirements --- CHANGELOG.md | 8 ++++++ packages/basemap/requirements-test.txt | 25 +++---------------- packages/basemap/setup.cfg | 2 -- .../test/mpl_toolkits/basemap/test_Basemap.py | 5 +--- .../test/mpl_toolkits/basemap/test_cm.py | 6 +---- .../mpl_toolkits/basemap/test_diagnostic.py | 6 +---- .../test/mpl_toolkits/basemap/test_proj.py | 6 +---- .../basemap/test/mpl_toolkits/test_basemap.py | 6 +---- 8 files changed, 16 insertions(+), 48 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58a34881f..bdaee824f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,14 @@ https://semver.org/spec/v2.0.0.html - Upgrade lower limit for `pyproj` to 3.0. - Upgrade upper limit for `pyproj` to 3.8. - Upgrade lower limit for `pyshp` to 2.0. +- Update test dependencies: + - Remove dependency on `unittest2`. + - Upgrade lower limit for `pytest` to 7.0. + - Upgrade upper limit for `pytest` to 8.4. + - Upgrade lower limit for `pytest-cov` to 3.0. + - Upgrade upper limit for `pytest-cov` to 6.1. + - Downgrade lower limit for `coverage` to 5.0. + - Upgrade upper limit for `coverage` to 7.7. ### Fixed - Fix Cython extension to use `noexcept` (PR [#615] by @cvanelteren). diff --git a/packages/basemap/requirements-test.txt b/packages/basemap/requirements-test.txt index 7491b2686..6a0458527 100644 --- a/packages/basemap/requirements-test.txt +++ b/packages/basemap/requirements-test.txt @@ -1,23 +1,4 @@ -unittest2; python_version <= "3.9" +pytest >= 7.0, < 8.4 -pytest >= 3.2.0, < 3.3; python_version == "2.6" -pytest >= 4.6.9, < 5.0; python_version == "2.7" -pytest >= 2.9.0, < 3.0; python_version == "3.2" -pytest >= 3.2.0, < 3.3; python_version == "3.3" -pytest >= 4.6.9, < 5.0; python_version == "3.4" -pytest >= 6.1.2, < 6.2; python_version == "3.5" -pytest >= 6.2.5, < 7.5; python_version >= "3.6" - -coverage >= 4.5, < 5.0; python_version == "2.6" -coverage >= 5.5, < 6.0; python_version == "2.7" -coverage >= 3.7, < 4.0; python_version == "3.2" -coverage >= 4.5, < 5.0; python_version == "3.3" -coverage >= 4.5, < 5.0; python_version == "3.4" -coverage >= 5.5, < 6.0; python_version == "3.5" -coverage >= 5.5, < 7.4; python_version >= "3.6" -pytest-cov >= 2.5, < 2.6; python_version == "2.6" -pytest-cov >= 2.9, < 3.0; python_version == "2.7" -pytest-cov >= 2.5, < 2.6; python_version == "3.2" -pytest-cov >= 2.5, < 2.6; python_version == "3.3" -pytest-cov >= 2.5, < 2.9; python_version == "3.4" -pytest-cov >= 2.9, < 4.2; python_version >= "3.5" +pytest-cov >= 3.0, < 6.1 +coverage >= 5.0, < 7.7 diff --git a/packages/basemap/setup.cfg b/packages/basemap/setup.cfg index 58e39b69a..bf415ac0a 100644 --- a/packages/basemap/setup.cfg +++ b/packages/basemap/setup.cfg @@ -22,8 +22,6 @@ ignore = [tool:pytest] filterwarnings = error - # To be removed when replacing `unittest2`. - ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated:DeprecationWarning:unittest2.compatibility:143 # To be removed with `dateutil` release after 2.8.2. # See: https://github.com/dateutil/dateutil/issues/1314 ignore:datetime.datetime.utcfromtimestamp\(\) is deprecated:DeprecationWarning:dateutil.tz.tz:37 diff --git a/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py b/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py index 6a94d291f..f18b2c29e 100644 --- a/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py +++ b/packages/basemap/test/mpl_toolkits/basemap/test_Basemap.py @@ -4,10 +4,7 @@ import shutil import tempfile import datetime as dt -try: - import unittest2 as unittest -except ImportError: - import unittest +import unittest import numpy as np import matplotlib as mpl diff --git a/packages/basemap/test/mpl_toolkits/basemap/test_cm.py b/packages/basemap/test/mpl_toolkits/basemap/test_cm.py index 77df7d3bf..66d8ef665 100644 --- a/packages/basemap/test/mpl_toolkits/basemap/test_cm.py +++ b/packages/basemap/test/mpl_toolkits/basemap/test_cm.py @@ -1,10 +1,6 @@ """Import test for :mod:`mpl_toolkits.basemap.cm`.""" -try: - import unittest2 as unittest -except ImportError: - import unittest - +import unittest from mpl_toolkits.basemap import cm diff --git a/packages/basemap/test/mpl_toolkits/basemap/test_diagnostic.py b/packages/basemap/test/mpl_toolkits/basemap/test_diagnostic.py index b5bacce3a..f5ac65564 100644 --- a/packages/basemap/test/mpl_toolkits/basemap/test_diagnostic.py +++ b/packages/basemap/test/mpl_toolkits/basemap/test_diagnostic.py @@ -1,11 +1,7 @@ """Import test for :mod:`mpl_toolkits.basemap.diagnostic`.""" +import unittest from collections import namedtuple -try: - import unittest2 as unittest -except ImportError: - import unittest - from mpl_toolkits.basemap import diagnostic diff --git a/packages/basemap/test/mpl_toolkits/basemap/test_proj.py b/packages/basemap/test/mpl_toolkits/basemap/test_proj.py index dfdcd69ba..4385c8f6f 100644 --- a/packages/basemap/test/mpl_toolkits/basemap/test_proj.py +++ b/packages/basemap/test/mpl_toolkits/basemap/test_proj.py @@ -1,10 +1,6 @@ """Import test for :mod:`mpl_toolkits.basemap.proj`.""" -try: - import unittest2 as unittest -except ImportError: - import unittest - +import unittest from mpl_toolkits.basemap.proj import Proj diff --git a/packages/basemap/test/mpl_toolkits/test_basemap.py b/packages/basemap/test/mpl_toolkits/test_basemap.py index 80a31cb2e..2070c2e50 100644 --- a/packages/basemap/test/mpl_toolkits/test_basemap.py +++ b/packages/basemap/test/mpl_toolkits/test_basemap.py @@ -1,10 +1,6 @@ """Import test for the :mod:`mpl_toolkits.basemap` package.""" -try: - import unittest2 as unittest -except ImportError: - import unittest - +import unittest from mpl_toolkits import basemap From ee311e44c7c124730f1afd2cfa3525f0a0fbeda1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 21:13:31 +0100 Subject: [PATCH 174/210] Update optional library requirements --- CHANGELOG.md | 9 +++++++++ packages/basemap/requirements-owslib.txt | 9 +-------- packages/basemap/requirements-pillow.txt | 9 +-------- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bdaee824f..7225afec4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,11 @@ https://semver.org/spec/v2.0.0.html - Upgrade lower limit for `pyproj` to 3.0. - Upgrade upper limit for `pyproj` to 3.8. - Upgrade lower limit for `pyshp` to 2.0. +- Update optional library dependencies: + - Upgrade lower limit for `pillow` to 10.3 due to + vulnerabilities [CVE-2023-50447] and [CVE-2024-28219]. + - Upgrade upper limit for `pillow` to 11.2. + - Upgrade upper limit for `OWSLib` to 0.33. - Update test dependencies: - Remove dependency on `unittest2`. - Upgrade lower limit for `pytest` to 7.0. @@ -1340,6 +1345,10 @@ https://github.com/matplotlib/basemap/compare/v1.0.3rel...v1.0.4rel [1.0.3]: https://github.com/matplotlib/basemap/tree/v1.0.3rel +[CVE-2024-28219]: +https://nvd.nist.gov/vuln/detail/CVE-2024-28219 +[CVE-2023-50447]: +https://nvd.nist.gov/vuln/detail/CVE-2023-50447 [CVE-2023-27476]: https://nvd.nist.gov/vuln/detail/CVE-2023-27476 [CVE-2022-45198]: diff --git a/packages/basemap/requirements-owslib.txt b/packages/basemap/requirements-owslib.txt index 5c4f0439d..5c7425ee0 100644 --- a/packages/basemap/requirements-owslib.txt +++ b/packages/basemap/requirements-owslib.txt @@ -1,8 +1 @@ -ordereddict; python_version == "2.6" -OWSLib >= 0.8.0, < 0.15.0; python_version == "2.6" -OWSLib >= 0.8.0, < 0.19.0; python_version == "2.7" -OWSLib >= 0.8.0, < 0.11.0; python_version == "3.2" -OWSLib >= 0.8.0, < 0.11.0; python_version == "3.3" -OWSLib >= 0.8.0, < 0.18.0; python_version == "3.4" -OWSLib >= 0.8.0, < 0.20.0; python_version == "3.5" -OWSLib >= 0.28.1, < 0.30.0; python_version >= "3.6" +OWSLib >= 0.28.1, < 0.33 diff --git a/packages/basemap/requirements-pillow.txt b/packages/basemap/requirements-pillow.txt index 647257799..89493b01d 100644 --- a/packages/basemap/requirements-pillow.txt +++ b/packages/basemap/requirements-pillow.txt @@ -1,8 +1 @@ -pillow >= 3.4.0, < 4.0.0; python_version == "2.6" -pillow >= 6.2.2, < 7.0.0; python_version == "2.7" -pillow >= 3.4.0, < 4.0.0; python_version == "3.2" -pillow >= 4.3.0, < 5.0.0; python_version == "3.3" -pillow >= 5.4.0, < 6.0.0; python_version == "3.4" -pillow >= 7.1.0, < 8.0.0; python_version == "3.5" -pillow >= 8.3.2, < 9.0.0; python_version == "3.6" -pillow >= 9.4.0, < 10.2.0; python_version >= "3.7" +pillow >= 10.3, < 11.2 From 52b1e01a60965363ed62b2fc55a6e848ae38997e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 21:19:46 +0100 Subject: [PATCH 175/210] Update lint requirements --- CHANGELOG.md | 8 ++++++++ packages/basemap/requirements-lint.txt | 19 +++---------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7225afec4..8fd6cd68a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,14 @@ https://semver.org/spec/v2.0.0.html vulnerabilities [CVE-2023-50447] and [CVE-2024-28219]. - Upgrade upper limit for `pillow` to 11.2. - Upgrade upper limit for `OWSLib` to 0.33. +- Update lint dependencies: + - Remove dependency on `unittest2`. + - Upgrade lower limit for `flake8` to 3.9. + - Upgrade upper limit for `flake8` to 7.2. + - Upgrade lower limit for `astroid` to 3.0. + - Upgrade upper limit for `astroid` to 3.4. + - Upgrade lower limit for `pylint` to 3.0. + - Upgrade upper limit for `pylint` to 3.4. - Update test dependencies: - Remove dependency on `unittest2`. - Upgrade lower limit for `pytest` to 7.0. diff --git a/packages/basemap/requirements-lint.txt b/packages/basemap/requirements-lint.txt index 2b2a187c4..a13cd4285 100644 --- a/packages/basemap/requirements-lint.txt +++ b/packages/basemap/requirements-lint.txt @@ -1,17 +1,4 @@ -unittest2; python_version <= "3.9" +flake8 >= 3.9, < 7.2 -flake8 >= 2.6, < 3.0; python_version == "2.6" -flake8 >= 2.6, < 4.0; python_version == "2.7" -flake8 >= 2.6, < 3.0; python_version == "3.2" -flake8 >= 2.6, < 3.0; python_version == "3.3" -flake8 >= 2.6, < 3.9; python_version == "3.4" -flake8 >= 2.6, < 6.2; python_version >= "3.5" - -astroid >= 1.6, < 2.0; python_version == "2.7" -astroid >= 2.4, < 2.5; python_version == "3.5" -astroid >= 2.5, < 2.7; python_version == "3.6" -astroid >= 2.8, < 3.1; python_version >= "3.7" -pylint >= 1.9, < 2.0; python_version == "2.7" -pylint >= 2.6, < 2.7; python_version == "3.5" -pylint >= 2.7, < 2.10; python_version == "3.6" -pylint >= 2.11, < 3.1; python_version >= "3.7" +astroid >= 3.0, < 3.4 +pylint >= 3.0, < 3.4 From 0be520e0ba6956372aea6cddc8995dff82673da5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 21:24:42 +0100 Subject: [PATCH 176/210] Update doc requirements --- CHANGELOG.md | 7 +++++++ packages/basemap/requirements-doc.txt | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fd6cd68a..539eeb530 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,13 @@ https://semver.org/spec/v2.0.0.html vulnerabilities [CVE-2023-50447] and [CVE-2024-28219]. - Upgrade upper limit for `pillow` to 11.2. - Upgrade upper limit for `OWSLib` to 0.33. +- Update doc dependencies: + - Upgrade upper limit for `sphinx` to 8.0. + - Upgrade lower limit for `furo` to 2023.9.10. + - Upgrade upper limit for `furo` to 2024.8.7. + - Upgrade lower limit for `scipy` to 1.6. + - Upgrade upper limit for `scipy` to 1.16. + - Upgrade upper limit for `netCDF4` to 1.8.0. - Update lint dependencies: - Remove dependency on `unittest2`. - Upgrade lower limit for `flake8` to 3.9. diff --git a/packages/basemap/requirements-doc.txt b/packages/basemap/requirements-doc.txt index 385d1e158..e89d7e235 100644 --- a/packages/basemap/requirements-doc.txt +++ b/packages/basemap/requirements-doc.txt @@ -1,6 +1,6 @@ -sphinx >= 5.3, < 7.2; python_version >= "3.8" -furo >= 2022.4.7, < 2023.9.11; python_version >= "3.8" +sphinx >= 7.0, < 8.0 +furo >= 2023.9.10, < 2024.8.7 -scipy >= 1.2, < 1.12; python_version >= "3.5" -cftime >= 1.4.0, < 1.7.0; python_version >= "3.6" -netCDF4 >= 1.5.6, < 1.7.0; python_version >= "3.6" +scipy >= 1.6, < 1.16 +cftime >= 1.4.0, < 1.7.0 +netCDF4 >= 1.5.6, < 1.8.0 From c65e1c221e3d956d2d84a0f22f1bca007d97e38b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 21:25:27 +0100 Subject: [PATCH 177/210] Remove outdated warning exclusion for pytest --- packages/basemap/setup.cfg | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/basemap/setup.cfg b/packages/basemap/setup.cfg index bf415ac0a..643dee05f 100644 --- a/packages/basemap/setup.cfg +++ b/packages/basemap/setup.cfg @@ -22,9 +22,6 @@ ignore = [tool:pytest] filterwarnings = error - # To be removed with `dateutil` release after 2.8.2. - # See: https://github.com/dateutil/dateutil/issues/1314 - ignore:datetime.datetime.utcfromtimestamp\(\) is deprecated:DeprecationWarning:dateutil.tz.tz:37 [coverage:paths] source = From 5b109a5d956eab29a72c787c01da3671ee979693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 21:27:43 +0100 Subject: [PATCH 178/210] Remove empty __init__.py files in test folder --- packages/basemap/test/__init__.py | 0 packages/basemap/test/mpl_toolkits/__init__.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 packages/basemap/test/__init__.py delete mode 100644 packages/basemap/test/mpl_toolkits/__init__.py diff --git a/packages/basemap/test/__init__.py b/packages/basemap/test/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/basemap/test/mpl_toolkits/__init__.py b/packages/basemap/test/mpl_toolkits/__init__.py deleted file mode 100644 index e69de29bb..000000000 From 579e6fa777fcef2b926f76053bfe85a31d565a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 21:28:30 +0100 Subject: [PATCH 179/210] Update copyright years --- packages/basemap/LICENSE | 2 +- packages/basemap/doc/source/conf.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/basemap/LICENSE b/packages/basemap/LICENSE index 120eb7e3f..68cbd3d24 100644 --- a/packages/basemap/LICENSE +++ b/packages/basemap/LICENSE @@ -1,5 +1,5 @@ Copyright (c) 2011-2014 Jeffrey Whitaker -Copyright (c) 2015-2024 The Matplotlib development team +Copyright (c) 2015-2025 The Matplotlib development team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/packages/basemap/doc/source/conf.py b/packages/basemap/doc/source/conf.py index 460d15c92..daa4b1286 100644 --- a/packages/basemap/doc/source/conf.py +++ b/packages/basemap/doc/source/conf.py @@ -22,7 +22,7 @@ # -- Project information ----------------------------------------------- project = myself.__name__.rsplit(".", 1)[-1] -copyright = "2011-2014 Jeffrey Whitaker; 2015-2024 The Matplotlib development team" +copyright = "2011-2014 Jeffrey Whitaker; 2015-2025 The Matplotlib development team" author = "Jeffrey Whitaker" # The short X.Y version From 8d4e4dc508e8f3ab89bafeada0875b9894cb4fa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 21:43:52 +0100 Subject: [PATCH 180/210] Bump actions/setup-python to v5 --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ed065d625..6809fd38b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.9" @@ -67,7 +67,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.9" @@ -117,7 +117,7 @@ jobs: merge-multiple: true - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.9" From 3cf8518262168a42a1b7548b27e89f8e7e476b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 21:47:46 +0100 Subject: [PATCH 181/210] Bump maximum allowed Python version to <3.14 --- packages/basemap/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/basemap/setup.py b/packages/basemap/setup.py index 1c47e85bf..8927ac115 100644 --- a/packages/basemap/setup.py +++ b/packages/basemap/setup.py @@ -207,7 +207,7 @@ def run(self): "python_requires": ", ".join([ ">=3.9", - "<3.13", + "<3.14", ]), "setup_requires": get_content("requirements-setup.txt", splitlines=True), From 831fa515104db6569dd0f2062c72513b8864d9f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 21:48:12 +0100 Subject: [PATCH 182/210] Add cp313 wheels to build matrix in cibuildwheel --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6809fd38b..b4a1b2751 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,7 +82,7 @@ jobs: uses: pypa/cibuildwheel@v2.22.0 env: CIBW_BUILD_VERBOSITY: 1 - CIBW_BUILD: "cp39* cp310* cp311* cp312*" + CIBW_BUILD: "cp39* cp310* cp311* cp312* cp313*" CIBW_SKIP: "pp* *-musllinux_* *-win32 *-manylinux_i686 *-musllinux_i686 *-aarch64 *-armv7l" CIBW_BEFORE_ALL: ${{ matrix.before_all }} CIBW_TEST_EXTRAS: "test" From 61077d5bd8e31071176fd50b2e8d11f0f9032a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 22:10:50 +0100 Subject: [PATCH 183/210] Fix numpy build dependency pin for Python 3.13 --- packages/basemap/pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/basemap/pyproject.toml b/packages/basemap/pyproject.toml index d5dfe2906..48161aea9 100644 --- a/packages/basemap/pyproject.toml +++ b/packages/basemap/pyproject.toml @@ -2,7 +2,8 @@ requires = [ 'setuptools', 'wheel', - 'numpy == 2.0.0', 'cython >= 0.29.31, < 3.1', + 'numpy == 2.1.0; python_version == "3.13"', + 'numpy == 2.0.0; python_version <= "3.12"', ] build-backend = "setuptools.build_meta" From d80b7a889fe5709c13cc7094add2b5b329719561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 22:14:10 +0100 Subject: [PATCH 184/210] Fix setuptools and wheel build dependency pins --- packages/basemap/pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/basemap/pyproject.toml b/packages/basemap/pyproject.toml index 48161aea9..a7d900689 100644 --- a/packages/basemap/pyproject.toml +++ b/packages/basemap/pyproject.toml @@ -1,7 +1,7 @@ [build-system] requires = [ - 'setuptools', - 'wheel', + 'setuptools >= 67.0, < 76.0', + 'wheel >= 0.40, < 0.46', 'cython >= 0.29.31, < 3.1', 'numpy == 2.1.0; python_version == "3.13"', 'numpy == 2.0.0; python_version <= "3.12"', From 312320bc03ac6b41744d57493161b58b29081e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 23:35:28 +0100 Subject: [PATCH 185/210] Update CHANGELOG --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 539eeb530..353ffba0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,9 @@ https://semver.org/spec/v2.0.0.html ## [Unreleased] ### Added -- Support `numpy` 2.0 (PR [#614] by @cvanelteren, solves issue [#604]). +- Support for Python 3.13 (PR [#619], solves issue [#608]). +- Support for NumPy 2.0 (PR [#614] by @cvanelteren, solves issue + [#604]). ### Changed - **BREAKING CHANGE**: Set Python minimum supported version to 3.9. @@ -1152,10 +1154,14 @@ https://semver.org/spec/v2.0.0.html - Fix glitches in drawing of parallels and meridians. +[#619]: +https://github.com/matplotlib/basemap/pull/619 [#615]: https://github.com/matplotlib/basemap/pull/615 [#614]: https://github.com/matplotlib/basemap/pull/614 +[#608]: +https://github.com/matplotlib/basemap/issues/608 [#604]: https://github.com/matplotlib/basemap/issues/604 [#598]: From 92f0508653bac8c152eaa2a2725418c7335fd26a Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 25 Feb 2025 08:30:24 +0100 Subject: [PATCH 186/210] add macos --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b4a1b2751..21d5403ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,7 @@ jobs: needs: [build_data] strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest, windows-latest, macos-latest] include: - os: ubuntu-latest before_all: >- From 47fd818305bb255c90b0990945235f2b1bf25af4 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 25 Feb 2025 08:34:36 +0100 Subject: [PATCH 187/210] update cibuild --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 21d5403ed..e9f2dac53 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,6 +56,12 @@ jobs: echo "GEOS_DIR set to: ${GEOS_DIR}" && cd "{package}" && python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" + - os: macos-latest + before_all: >- + echo "Starting BEFORE_ALL script" && + echo "GEOS_DIR set to: ${GEOS_DIR}" && + cd "{package}" && + python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" - os: windows-latest before_all: >- echo Starting BEFORE_ALL script && From 0641ba68742462d5999a5a19608acd0e5224d92c Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 25 Feb 2025 08:41:43 +0100 Subject: [PATCH 188/210] add macos arm builds --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e9f2dac53..fbaaa3837 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -89,7 +89,7 @@ jobs: env: CIBW_BUILD_VERBOSITY: 1 CIBW_BUILD: "cp39* cp310* cp311* cp312* cp313*" - CIBW_SKIP: "pp* *-musllinux_* *-win32 *-manylinux_i686 *-musllinux_i686 *-aarch64 *-armv7l" + CIBW_SKIP: "pp* *-musllinux_* *-win32 *-manylinux_i686 *-musllinux_i686 *-linux_aarch64 *-linux_armv7l" CIBW_BEFORE_ALL: ${{ matrix.before_all }} CIBW_TEST_EXTRAS: "test" CIBW_TEST_COMMAND: "python -m pytest {project}/packages/basemap" From 2e000789059b13eb601f8de20eb06a587ad9163d Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 25 Feb 2025 10:16:12 +0100 Subject: [PATCH 189/210] add explicit x86 support for macos --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fbaaa3837..8f62ba100 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -89,6 +89,7 @@ jobs: env: CIBW_BUILD_VERBOSITY: 1 CIBW_BUILD: "cp39* cp310* cp311* cp312* cp313*" + CIBW_ARCHS_MACOS: "x86_64 arm64" CIBW_SKIP: "pp* *-musllinux_* *-win32 *-manylinux_i686 *-musllinux_i686 *-linux_aarch64 *-linux_armv7l" CIBW_BEFORE_ALL: ${{ matrix.before_all }} CIBW_TEST_EXTRAS: "test" From 8780bd3ad9f51ebac513cd30faf7e84c3b3e380f Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 25 Feb 2025 10:46:54 +0100 Subject: [PATCH 190/210] set arch flags for macos --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8f62ba100..26d20b63f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,6 +58,7 @@ jobs: python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" - os: macos-latest before_all: >- + ARCHFLAGS="-arch x86_64 -arch arm64" echo "Starting BEFORE_ALL script" && echo "GEOS_DIR set to: ${GEOS_DIR}" && cd "{package}" && From d2695754caba73e482a449065d0395e026a0a7ce Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 25 Feb 2025 10:58:29 +0100 Subject: [PATCH 191/210] update ld path --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 26d20b63f..f0813d386 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,6 +58,9 @@ jobs: python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" - os: macos-latest before_all: >- + ARCHFLAGS="-arch x86_64 -arch arm64" + LD_LIBRARY_PATH="${GEOS_DIR}/lib:$LD_LIBRARY_PATH" + DYLD_FALLBACK_LIBRARY_PATH="${GEOS_DIR}/lib:$DYLD_FALLBACK_LIBRARY_PATH" ARCHFLAGS="-arch x86_64 -arch arm64" echo "Starting BEFORE_ALL script" && echo "GEOS_DIR set to: ${GEOS_DIR}" && From 4e4d2dc1e8747d5576e74a5c38626dff4c9cc9ae Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 25 Feb 2025 11:18:25 +0100 Subject: [PATCH 192/210] add macos-13 for x86 builds --- .github/workflows/build.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f0813d386..9d39bbdda 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,14 +51,23 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] include: - os: ubuntu-latest + arch: x86_64 before_all: >- echo "Starting BEFORE_ALL script" && echo "GEOS_DIR set to: ${GEOS_DIR}" && cd "{package}" && python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" - - os: macos-latest + - os: macos-13: before_all: >- + LD_LIBRARY_PATH="${GEOS_DIR}/lib:$LD_LIBRARY_PATH" + DYLD_FALLBACK_LIBRARY_PATH="${GEOS_DIR}/lib:$DYLD_FALLBACK_LIBRARY_PATH" ARCHFLAGS="-arch x86_64 -arch arm64" + echo "Starting BEFORE_ALL script" && + echo "GEOS_DIR set to: ${GEOS_DIR}" && + cd "{package}" && + python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" + - os: macos-latest + before_all: >- LD_LIBRARY_PATH="${GEOS_DIR}/lib:$LD_LIBRARY_PATH" DYLD_FALLBACK_LIBRARY_PATH="${GEOS_DIR}/lib:$DYLD_FALLBACK_LIBRARY_PATH" ARCHFLAGS="-arch x86_64 -arch arm64" @@ -67,6 +76,7 @@ jobs: cd "{package}" && python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" - os: windows-latest + arch: x86_64 before_all: >- echo Starting BEFORE_ALL script && echo GEOS_DIR set to: %GEOS_DIR% && @@ -93,7 +103,7 @@ jobs: env: CIBW_BUILD_VERBOSITY: 1 CIBW_BUILD: "cp39* cp310* cp311* cp312* cp313*" - CIBW_ARCHS_MACOS: "x86_64 arm64" + CIBW_ARCHS_MACOS: ${{ matrix.arch }} CIBW_SKIP: "pp* *-musllinux_* *-win32 *-manylinux_i686 *-musllinux_i686 *-linux_aarch64 *-linux_armv7l" CIBW_BEFORE_ALL: ${{ matrix.before_all }} CIBW_TEST_EXTRAS: "test" From 06a0d798e3b6e2c6cb92ebe1c7522709523c6ced Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 25 Feb 2025 11:19:45 +0100 Subject: [PATCH 193/210] update strategy --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d39bbdda..226871778 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,7 @@ jobs: needs: [build_data] strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu-latest, windows-latest, macos-latest, macos-13] include: - os: ubuntu-latest arch: x86_64 From 9860f9f40c5d14902ff59b06af8fe904805137af Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 25 Feb 2025 11:20:32 +0100 Subject: [PATCH 194/210] typo --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 226871778..f626fde90 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,8 @@ jobs: needs: [build_data] strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest, macos-13] + os: + [ubuntu-latest, windows-latest, macos-latest, macos-13] include: - os: ubuntu-latest arch: x86_64 @@ -57,7 +58,7 @@ jobs: echo "GEOS_DIR set to: ${GEOS_DIR}" && cd "{package}" && python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" - - os: macos-13: + - os: macos-13 before_all: >- LD_LIBRARY_PATH="${GEOS_DIR}/lib:$LD_LIBRARY_PATH" DYLD_FALLBACK_LIBRARY_PATH="${GEOS_DIR}/lib:$DYLD_FALLBACK_LIBRARY_PATH" From 7e58cc86c453b46ec18346dd4db147580abdf475 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Tue, 25 Feb 2025 11:34:58 +0100 Subject: [PATCH 195/210] add arch --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f626fde90..c385005fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,6 +59,7 @@ jobs: cd "{package}" && python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" - os: macos-13 + arch: x86_64 before_all: >- LD_LIBRARY_PATH="${GEOS_DIR}/lib:$LD_LIBRARY_PATH" DYLD_FALLBACK_LIBRARY_PATH="${GEOS_DIR}/lib:$DYLD_FALLBACK_LIBRARY_PATH" @@ -68,6 +69,7 @@ jobs: cd "{package}" && python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" - os: macos-latest + arch: arm64 before_all: >- LD_LIBRARY_PATH="${GEOS_DIR}/lib:$LD_LIBRARY_PATH" DYLD_FALLBACK_LIBRARY_PATH="${GEOS_DIR}/lib:$DYLD_FALLBACK_LIBRARY_PATH" From cb009396ad77cbe128809c8c218ef9e7b061892d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 25 Feb 2025 19:43:18 +0100 Subject: [PATCH 196/210] Remove LD_LIBRARY_PATH from MacOS before_all block --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c385005fe..3b026b0e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,7 +61,6 @@ jobs: - os: macos-13 arch: x86_64 before_all: >- - LD_LIBRARY_PATH="${GEOS_DIR}/lib:$LD_LIBRARY_PATH" DYLD_FALLBACK_LIBRARY_PATH="${GEOS_DIR}/lib:$DYLD_FALLBACK_LIBRARY_PATH" ARCHFLAGS="-arch x86_64 -arch arm64" echo "Starting BEFORE_ALL script" && @@ -71,7 +70,6 @@ jobs: - os: macos-latest arch: arm64 before_all: >- - LD_LIBRARY_PATH="${GEOS_DIR}/lib:$LD_LIBRARY_PATH" DYLD_FALLBACK_LIBRARY_PATH="${GEOS_DIR}/lib:$DYLD_FALLBACK_LIBRARY_PATH" ARCHFLAGS="-arch x86_64 -arch arm64" echo "Starting BEFORE_ALL script" && From 28bbd170417b6c6ab64e25a3d0e14148915dbda6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 25 Feb 2025 20:00:35 +0100 Subject: [PATCH 197/210] Replace macos-latest with macos-14 --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b026b0e3..041a7a68e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: strategy: matrix: os: - [ubuntu-latest, windows-latest, macos-latest, macos-13] + [ubuntu-latest, windows-latest, macos-13, macos-14] include: - os: ubuntu-latest arch: x86_64 @@ -67,7 +67,7 @@ jobs: echo "GEOS_DIR set to: ${GEOS_DIR}" && cd "{package}" && python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" - - os: macos-latest + - os: macos-14 arch: arm64 before_all: >- DYLD_FALLBACK_LIBRARY_PATH="${GEOS_DIR}/lib:$DYLD_FALLBACK_LIBRARY_PATH" From 19f0b8f70547dc47a30d6f96ed1d3810a5ac8e6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 25 Feb 2025 20:01:08 +0100 Subject: [PATCH 198/210] Remove DYLD_FALLBACK_LIBRARY_PATH from MacOS before_all block --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 041a7a68e..2b2df731d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,7 +61,6 @@ jobs: - os: macos-13 arch: x86_64 before_all: >- - DYLD_FALLBACK_LIBRARY_PATH="${GEOS_DIR}/lib:$DYLD_FALLBACK_LIBRARY_PATH" ARCHFLAGS="-arch x86_64 -arch arm64" echo "Starting BEFORE_ALL script" && echo "GEOS_DIR set to: ${GEOS_DIR}" && @@ -70,7 +69,6 @@ jobs: - os: macos-14 arch: arm64 before_all: >- - DYLD_FALLBACK_LIBRARY_PATH="${GEOS_DIR}/lib:$DYLD_FALLBACK_LIBRARY_PATH" ARCHFLAGS="-arch x86_64 -arch arm64" echo "Starting BEFORE_ALL script" && echo "GEOS_DIR set to: ${GEOS_DIR}" && From 343af4f4146f3c431a681f122b2f55731ea42303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 25 Feb 2025 20:26:45 +0100 Subject: [PATCH 199/210] Remove ARCHFLAGS from MacOS before_all block --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b2df731d..a4546f742 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,7 +61,6 @@ jobs: - os: macos-13 arch: x86_64 before_all: >- - ARCHFLAGS="-arch x86_64 -arch arm64" echo "Starting BEFORE_ALL script" && echo "GEOS_DIR set to: ${GEOS_DIR}" && cd "{package}" && @@ -69,7 +68,6 @@ jobs: - os: macos-14 arch: arm64 before_all: >- - ARCHFLAGS="-arch x86_64 -arch arm64" echo "Starting BEFORE_ALL script" && echo "GEOS_DIR set to: ${GEOS_DIR}" && cd "{package}" && From 79b94231b14e8c8874fefca6aaf7728382b80cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 25 Feb 2025 20:56:16 +0100 Subject: [PATCH 200/210] Update comment about LD_LIBRARY_PATH --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a4546f742..6c518d3ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -111,7 +111,8 @@ jobs: PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 LD_LIBRARY_PATH="${GEOS_DIR}/lib" - # LD_LIBRARY_PATH in environment is needed by auditwheel (Linux). + # LD_LIBRARY_PATH in environment is needed by + # auditwheel (Linux) and delocate (MacOS). with: package-dir: "packages/basemap" output-dir: "packages/basemap/dist" From b19d33decf0cf50288cc2dc776c976e6bb64aa05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 25 Feb 2025 20:56:42 +0100 Subject: [PATCH 201/210] Remove redundant entry in workflow matrix --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6c518d3ba..e1f436449 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,8 +48,6 @@ jobs: needs: [build_data] strategy: matrix: - os: - [ubuntu-latest, windows-latest, macos-13, macos-14] include: - os: ubuntu-latest arch: x86_64 From d67603eceaee568c0974ad7a1000fe566b6485f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 25 Feb 2025 21:19:29 +0100 Subject: [PATCH 202/210] Update CHANGELOG --- CHANGELOG.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 353ffba0a..6031e398c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,15 +13,17 @@ https://semver.org/spec/v2.0.0.html ## [Unreleased] ### Added -- Support for Python 3.13 (PR [#619], solves issue [#608]). -- Support for NumPy 2.0 (PR [#614] by @cvanelteren, solves issue - [#604]). +- Python 3.13 support (PR [#619], solves issue [#608]). +- NumPy 2.0 support (PR [#614] by @cvanelteren, solves issue [#604]). +- Automated wheels for x86_64 and arm64 (PR [#620] by @cvanelteren, + solves issue [#608]). ### Changed - **BREAKING CHANGE**: Set Python minimum supported version to 3.9. - **BREAKING CHANGE**: Migrate `basemap` libraries to use implicit namespace packages (PR [#576] by @ksunden). -- Migrate workflows to use `cibuildwheel` (PR [#614] by @cvanelteren). +- Migrate workflows to use `cibuildwheel` (PRs [#614] and [#618] by + @cvanelteren, solves sunset of v1 of GitHub artifact actions). - Update library dependencies: - Upgrade upper limit for `basemap_data` to 3.0. - Upgrade lower limit for `packaging` to 20.5. @@ -1154,8 +1156,12 @@ https://semver.org/spec/v2.0.0.html - Fix glitches in drawing of parallels and meridians. +[#620]: +https://github.com/matplotlib/basemap/pull/620 [#619]: https://github.com/matplotlib/basemap/pull/619 +[#618]: +https://github.com/matplotlib/basemap/pull/618 [#615]: https://github.com/matplotlib/basemap/pull/615 [#614]: From b82fb80be1e8c80564a198e71062cc6b586c4d61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 25 Feb 2025 21:40:42 +0100 Subject: [PATCH 203/210] Set image versions explicitly in workflow --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1f436449..0c5331200 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: strategy: matrix: package: [basemap_data, basemap_data_hires] - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -49,7 +49,7 @@ jobs: strategy: matrix: include: - - os: ubuntu-latest + - os: ubuntu-22.04 arch: x86_64 before_all: >- echo "Starting BEFORE_ALL script" && @@ -70,7 +70,7 @@ jobs: echo "GEOS_DIR set to: ${GEOS_DIR}" && cd "{package}" && python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" - - os: windows-latest + - os: windows-2019 arch: x86_64 before_all: >- echo Starting BEFORE_ALL script && @@ -87,7 +87,7 @@ jobs: python-version: "3.9" - name: Build sdist - if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'ubuntu-22.04' run: | cd packages/basemap python -m pip install build @@ -125,7 +125,7 @@ jobs: check: name: Check packages needs: [build_data, build_basemap] - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/download-artifact@v4 with: @@ -147,7 +147,7 @@ jobs: upload: name: Upload packages needs: [build_data, build_basemap, check] - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') steps: - uses: actions/download-artifact@v4 From 3ecaec6c679a46fe58be79f93e6b3fa1959e51ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 25 Feb 2025 21:58:36 +0100 Subject: [PATCH 204/210] Add Python script for cibuildwheel before_all block --- .github/workflows/run_before_all.py | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/run_before_all.py diff --git a/.github/workflows/run_before_all.py b/.github/workflows/run_before_all.py new file mode 100644 index 000000000..575a26763 --- /dev/null +++ b/.github/workflows/run_before_all.py @@ -0,0 +1,37 @@ +#! /usr/bin/env python +"""Helper script to be run by `cibuildwheel` as `before_all` step.""" + +import os +import sys + +HERE = os.path.abspath(__file__) +ROOT = os.path.dirname(os.path.dirname(os.path.dirname(HERE))) +sys.path.insert(0, os.path.join(ROOT, "packages", "basemap")) +import utils # noqa: E402 # pylint: disable=imports + + +def main(): + """Build the GEOS library based on parsed environment variables.""" + + geos_version = os.environ.get("GEOS_VERSION", None) + if geos_version is None: + raise ValueError("Undefined environment variable GEOS_VERSION") + + geos_dir = os.environ.get("GEOS_DIR", None) + if geos_dir is None: + raise ValueError("Undefined environment variable GEOS_DIR") + + geos_njobs = int(os.environ.get("GEOS_NJOBS", 1)) + + # pylint: disable=consider-using-f-string + print("Running before_all script with the following settings:") + print("GEOS_DIR: {0}".format(geos_dir)) + print("GEOS_VERSION: {0}".format(geos_version)) + print("GEOS_NJOBS: {0}".format(geos_njobs)) + + utils.GeosLibrary(geos_version).build(geos_dir, njobs=geos_njobs) + return 0 + + +if __name__ == "__main__": + sys.exit(main()) From 4fd2ec91cf9e400c514f154cce960816a63471a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 25 Feb 2025 22:03:11 +0100 Subject: [PATCH 205/210] Replace before_all blocks with Python script --- .github/workflows/build.yml | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0c5331200..f15dfbf9c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,32 +51,12 @@ jobs: include: - os: ubuntu-22.04 arch: x86_64 - before_all: >- - echo "Starting BEFORE_ALL script" && - echo "GEOS_DIR set to: ${GEOS_DIR}" && - cd "{package}" && - python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" + - os: windows-2019 + arch: x86_64 - os: macos-13 arch: x86_64 - before_all: >- - echo "Starting BEFORE_ALL script" && - echo "GEOS_DIR set to: ${GEOS_DIR}" && - cd "{package}" && - python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" - os: macos-14 arch: arm64 - before_all: >- - echo "Starting BEFORE_ALL script" && - echo "GEOS_DIR set to: ${GEOS_DIR}" && - cd "{package}" && - python -c "import utils; utils.GeosLibrary('${GEOS_VERSION}').build('${GEOS_DIR}', njobs=2)" - - os: windows-2019 - arch: x86_64 - before_all: >- - echo Starting BEFORE_ALL script && - echo GEOS_DIR set to: %GEOS_DIR% && - cd "{package}" && - python -c "import utils; utils.GeosLibrary('%GEOS_VERSION%').build('%GEOS_DIR%', njobs=2)" runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -100,12 +80,13 @@ jobs: CIBW_BUILD: "cp39* cp310* cp311* cp312* cp313*" CIBW_ARCHS_MACOS: ${{ matrix.arch }} CIBW_SKIP: "pp* *-musllinux_* *-win32 *-manylinux_i686 *-musllinux_i686 *-linux_aarch64 *-linux_armv7l" - CIBW_BEFORE_ALL: ${{ matrix.before_all }} + CIBW_BEFORE_ALL: "python {project}/.github/workflows/run_before_all.py" CIBW_TEST_EXTRAS: "test" CIBW_TEST_COMMAND: "python -m pytest {project}/packages/basemap" CIBW_ENVIRONMENT: >- GEOS_VERSION="3.6.5" GEOS_DIR="$(pwd)/extern" + GEOS_NJOBS=4 PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1 LD_LIBRARY_PATH="${GEOS_DIR}/lib" From 2c0bb76b43b52cfbd7a62a5435223ccf06c061e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 25 Feb 2025 22:06:44 +0100 Subject: [PATCH 206/210] Apply minor correction to CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6031e398c..6e212b9d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ https://semver.org/spec/v2.0.0.html - **BREAKING CHANGE**: Migrate `basemap` libraries to use implicit namespace packages (PR [#576] by @ksunden). - Migrate workflows to use `cibuildwheel` (PRs [#614] and [#618] by - @cvanelteren, solves sunset of v1 of GitHub artifact actions). + @cvanelteren, solves sunset of GitHub artifact actions v1). - Update library dependencies: - Upgrade upper limit for `basemap_data` to 3.0. - Upgrade lower limit for `packaging` to 20.5. From 861998b1d29b24c080f5301dda708a4ed44beb4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 25 Feb 2025 22:11:59 +0100 Subject: [PATCH 207/210] Fix and simplify setup of archs in cibuildwheel --- .github/workflows/build.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f15dfbf9c..5714e5483 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,15 +48,7 @@ jobs: needs: [build_data] strategy: matrix: - include: - - os: ubuntu-22.04 - arch: x86_64 - - os: windows-2019 - arch: x86_64 - - os: macos-13 - arch: x86_64 - - os: macos-14 - arch: arm64 + os: [ubuntu-22.04, windows-2019, macos-13, macos-14] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -78,7 +70,7 @@ jobs: env: CIBW_BUILD_VERBOSITY: 1 CIBW_BUILD: "cp39* cp310* cp311* cp312* cp313*" - CIBW_ARCHS_MACOS: ${{ matrix.arch }} + CIBW_ARCHS: "native" CIBW_SKIP: "pp* *-musllinux_* *-win32 *-manylinux_i686 *-musllinux_i686 *-linux_aarch64 *-linux_armv7l" CIBW_BEFORE_ALL: "python {project}/.github/workflows/run_before_all.py" CIBW_TEST_EXTRAS: "test" From 7d689ad14204bb5278f8e5c58a7b9b2904471fd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Tue, 25 Feb 2025 22:26:13 +0100 Subject: [PATCH 208/210] Clean up unneeded wheel exclusions in CIBW_SKIP --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5714e5483..d3fa1c773 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,10 +68,10 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.22.0 env: - CIBW_BUILD_VERBOSITY: 1 - CIBW_BUILD: "cp39* cp310* cp311* cp312* cp313*" CIBW_ARCHS: "native" - CIBW_SKIP: "pp* *-musllinux_* *-win32 *-manylinux_i686 *-musllinux_i686 *-linux_aarch64 *-linux_armv7l" + CIBW_BUILD: "cp39* cp310* cp311* cp312* cp313*" + CIBW_BUILD_VERBOSITY: 1 + CIBW_SKIP: "*-musllinux_*" CIBW_BEFORE_ALL: "python {project}/.github/workflows/run_before_all.py" CIBW_TEST_EXTRAS: "test" CIBW_TEST_COMMAND: "python -m pytest {project}/packages/basemap" From d762db0025c9d3b319852013a1cf8eefb6eaebad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 26 Feb 2025 00:34:24 +0100 Subject: [PATCH 209/210] Update CHANGELOG --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e212b9d9..b14c8acd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ https://semver.org/spec/v2.0.0.html - **BREAKING CHANGE**: Migrate `basemap` libraries to use implicit namespace packages (PR [#576] by @ksunden). - Migrate workflows to use `cibuildwheel` (PRs [#614] and [#618] by - @cvanelteren, solves sunset of GitHub artifact actions v1). + @cvanelteren and PR [#621], solves GitHub artifact actions v1 sunset). - Update library dependencies: - Upgrade upper limit for `basemap_data` to 3.0. - Upgrade lower limit for `packaging` to 20.5. @@ -1156,6 +1156,8 @@ https://semver.org/spec/v2.0.0.html - Fix glitches in drawing of parallels and meridians. +[#621]: +https://github.com/matplotlib/basemap/pull/621 [#620]: https://github.com/matplotlib/basemap/pull/620 [#619]: From 7913a36cbc262f4641f0debdd578a54799f9d31c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Molina=20Garc=C3=ADa?= Date: Wed, 26 Feb 2025 01:22:04 +0100 Subject: [PATCH 210/210] Fix missing environment and parameters in upload job --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d3fa1c773..c2ca8e4bd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -121,6 +121,7 @@ jobs: name: Upload packages needs: [build_data, build_basemap, check] runs-on: ubuntu-22.04 + environment: PyPI if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') steps: - uses: actions/download-artifact@v4 @@ -133,3 +134,5 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_TOKEN }} + repository-url: ${{ secrets.PYPI_REPOSITORY_URL }} + skip-existing: true