Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bb46bb4

Browse files
authored
Merge pull request #564 from matplotlib/bugfix-msvc-version
Ensure that Windows Python3 wheels are built with MSVC 14.0
2 parents 5dd2864 + 963572a commit bb46bb4

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919
jobs:
2020

2121
checkout:
22-
runs-on: windows-latest
22+
runs-on: windows-2019
2323
steps:
2424
-
2525
name: Checkout
@@ -32,7 +32,7 @@ jobs:
3232
path: .
3333

3434
lint:
35-
runs-on: windows-latest
35+
runs-on: windows-2019
3636
strategy:
3737
matrix:
3838
python-version:
@@ -90,11 +90,11 @@ jobs:
9090
arch:
9191
["x64", "x86"]
9292
msvc-toolset:
93-
["9.0", "14.16"]
93+
["9.0", "14.0"]
9494
max-parallel: 4
9595
fail-fast: false
9696
needs: lint
97-
runs-on: windows-latest
97+
runs-on: windows-2019
9898
steps:
9999
-
100100
name: Download checkout
@@ -141,7 +141,7 @@ jobs:
141141
max-parallel: 3
142142
fail-fast: false
143143
needs: build-geos
144-
runs-on: windows-latest
144+
runs-on: windows-2019
145145
steps:
146146
-
147147
name: Download checkout
@@ -155,7 +155,7 @@ jobs:
155155
if ("${{ matrix.python-version }}" -eq "2.7") {
156156
echo "msvc-toolset=9.0" >> $env:GITHUB_ENV
157157
} else {
158-
echo "msvc-toolset=14.16" >> $env:GITHUB_ENV
158+
echo "msvc-toolset=14.0" >> $env:GITHUB_ENV
159159
}
160160
-
161161
name: Set MSVC toolset
@@ -215,7 +215,7 @@ jobs:
215215
max-parallel: 3
216216
fail-fast: false
217217
needs: build
218-
runs-on: windows-latest
218+
runs-on: windows-2019
219219
steps:
220220
-
221221
name: Set Python
@@ -253,7 +253,7 @@ jobs:
253253
max-parallel: 1
254254
if: startsWith(github.event.ref, 'refs/tags/v')
255255
needs: test
256-
runs-on: windows-latest
256+
runs-on: windows-2019
257257
environment: PyPI
258258
steps:
259259
-

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@ https://semver.org/spec/v2.0.0.html
1414

1515
### Added
1616
- Support for Python 3.11 (PR [#563], solves issue [#561]).
17+
- Optional argument `toolset` in `GeosLibrary.build` method.
1718

1819
### Changed
1920
- Upgrade `matplotlib` upper pin to 3.7.
2021
- Upgrade `pyproj` upper pin to 3.5.
2122

23+
### Fixed
24+
- Set MSVC 14.0 (VS2015) to build the precompiled Windows wheels in
25+
GitHub workflows (PR [#564]).
26+
2227
## [1.3.5] - 2022-10-25
2328

2429
### Fixed
@@ -943,6 +948,8 @@ https://semver.org/spec/v2.0.0.html
943948
- Fix glitches in drawing of parallels and meridians.
944949

945950

951+
[#564]:
952+
https://github.com/matplotlib/basemap/pull/564
946953
[#563]:
947954
https://github.com/matplotlib/basemap/pull/563
948955
[#561]:

packages/basemap/utils/GeosLibrary.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def extract(self, overwrite=True):
213213
line = line.replace(oldtext2, newtext2)
214214
fd.write(line.encode())
215215

216-
def build(self, installdir=None, njobs=1):
216+
def build(self, installdir=None, toolset=None, njobs=1):
217217
"""Build and install GEOS from source."""
218218

219219
# Download and extract zip file if not present.
@@ -242,8 +242,10 @@ def build(self, installdir=None, njobs=1):
242242

243243
# Define custom configure and build options.
244244
if os.name == "nt":
245-
config_opts += ["-DCMAKE_CXX_FLAGS='/wd4251 /wd4458 /wd4530'"]
245+
config_opts += ["-DCMAKE_CXX_FLAGS='/wd4251 /wd4458 /wd4530 /EHsc'"]
246246
if version >= (3, 6, 0) and sys.version_info[:2] >= (3, 3):
247+
if toolset is not None:
248+
config_opts += ["-DCMAKE_GENERATOR_TOOLSET={0}".format(toolset)]
247249
build_opts = ["-j", "{0:d}".format(njobs)] + build_opts
248250
else:
249251
win64 = (8 * struct.calcsize("P") == 64)

0 commit comments

Comments
 (0)