Skip to content

Commit 11bf105

Browse files
committedMay 11, 2022
Merge branch 'hotfix-1.3.3'
2 parents cbbc2e4 + c7a4323 commit 11bf105

14 files changed

+1238
-113
lines changed
 

‎.gitattributes

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text=auto eol=lf
3+
4+
# Explicitly declare text files you want to always be normalised and
5+
# converted to native line endings on checkout.
6+
*.py text
7+
*.pyx text
8+
9+
# Denote all files that are truly binary and should not be modified.
10+
*.bin binary
11+
*.dat binary
12+
*.dbf binary
13+
*.dem binary
14+
*.gz binary
15+
*.jpg binary
16+
*.nc binary
17+
*.shp binary
18+
*.shx binary

‎.github/workflows/basemap-for-manylinux.yml

+44-1
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,56 @@ jobs:
2929
name: checkout
3030
path: .
3131

32+
lint:
33+
runs-on: ubuntu-latest
34+
strategy:
35+
matrix:
36+
python-version:
37+
["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"]
38+
max-parallel: 3
39+
fail-fast: false
40+
needs: checkout
41+
container: "pylegacy/python:${{ matrix.python-version }}-debian-8"
42+
steps:
43+
-
44+
name: Download checkout
45+
uses: actions/download-artifact@v1
46+
with:
47+
name: checkout
48+
path: .
49+
-
50+
name: Install lint requirements
51+
run: |
52+
cd ${{ env.PKGDIR }}
53+
pip install -r requirements-lint.txt
54+
-
55+
name: Install library requirements
56+
run: |
57+
cd ${{ env.PKGDIR }}
58+
pip install --prefer-binary -r requirements.txt
59+
-
60+
name: Run Flake8
61+
run: |
62+
cd ${{ env.PKGDIR }}
63+
if [ -x "$(command -v flake8)" ]; then
64+
flake8 src/mpl_toolkits/basemap/cm.py;
65+
fi
66+
-
67+
name: Run PyLint
68+
run: |
69+
cd ${{ env.PKGDIR }}
70+
if [ -x "$(command -v pylint)" ]; then
71+
pylint src/mpl_toolkits/basemap/cm.py;
72+
fi
73+
3274
build-geos:
3375
strategy:
3476
matrix:
3577
arch:
3678
["x64", "x86"]
3779
max-parallel: 2
3880
fail-fast: false
39-
needs: checkout
81+
needs: lint
4082
runs-on: ubuntu-latest
4183
container: "pylegacy/${{ matrix.arch }}-python:3.6-debian-4"
4284
steps:
@@ -232,6 +274,7 @@ jobs:
232274
name: Test package
233275
run: |
234276
python -c "from mpl_toolkits.basemap import Basemap"
277+
python -c "from mpl_toolkits.basemap import cm"
235278
236279
upload:
237280
strategy:

‎.github/workflows/basemap-for-windows.yml

+55-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,59 @@ jobs:
2929
name: checkout
3030
path: .
3131

32+
lint:
33+
runs-on: windows-latest
34+
strategy:
35+
matrix:
36+
python-version:
37+
["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"]
38+
max-parallel: 3
39+
fail-fast: false
40+
needs: checkout
41+
steps:
42+
-
43+
name: Download checkout
44+
uses: actions/download-artifact@v1
45+
with:
46+
name: checkout
47+
path: .
48+
-
49+
name: Set Python
50+
uses: actions/setup-python@v2
51+
with:
52+
architecture: ${{ matrix.arch }}
53+
python-version: ${{ matrix.python-version }}
54+
-
55+
name: Set Python base packages
56+
run: |
57+
python -m pip install --upgrade pip setuptools wheel
58+
-
59+
name: Install lint requirements
60+
run: |
61+
cd ${{ env.PKGDIR }}
62+
python -m pip install -r requirements-lint.txt
63+
-
64+
name: Install library requirements
65+
run: |
66+
cd ${{ env.PKGDIR }}
67+
pip install --prefer-binary -r requirements.txt
68+
-
69+
name: Run Flake8
70+
run: |
71+
cd ${{ env.PKGDIR }}
72+
if (Get-Command flake8 -errorAction SilentlyContinue)
73+
{
74+
flake8 src/mpl_toolkits/basemap/cm.py;
75+
}
76+
-
77+
name: Run PyLint
78+
run: |
79+
cd ${{ env.PKGDIR }}
80+
if (Get-Command pylint -errorAction SilentlyContinue)
81+
{
82+
pylint src/mpl_toolkits/basemap/cm.py;
83+
}
84+
3285
build-geos:
3386
strategy:
3487
matrix:
@@ -51,7 +104,7 @@ jobs:
51104
cmake-version: "3.13.2"
52105
max-parallel: 4
53106
fail-fast: false
54-
needs: checkout
107+
needs: lint
55108
runs-on: windows-latest
56109
steps:
57110
-
@@ -194,6 +247,7 @@ jobs:
194247
name: Test package
195248
run: |
196249
python -c "from mpl_toolkits.basemap import Basemap"
250+
python -c "from mpl_toolkits.basemap import cm"
197251
198252
upload:
199253
strategy:

