Skip to content

Commit

Permalink
Merge branch 'hotfix-1.3.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
molinav committed May 11, 2022
2 parents cbbc2e4 + c7a4323 commit 11bf105
Show file tree
Hide file tree
Showing 14 changed files with 1,238 additions and 113 deletions.
18 changes: 18 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto eol=lf

# Explicitly declare text files you want to always be normalised and
# converted to native line endings on checkout.
*.py text
*.pyx text

# Denote all files that are truly binary and should not be modified.
*.bin binary
*.dat binary
*.dbf binary
*.dem binary
*.gz binary
*.jpg binary
*.nc binary
*.shp binary
*.shx binary
45 changes: 44 additions & 1 deletion .github/workflows/basemap-for-manylinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,56 @@ jobs:
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"]
max-parallel: 3
fail-fast: false
needs: checkout
container: "pylegacy/python:${{ matrix.python-version }}-debian-8"
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 --prefer-binary -r requirements.txt
-
name: Run Flake8
run: |
cd ${{ env.PKGDIR }}
if [ -x "$(command -v flake8)" ]; then
flake8 src/mpl_toolkits/basemap/cm.py;
fi
-
name: Run PyLint
run: |
cd ${{ env.PKGDIR }}
if [ -x "$(command -v pylint)" ]; then
pylint src/mpl_toolkits/basemap/cm.py;
fi
build-geos:
strategy:
matrix:
arch:
["x64", "x86"]
max-parallel: 2
fail-fast: false
needs: checkout
needs: lint
runs-on: ubuntu-latest
container: "pylegacy/${{ matrix.arch }}-python:3.6-debian-4"
steps:
Expand Down Expand Up @@ -232,6 +274,7 @@ jobs:
name: Test package
run: |
python -c "from mpl_toolkits.basemap import Basemap"
python -c "from mpl_toolkits.basemap import cm"
upload:
strategy:
Expand Down
56 changes: 55 additions & 1 deletion .github/workflows/basemap-for-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,59 @@ jobs:
name: checkout
path: .

lint:
runs-on: windows-latest
strategy:
matrix:
python-version:
["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"]
max-parallel: 3
fail-fast: false
needs: checkout
steps:
-
name: Download checkout
uses: actions/download-artifact@v1
with:
name: checkout
path: .
-
name: Set Python
uses: actions/setup-python@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 }}
pip install --prefer-binary -r requirements.txt
-
name: Run Flake8
run: |
cd ${{ env.PKGDIR }}
if (Get-Command flake8 -errorAction SilentlyContinue)
{
flake8 src/mpl_toolkits/basemap/cm.py;
}
-
name: Run PyLint
run: |
cd ${{ env.PKGDIR }}
if (Get-Command pylint -errorAction SilentlyContinue)
{
pylint src/mpl_toolkits/basemap/cm.py;
}
build-geos:
strategy:
matrix:
Expand All @@ -51,7 +104,7 @@ jobs:
cmake-version: "3.13.2"
max-parallel: 4
fail-fast: false
needs: checkout
needs: lint
runs-on: windows-latest
steps:
-
Expand Down Expand Up @@ -194,6 +247,7 @@ jobs:
name: Test package
run: |
python -c "from mpl_toolkits.basemap import Basemap"
python -c "from mpl_toolkits.basemap import cm"
upload:
strategy:
Expand Down
52 changes: 45 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
# Changelog

All notable changes to this project will be documented in this file. The format
is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and the
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
since version 1.3.0.
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog], and the project adheres to
[Semantic Versioning] since version 1.3.0.

[Keep a Changelog]:
https://keepachangelog.com/en/1.0.0/
[Semantic Versioning]:
https://semver.org/spec/v2.0.0.html


## [1.3.3] - 2022-05-11

### Changed
- Reformat `basemap.cm` using `flake8` and `black`.

