Skip to content

Commit 7328d5a

Browse files
committed
Merge branch 'feature-py312' into develop
2 parents ab6cdb7 + 9a11454 commit 7328d5a

File tree

10 files changed

+104
-62
lines changed

10 files changed

+104
-62
lines changed

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

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
strategy:
4040
matrix:
4141
python-version:
42-
["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
42+
["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
4343
max-parallel: 3
4444
fail-fast: false
4545
needs: checkout
@@ -131,7 +131,7 @@ jobs:
131131
arch:
132132
["x64", "x86"]
133133
python-version:
134-
["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
134+
["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
135135
max-parallel: 3
136136
fail-fast: false
137137
needs: build-geos
@@ -158,37 +158,44 @@ jobs:
158158
-
159159
name: Build old numpy from source
160160
run: |
161+
case "${{ matrix.arch }}" in
162+
x64) arch="x86_64" ;;
163+
x86) arch="i686" ;;
164+
esac
161165
case "${{ matrix.python-version }}" in
162-
2.6|3.[23]) pkgvers=1.11.3;;
163-
2.7|3.[456789]) pkgvers=1.16.6;;
164-
3.10) pkgvers=1.21.4;;
165-
*) pkgvers=1.23.3;;
166+
2.6|3.[23]) pkgvers=1.11.3; tag=manylinux1 ;;
167+
2.7|3.[456789]) pkgvers=1.16.6; tag=manylinux1 ;;
168+
3.10) pkgvers=1.21.4; tag=manylinux1 ;;
169+
3.11) pkgvers=1.23.3; tag=manylinux_2_17 ;;
170+
*) pkgvers=1.26.1; tag=manylinux_2_28 ;;
171+
esac
172+
case "${{ matrix.python-version }}" in
173+
3.11|3.12)
174+
# Dirty solution to get NumPy headers for Python 3.11 and 3.12.
175+
kwds="--plat=${tag}_${arch}"
176+
pip download --no-deps ${kwds} "numpy==${pkgvers}"
177+
oldpkgfile=$(ls *.whl | head -n1)
178+
newpkgfile=$(echo "${oldpkgfile}" | sed "s/${tag}/linux/")
179+
mv "${oldpkgfile}" "${newpkgfile}"
180+
pip install "${newpkgfile}"
181+
rm "${newpkgfile}"
182+
;;
183+
*)
184+
pip install "numpy == ${pkgvers}"
185+
;;
166186
esac
167-
# Dirty solution to get NumPy headers for Python 3.11.
168-
if [ "${{ matrix.python-version }}" = "3.11" ]; then
169-
case "${{ matrix.arch }}" in
170-
x64) kwds="--plat=manylinux_2_17_x86_64" ;;
171-
x86) kwds="--plat=manylinux_2_17_i686" ;;
172-
esac
173-
pip download --no-deps ${kwds} "numpy==${pkgvers}"
174-
oldpkgfile=$(ls *.whl | head -n1)
175-
newpkgfile=$(echo "${oldpkgfile}" | sed 's/manylinux_2_17/linux/')
176-
mv "${oldpkgfile}" "${newpkgfile}"
177-
pip install "${newpkgfile}"
178-
rm "${newpkgfile}"
179-
else
180-
pip install "numpy == ${pkgvers}"
181-
fi
182187
-
183188
name: Build wheel
184189
run: |
185190
sitepkgdir=$(pip show numpy 2>/dev/null | grep Location: | cut -d' ' -f2)
186191
export GEOS_DIR="${GITHUB_WORKSPACE}/${{ env.PKGDIR }}/extern"
187192
export NUMPY_INCLUDE_PATH=${sitepkgdir}/numpy/core/include
188-
if [ "${{ matrix.python-version }}" = "3.11" ]; then
189-
kwds="--no-build-isolation"
190-
pip install setuptools wheel "cython >= 0.29, < 3.1"
191-
fi
193+
case "${{ matrix.python-version }}" in
194+
3.11|3.12)
195+
kwds="--no-build-isolation"
196+
pip install setuptools wheel "cython >= 0.29, < 3.1"
197+
;;
198+
esac
192199
cd ${{ env.PKGDIR }}
193200
python setup.py sdist
194201
pip wheel -w dist --no-deps ${kwds} dist/*.zip
@@ -205,7 +212,7 @@ jobs:
205212
arch:
206213
["x64", "x86"]
207214
python-version:
208-
["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
215+
["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
209216
max-parallel: 3
210217
fail-fast: false
211218
needs: build
@@ -250,7 +257,16 @@ jobs:
250257
arch:
251258
["x64", "x86"]
252259
python-version:
253-
["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
260+
["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
261+
exclude:
262+
# Missing precompiled binaries for `numpy`, `matplotlib`, `pillow`
263+
# and `lxml`.
264+
- arch: "x64"
265+
python-version: "3.12"
266+
# Missing precompiled binaries for `numpy`, `matplotlib`, `pyproj`,
267+
# `pillow` and `lxml`.
268+
- arch: "x86"
269+
python-version: "3.12"
254270
max-parallel: 3
255271
fail-fast: false
256272
needs: repair
@@ -347,7 +363,7 @@ jobs:
347363
arch:
348364
["x64", "x86"]
349365
python-version:
350-
["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
366+
["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
351367
max-parallel: 1
352368
if: startsWith(github.event.ref, 'refs/tags/v')
353369
needs: test

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
strategy:
4242
matrix:
4343
python-version:
44-
["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
44+
["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
4545
max-parallel: 3
4646
fail-fast: false
4747
needs: checkout
@@ -147,7 +147,7 @@ jobs:
147147
arch:
148148
["x64", "x86"]
149149
python-version:
150-
["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
150+
["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
151151
max-parallel: 3
152152
fail-fast: false
153153
needs: build-geos
@@ -176,7 +176,8 @@ jobs:
176176
"^2\.6|3\.[123]$" { Set-Variable -Name "pkgvers" -Value "1.11.3" }
177177
"^2\.7|3\.[456789]$" { Set-Variable -Name "pkgvers" -Value "1.16.6" }
178178
"^3\.10$" { Set-Variable -Name "pkgvers" -Value "1.21.4" }
179-
default { Set-Variable -Name "pkgvers" -Value "1.23.3" }
179+
"^3\.11$" { Set-Variable -Name "pkgvers" -Value "1.23.3" }
180+
default { Set-Variable -Name "pkgvers" -Value "1.26.1" }
180181
}
181182
$env:SETUPTOOLS_USE_DISTUTILS = "stdlib"
182183
python -m pip install "numpy == ${pkgvers}"
@@ -221,7 +222,11 @@ jobs:
221222
arch:
222223
["x64", "x86"]
223224
python-version:
224-
["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
225+
["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
226+
exclude:
227+
# Missing precompiled binaries for `numpy` and `matplotlib`.
228+
- arch: "x86"
229+
python-version: "3.12"
225230
max-parallel: 3
226231
fail-fast: false
227232
needs: build
@@ -280,7 +285,7 @@ jobs:
280285
arch:
281286
["x64", "x86"]
282287
python-version:
283-
["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
288+
["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
284289
max-parallel: 1
285290
if: startsWith(github.event.ref, 'refs/tags/v')
286291
needs: test

CHANGELOG.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ https://semver.org/spec/v2.0.0.html
1313
## [Unreleased]
1414

1515
### Added
16+
- Support for Python 3.12.
1617
- Optional argument `encoding_errors` for `Basemap.readshapefile` method
1718
(PR [#554] by @guziy, implements request [#552]).
1819
- Optional argument `cachedir` for `Basemap.arcgisimage` method to allow
@@ -22,18 +23,29 @@ https://semver.org/spec/v2.0.0.html
2223
- Upgrade bundled GEOS library to 3.6.5.
2324
- Create optional library requirements files:
2425
- `requirements-owslib.txt` for optional dependency `OWSLib`.
25-
- Set `OWSLib` lower pin to 0.28.1 for Python 3.6+ due to
26+
- Set `OWSLib` lower limit to 0.28.1 for Python 3.6+ due to
2627
vulnerability [CVE-2023-27476].
2728
- `requirements-pillow.txt` for optional dependency `pillow`:
28-
- Upgrade `pillow` upper pin to 10.2.0.
29+
- Upgrade `pillow` upper limit to 10.2.0.
2930
- Update library dependencies:
30-
- Downgrade `pyproj` upper pin to 2.2.0 for Python 2.7.
31+
- Upgrade upper limit for `numpy` to 1.27.0.
32+
- Downgrade upper limit for `pyproj` to 2.2.0 for Python 2.7.
3133
- Set dependency on `packaging` as replacement for `distutils`.
3234
- Update build dependencies:
33-
- Upgrade `Cython` upper pin to 3.1.
34-
- Update doc dependencies:
35+
- Upgrade upper limit for `Cython` to 3.1.
36+
- Update doc dependencies and require at least Python 3.8 for them:
37+
- Upgrade upper limit for `sphinx` to 7.2.
38+
- Upgrade upper limit for `furo` to 2023.9.11.
3539
- Move dependency on `netCDF4` to `requirements-doc.txt`.
3640
- Set dependency on `cftime` explicitly in `requirements-doc.txt`.
41+
- Update lint dependencies:
42+
- Downgrade upper limit for `flake8` to 6.2.
43+
- Upgrade upper limit for `astropy` to 3.1.
44+
- Upgrade lower limit for `pylint` to 3.1.
45+
- Update test dependencies:
46+
- Upgrade upper limit for `pytest` to 7.5.
47+
- Upgrade upper limit for `coverage` to 7.4.
48+
- Upgrade upper limit for `pytest-cov` to 4.2.
3749

3850
### Fixed
3951
- Reimplement `matplotlib` version checks without using `distutils` and

packages/basemap/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
requires = [
33
'setuptools',
44
'wheel',
5-
'numpy == 1.23.3; python_version >= "3.11"',
5+
'numpy == 1.26.1; python_version >= "3.12"',
6+
'numpy == 1.23.3; python_version == "3.11"',
67
'numpy == 1.21.4; python_version == "3.10"',
78
'numpy == 1.21.4; sys_platform == "darwin" and (python_version >= "3.7" and python_version <= "3.9")',
89
'numpy == 1.16.6; sys_platform != "darwin" and (python_version >= "3.7" and python_version <= "3.9")',
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
sphinx >= 5.3, < 6.3; python_version >= "3.6"
2-
furo >= 2022.4.7, < 2023.5.21; python_version >= "3.6"
1+
sphinx >= 5.3, < 7.2; python_version >= "3.8"
2+
furo >= 2022.4.7, < 2023.9.11; python_version >= "3.8"
33

44
netCDF4 >= 1.5.6, < 1.7.0; python_version >= "3.6"
55
cftime >= 1.4.0, < 1.7.0; python_version >= "3.6"

packages/basemap/requirements-lint.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ flake8 >= 2.6, < 4.0; python_version == "2.7"
55
flake8 >= 2.6, < 3.0; python_version == "3.2"
66
flake8 >= 2.6, < 3.0; python_version == "3.3"
77
flake8 >= 2.6, < 3.9; python_version == "3.4"
8-
flake8 >= 2.6, < 7.1; python_version >= "3.5"
8+
flake8 >= 2.6, < 6.2; python_version >= "3.5"
99

1010
astroid >= 1.6, < 2.0; python_version == "2.7"
1111
astroid >= 2.4, < 2.5; python_version == "3.5"
1212
astroid >= 2.5, < 2.7; python_version == "3.6"
13-
astroid >= 2.8, < 3.0; python_version >= "3.7"
13+
astroid >= 2.8, < 3.1; python_version >= "3.7"
1414
pylint >= 1.9, < 2.0; python_version == "2.7"
1515
pylint >= 2.6, < 2.7; python_version == "3.5"
1616
pylint >= 2.7, < 2.10; python_version == "3.6"
17-
pylint >= 2.11, < 3.0; python_version >= "3.7"
17+
pylint >= 2.11, < 3.1; python_version >= "3.7"
Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
unittest2; python_version <= "3.9"
22

3-
typing >= 3.5, < 3.11; python_version == "3.4"
4-
pytest >= 3.2, < 3.3; python_version == "2.6"
5-
pytest >= 3.2, < 5.0; python_version == "2.7"
6-
pytest >= 2.9, < 3.0; python_version == "3.2"
7-
pytest >= 3.2, < 3.3; python_version == "3.3"
8-
pytest >= 3.2, < 5.0; python_version == "3.4"
9-
pytest >= 3.2, < 6.2; python_version == "3.5"
10-
pytest >= 6.2.5, < 6.3; python_version >= "3.6"
3+
pytest >= 3.2.0, < 3.3; python_version == "2.6"
4+
pytest >= 4.6.9, < 5.0; python_version == "2.7"
5+
pytest >= 2.9.0, < 3.0; python_version == "3.2"
6+
pytest >= 3.2.0, < 3.3; python_version == "3.3"
7+
pytest >= 4.6.9, < 5.0; python_version == "3.4"
8+
pytest >= 6.1.2, < 6.2; python_version == "3.5"
9+
pytest >= 6.2.5, < 7.5; python_version >= "3.6"
1110

11+
coverage >= 4.5, < 5.0; python_version == "2.6"
12+
coverage >= 5.5, < 6.0; python_version == "2.7"
1213
coverage >= 3.7, < 4.0; python_version == "3.2"
14+
coverage >= 4.5, < 5.0; python_version == "3.3"
15+
coverage >= 4.5, < 5.0; python_version == "3.4"
16+
coverage >= 5.5, < 6.0; python_version == "3.5"
17+
coverage >= 5.5, < 7.4; python_version >= "3.6"
1318
pytest-cov >= 2.5, < 2.6; python_version == "2.6"
14-
pytest-cov >= 2.5, < 3.0; python_version == "2.7"
19+
pytest-cov >= 2.9, < 3.0; python_version == "2.7"
1520
pytest-cov >= 2.5, < 2.6; python_version == "3.2"
1621
pytest-cov >= 2.5, < 2.6; python_version == "3.3"
1722
pytest-cov >= 2.5, < 2.9; python_version == "3.4"
18-
pytest-cov >= 2.5, < 3.1; python_version >= "3.5"
23+
pytest-cov >= 2.9, < 4.2; python_version >= "3.5"

packages/basemap/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ numpy >= 1.15, < 1.17; python_version == "3.4"
88
numpy >= 1.16, < 1.19; python_version == "3.5"
99
numpy >= 1.19, < 1.20; python_version == "3.6"
1010
numpy >= 1.21, < 1.22; python_version == "3.7"
11-
numpy >= 1.21, < 1.26; python_version >= "3.8"
11+
numpy >= 1.21, < 1.27; python_version >= "3.8"
1212

1313
cycler < 0.11; python_version == "3.2"
1414
pyparsing >= 1.5, < 2.4.1; python_version == "2.6"

packages/basemap/setup.cfg

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ ignore =
2222
[tool:pytest]
2323
filterwarnings =
2424
error
25-
ignore::DeprecationWarning:unittest2.compatibility:
25+
# To be removed when replacing `unittest2`.
26+
ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated:DeprecationWarning:unittest2.compatibility:143
27+
# To be removed with `dateutil` release after 2.8.2.
28+
# See: https://github.com/dateutil/dateutil/issues/1314
29+
ignore:datetime.datetime.utcfromtimestamp\(\) is deprecated:DeprecationWarning:dateutil.tz.tz:37
2630

2731
[coverage:paths]
2832
source =

packages/basemap/setup.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
from setuptools import setup
1313
from setuptools import find_packages
1414
from setuptools.command.sdist import sdist
15-
from setuptools.dist import Distribution
1615
from setuptools.extension import Extension
1716

1817
try:
1918
import Cython
20-
cython_major_version = int(Cython.__version__.split(".")[0])
19+
cython_major_version = int(Cython.__version__.split(".", 1)[0])
2120
except ImportError:
2221
cython_major_version = 0
2322

@@ -84,7 +83,7 @@ def get_geos_install_prefix():
8483
return None
8584

8685

87-
class basemap_sdist(sdist):
86+
class basemap_sdist(sdist): # pylint: disable=invalid-name
8887
"""Custom `sdist` so that it will not pack DLLs on Windows if present."""
8988

9089
def run(self):
@@ -117,8 +116,8 @@ def run(self):
117116
import numpy
118117
include_dirs.append(numpy.get_include())
119118
except ImportError as err:
120-
build_cmds = ("bdist_wheel", "build", "install")
121-
if any(cmd in sys.argv[1:] for cmd in build_cmds):
119+
cmds = ("bdist_wheel", "build", "install")
120+
if any(cmd in sys.argv[1:] for cmd in cmds):
122121
warnings.warn("unable to locate NumPy headers", RuntimeWarning)
123122

124123
# Define GEOS include, library and runtime dirs.
@@ -241,7 +240,7 @@ def run(self):
241240
">=2.6",
242241
"!=3.0.*",
243242
"!=3.1.*",
244-
"<3.12",
243+
"<3.13",
245244
]),
246245
"setup_requires":
247246
setup_requires,

0 commit comments

Comments
 (0)