‎CHANGELOG.md

+45-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
11
# Changelog
22

3-
All notable changes to this project will be documented in this file. The format
4-
is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and the
5-
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
6-
since version 1.3.0.
3+
All notable changes to this project will be documented in this file.
4+
The format is based on [Keep a Changelog], and the project adheres to
5+
[Semantic Versioning] since version 1.3.0.
6+
7+
[Keep a Changelog]:
8+
https://keepachangelog.com/en/1.0.0/
9+
[Semantic Versioning]:
10+
https://semver.org/spec/v2.0.0.html
11+
12+
13+
## [1.3.3] - 2022-05-11
14+
15+
### Changed
16+
- Reformat `basemap.cm` using `flake8` and `black`.
17+
18+
### Fixed
19+
- Fix issue in `drawcoastlines` with shape of vertices array
20+
(PR [#538] by @guziy, fixes issue [#512]).
21+
- Fix setup to identify GEOS dylib on MacOS correctly (PR [#541],
22+
fixes issue [#539], thanks to @ronaldbradford and @CaffreyR for
23+
testing).
24+
25+
### Removed
26+
- Remove dependency on `six` (PR [#537], fixes issue [#536]).
727

828
## [1.3.2] - 2022-02-10
929

@@ -20,7 +40,7 @@ since version 1.3.0.
2040
vulnerability [CVE-2021-33430].
2141
- Fix wrong marker for `unittest2` in development requirements.
2242
- Fix `sdist` so that packages can be built from source distributions
23-
(PR [#532] by @DWesl).
43+
(PR [#532] by @DWesl, fixes [#533]).
2444
- Specify Cython language level for `_geoslib` extension explicitly.
2545
- Enforce up-to-date `pillow` dependency when possible:
2646
- `pillow >= 9.0.0` for Python >= 3.7 due to `pillow` vulnerabilities
@@ -75,7 +95,7 @@ since version 1.3.0.
7595
This change together with the precompiled binary wheels in PyPI should solve
7696
most of the former installation problems (see issues [#403], [#405], [#422],
7797
[#436], [#445], [#456], [#461], [#488], [#489], [#491], [#510], [#513],
78-
[#525] and [#526]).
98+
[#525], [#526] and [#535]).
7999
- Upgrade default GEOS library dependency to 3.5.1.
80100
- Update and clarify licenses. In summary:
81101
- `basemap`: MIT license.
@@ -882,6 +902,20 @@ since version 1.3.0.
882902
- Fix glitches in drawing of parallels and meridians.
883903

884904

905+
[#541]:
906+
https://github.com/matplotlib/basemap/pull/541
907+
[#539]:
908+
https://github.com/matplotlib/basemap/issues/539
909+
[#538]:
910+
https://github.com/matplotlib/basemap/pull/538
911+
[#537]:
912+
https://github.com/matplotlib/basemap/pull/537
913+
[#536]:
914+
https://github.com/matplotlib/basemap/issues/536
915+
[#535]:
916+
https://github.com/matplotlib/basemap/issues/535
917+
[#533]:
918+
https://github.com/matplotlib/basemap/issues/533
885919
[#532]:
886920
https://github.com/matplotlib/basemap/pull/532
887921
[#531]:
@@ -900,6 +934,8 @@ https://github.com/matplotlib/basemap/issues/521
900934
https://github.com/matplotlib/basemap/issues/518
901935
[#513]:
902936
https://github.com/matplotlib/basemap/issues/513
937+
[#512]:
938+
https://github.com/matplotlib/basemap/issues/512
903939
[#510]:
904940
https://github.com/matplotlib/basemap/issues/510
905941
[#505]:
@@ -938,7 +974,9 @@ https://github.com/matplotlib/basemap/issues/228
938974
https://github.com/matplotlib/basemap/issues/179
939975

940976
[Unreleased]:
941-
https://github.com/matplotlib/basemap/compare/v1.3.2...develop
977+
https://github.com/matplotlib/basemap/compare/v1.3.3...develop
978+
[1.3.3]:
979+
https://github.com/matplotlib/basemap/compare/v1.3.2...v1.3.3
942980
[1.3.2]:
943981
https://github.com/matplotlib/basemap/compare/v1.3.1...v1.3.2
944982
[1.3.1]:

‎README.md

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Basic requirements are the following:
1212
* [numpy](https://github.com/numpy/numpy)
1313
* [pyproj](https://github.com/pyproj4/pyproj)
1414
* [pyshp](https://github.com/GeospatialPython/pyshp)
15-
* [six](https://github.com/benjaminp/six)
1615

1716
Optional requirements include:
1817

‎packages/basemap/.pylintrc

+1-2
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,7 @@ init-import=no
413413

414414
# List of qualified module names which can have objects that can redefine
415415
# builtins.
416-
redefining-builtins-modules=six.moves,
417-
past.builtins,
416+
redefining-builtins-modules=past.builtins,
418417
future.builtins,
419418
builtins,
420419
io

‎packages/basemap/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ https://spdx.org/licenses/LGPL-2.1-only.html
4545
https://spdx.org/licenses/MIT.html
4646

4747
[`LICENSE`]:
48-
https://github.com/matplotlib/basemap/blob/v1.3.2/packages/basemap/LICENSE
48+
https://github.com/matplotlib/basemap/blob/v1.3.3/packages/basemap/LICENSE
4949
[`LICENSE.geos`]:
50-
https://github.com/matplotlib/basemap/blob/v1.3.2/packages/basemap/LICENSE.geos
50+
https://github.com/matplotlib/basemap/blob/v1.3.3/packages/basemap/LICENSE.geos

‎packages/basemap/requirements-doc.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
six >= 1.10, < 1.16; python_version >= "3.5"
21
sphinx >= 3.0, < 3.4; python_version >= "3.5"

‎packages/basemap/requirements.txt

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
basemap_data >= 1.3.2, < 1.4
22

3-
six >= 1.10, < 1.16
4-
53
numpy >= 1.11, < 1.12; python_version == "2.6"
64
numpy >= 1.16, < 1.17; python_version == "2.7"
75
numpy >= 1.11, < 1.12; python_version == "3.2"

‎packages/basemap/setup.py

+23-15
Original file line numberDiff line numberDiff line change
@@ -37,27 +37,33 @@ def get_geos_install_prefix():
3737
candidates = [os.path.expanduser("~/local"), os.path.expanduser("~"),
3838
"/usr/local", "/usr", "/opt/local", "/opt", "/sw"]
3939

40+
# Prepare filename pattern to find the GEOS library.
41+
extensions = {"win32": "dll", "cygwin": "dll", "darwin": "dylib"}
42+
libext = extensions.get(sys.platform, "so*")
43+
libname = "*geos_c*.{0}".format(libext)
44+
libdirs = ["bin", "lib", "lib/x86_64-linux-gnu", "lib64"]
45+
4046
for prefix in candidates:
4147
libfiles = []
42-
libdirs = ["bin", "lib", "lib/x86_64-linux-gnu", "lib64"]
43-
libext = "dll" if os.name == "nt" else "so"
44-
libcode = "{0}geos_c".format("" if os.name == "nt" else "lib")
45-
libname = "{0}*.{1}*".format(libcode, libext)
4648
for libdir in libdirs:
4749
libfiles.extend(glob.glob(os.path.join(prefix, libdir, libname)))
4850
hfile = os.path.join(prefix, "include", "geos_c.h")
4951
if os.path.isfile(hfile) and libfiles:
5052
return prefix
5153

52-
warnings.warn(" ".join([
53-
"Cannot find GEOS library and/or headers in standard locations",
54-
"('{0}'). Please install the corresponding packages using your",
55-
"software management system or set the environment variable",
56-
"GEOS_DIR to point to the location where GEOS is installed",
57-
"(for example, if 'geos_c.h' is in '/usr/local/include'",
58-
"and 'libgeos_c' is in '/usr/local/lib', then you need to",
59-
"set GEOS_DIR to '/usr/local'",
60-
]).format("', '".join(candidates)), RuntimeWarning)
54+
# At this point, the GEOS library was not found, so we throw a warning if
55+
# the user is trying to build the library.
56+
build_cmds = ("bdist_wheel", "build", "install")
57+
if any(cmd in sys.argv[1:] for cmd in build_cmds):
58+
warnings.warn(" ".join([
59+
"Cannot find GEOS library and/or headers in standard locations",
60+
"('{0}'). Please install the corresponding packages using your",
61+
"software management system or set the environment variable",
62+
"GEOS_DIR to point to the location where GEOS is installed",
63+
"(for example, if 'geos_c.h' is in '/usr/local/include'",
64+
"and 'libgeos_c' is in '/usr/local/lib', then you need to",
65+
"set GEOS_DIR to '/usr/local'",
66+
]).format("', '".join(candidates)), RuntimeWarning)
6167
return None
6268

6369

@@ -94,7 +100,9 @@ def run(self):
94100
import numpy
95101
include_dirs.append(numpy.get_include())
96102
except ImportError as err:
97-
warnings.warn("unable to locate NumPy headers", RuntimeWarning)
103+
build_cmds = ("bdist_wheel", "build", "install")
104+
if any(cmd in sys.argv[1:] for cmd in build_cmds):
105+
warnings.warn("unable to locate NumPy headers", RuntimeWarning)
98106

99107
# Define GEOS include, library and runtime dirs.
100108
geos_install_prefix = get_geos_install_prefix()
@@ -164,7 +172,7 @@ def run(self):
164172
"name":
165173
"basemap",
166174
"version":
167-
"1.3.2",
175+
"1.3.3",
168176
"license":
169177
"MIT",
170178
"description":

‎packages/basemap/src/mpl_toolkits/basemap/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
from mpl_toolkits import basemap_data
6565
basemap_datadir = os.path.abspath(list(basemap_data.__path__)[0])
6666

67-
__version__ = "1.3.2"
67+
__version__ = "1.3.3"
6868

6969
# module variable that sets the default value for the 'latlon' kwarg.
7070
# can be set to True by user so plotting functions can take lons,lats
@@ -1130,6 +1130,7 @@ def __init__(self, llcrnrlon=None, llcrnrlat=None,
11301130
# replace coastsegs with line segments (instead of polygons)
11311131
self.coastsegs, types =\
11321132
self._readboundarydata('gshhs',as_polygons=False)
1133+
self.coastsegs = [sg for sg in self.coastsegs if len(sg) > 0]
11331134
# create geos Polygon structures for land areas.
11341135
# currently only used in is_land method.
11351136
self.landpolygons=[]

‎packages/basemap/src/mpl_toolkits/basemap/cm.py

+1,028-72
Large diffs are not rendered by default.

‎packages/basemap/src/mpl_toolkits/basemap/proj.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# as textwrap.dedent.
1111
from matplotlib.cbook import dedent
1212

13-
__version__ = "1.3.2"
13+
__version__ = "1.3.3"
1414
_dg2rad = math.radians(1.)
1515
_rad2dg = math.degrees(1.)
1616

‎packages/basemap/utils/GeosLibrary.py

+19-7
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,24 @@ def extract(self, overwrite=True):
147147
for line in lines:
148148
fd.write(line.replace(oldtext, newtext).encode())
149149

150-
# The SVN revision file is not created on the fly before 3.6.0.
151-
svn_hfile = os.path.join(zipfold, "geos_svn_revision.h")
152-
if self.version_tuple < (3, 6, 0) and not os.path.exists(svn_hfile):
153-
with io.open(svn_hfile, "wb") as fd:
154-
text = "#define GEOS_SVN_REVISION 0"
155-
fd.write(text.encode())
150+
# Apply specific patches for GEOS < 3.6.0.
151+
if self.version_tuple < (3, 6, 0):
152+
# The SVN revision file is not created on the fly before 3.6.0.
153+
svn_hfile = os.path.join(zipfold, "geos_svn_revision.h")
154+
if not os.path.exists(svn_hfile):
155+
with io.open(svn_hfile, "wb") as fd:
156+
text = "#define GEOS_SVN_REVISION 0"
157+
fd.write(text.encode())
158+
# Reduce warnings when compiling with `nmake` on Windows.
159+
cmakefile = os.path.join(zipfold, "CMakeLists.txt")
160+
if os.path.exists(cmakefile):
161+
with io.open(cmakefile, "r", encoding="utf-8") as fd:
162+
lines = fd.readlines()
163+
with io.open(cmakefile, "wb") as fd:
164+
oldtext = 'string(REGEX REPLACE "/W[0-9]" "/W4"'
165+
newtext = oldtext.replace("W4", "W1")
166+
for line in lines:
167+
fd.write(line.replace(oldtext, newtext).encode())
156168

157169
def build(self, installdir=None, njobs=1):
158170
"""Build and install GEOS from source."""
@@ -191,7 +203,7 @@ def build(self, installdir=None, njobs=1):
191203
build_opts.extend([
192204
"--",
193205
"WIN64={0}".format("YES" if win64 else "NO"),
194-
"BUILD_BATCH={0}".format("YES" if njobs > 1 else "NO")
206+
"BUILD_BATCH={0}".format("YES" if njobs > 1 else "NO"),
195207
])
196208
else:
197209
build_opts = ["-j", "{0:d}".format(njobs)] + build_opts

0 commit comments

Comments
 (0)
Please sign in to comment.