### Fixed
- Fix issue in `drawcoastlines` with shape of vertices array
(PR [#538] by @guziy, fixes issue [#512]).
- Fix setup to identify GEOS dylib on MacOS correctly (PR [#541],
fixes issue [#539], thanks to @ronaldbradford and @CaffreyR for
testing).

### Removed
- Remove dependency on `six` (PR [#537], fixes issue [#536]).

## [1.3.2] - 2022-02-10

Expand All @@ -20,7 +40,7 @@ since version 1.3.0.
vulnerability [CVE-2021-33430].
- Fix wrong marker for `unittest2` in development requirements.
- Fix `sdist` so that packages can be built from source distributions
(PR [#532] by @DWesl).
(PR [#532] by @DWesl, fixes [#533]).
- Specify Cython language level for `_geoslib` extension explicitly.
- Enforce up-to-date `pillow` dependency when possible:
- `pillow >= 9.0.0` for Python >= 3.7 due to `pillow` vulnerabilities
Expand Down Expand Up @@ -75,7 +95,7 @@ since version 1.3.0.
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] and [#526]).
[#525], [#526] and [#535]).
- Upgrade default GEOS library dependency to 3.5.1.
- Update and clarify licenses. In summary:
- `basemap`: MIT license.
Expand Down Expand Up @@ -882,6 +902,20 @@ since version 1.3.0.
- Fix glitches in drawing of parallels and meridians.


[#541]:
https://github.com/matplotlib/basemap/pull/541
[#539]:
https://github.com/matplotlib/basemap/issues/539
[#538]:
https://github.com/matplotlib/basemap/pull/538
[#537]:
https://github.com/matplotlib/basemap/pull/537
[#536]:
https://github.com/matplotlib/basemap/issues/536
[#535]:
https://github.com/matplotlib/basemap/issues/535
[#533]:
https://github.com/matplotlib/basemap/issues/533
[#532]:
https://github.com/matplotlib/basemap/pull/532
[#531]:
Expand All @@ -900,6 +934,8 @@ https://github.com/matplotlib/basemap/issues/521
https://github.com/matplotlib/basemap/issues/518
[#513]:
https://github.com/matplotlib/basemap/issues/513
[#512]:
https://github.com/matplotlib/basemap/issues/512
[#510]:
https://github.com/matplotlib/basemap/issues/510
[#505]:
Expand Down Expand Up @@ -938,7 +974,9 @@ https://github.com/matplotlib/basemap/issues/228
https://github.com/matplotlib/basemap/issues/179

[Unreleased]:
https://github.com/matplotlib/basemap/compare/v1.3.2...develop
https://github.com/matplotlib/basemap/compare/v1.3.3...develop
[1.3.3]:
https://github.com/matplotlib/basemap/compare/v1.3.2...v1.3.3
[1.3.2]:
https://github.com/matplotlib/basemap/compare/v1.3.1...v1.3.2
[1.3.1]:
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Basic requirements are the following:
* [numpy](https://github.com/numpy/numpy)
* [pyproj](https://github.com/pyproj4/pyproj)
* [pyshp](https://github.com/GeospatialPython/pyshp)
* [six](https://github.com/benjaminp/six)

Optional requirements include:

Expand Down
3 changes: 1 addition & 2 deletions packages/basemap/.pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,7 @@ init-import=no

# List of qualified module names which can have objects that can redefine
# builtins.
redefining-builtins-modules=six.moves,
past.builtins,
redefining-builtins-modules=past.builtins,
future.builtins,
builtins,
io
Expand Down
4 changes: 2 additions & 2 deletions packages/basemap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.2/packages/basemap/LICENSE
https://github.com/matplotlib/basemap/blob/v1.3.3/packages/basemap/LICENSE
[`LICENSE.geos`]:
https://github.com/matplotlib/basemap/blob/v1.3.2/packages/basemap/LICENSE.geos
https://github.com/matplotlib/basemap/blob/v1.3.3/packages/basemap/LICENSE.geos
1 change: 0 additions & 1 deletion packages/basemap/requirements-doc.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
six >= 1.10, < 1.16; python_version >= "3.5"
sphinx >= 3.0, < 3.4; python_version >= "3.5"
2 changes: 0 additions & 2 deletions packages/basemap/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
basemap_data >= 1.3.2, < 1.4

six >= 1.10, < 1.16

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"
Expand Down
38 changes: 23 additions & 15 deletions packages/basemap/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,33 @@ def get_geos_install_prefix():
candidates = [os.path.expanduser("~/local"), os.path.expanduser("~"),
"/usr/local", "/usr", "/opt/local", "/opt", "/sw"]

# Prepare filename pattern to find the GEOS library.
extensions = {"win32": "dll", "cygwin": "dll", "darwin": "dylib"}
libext = extensions.get(sys.platform, "so*")
libname = "*geos_c*.{0}".format(libext)
libdirs = ["bin", "lib", "lib/x86_64-linux-gnu", "lib64"]

for prefix in candidates:
libfiles = []
libdirs = ["bin", "lib", "lib/x86_64-linux-gnu", "lib64"]
libext = "dll" if os.name == "nt" else "so"
libcode = "{0}geos_c".format("" if os.name == "nt" else "lib")
libname = "{0}*.{1}*".format(libcode, libext)
for libdir in libdirs:
libfiles.extend(glob.glob(os.path.join(prefix, libdir, libname)))
hfile = os.path.join(prefix, "include", "geos_c.h")
if os.path.isfile(hfile) and libfiles:
return prefix

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


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

# Define GEOS include, library and runtime dirs.
geos_install_prefix = get_geos_install_prefix()
Expand Down Expand Up @@ -164,7 +172,7 @@ def run(self):
"name":
"basemap",
"version":
"1.3.2",
"1.3.3",
"license":
"MIT",
"description":
Expand Down
3 changes: 2 additions & 1 deletion packages/basemap/src/mpl_toolkits/basemap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
from mpl_toolkits import basemap_data
basemap_datadir = os.path.abspath(list(basemap_data.__path__)[0])

__version__ = "1.3.2"
__version__ = "1.3.3"

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

0 comments on commit 11bf105

Please sign in to comment.