Skip to content

Ensure that Windows Python3 wheels are built with MSVC 14.0 #564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/basemap-for-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
jobs:

checkout:
runs-on: windows-latest
runs-on: windows-2019
steps:
-
name: Checkout
Expand All @@ -32,7 +32,7 @@ jobs:
path: .

lint:
runs-on: windows-latest
runs-on: windows-2019
strategy:
matrix:
python-version:
Expand Down Expand Up @@ -90,11 +90,11 @@ jobs:
arch:
["x64", "x86"]
msvc-toolset:
["9.0", "14.16"]
["9.0", "14.0"]
max-parallel: 4
fail-fast: false
needs: lint
runs-on: windows-latest
runs-on: windows-2019
steps:
-
name: Download checkout
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
max-parallel: 3
fail-fast: false
needs: build-geos
runs-on: windows-latest
runs-on: windows-2019
steps:
-
name: Download checkout
Expand All @@ -155,7 +155,7 @@ jobs:
if ("${{ matrix.python-version }}" -eq "2.7") {
echo "msvc-toolset=9.0" >> $env:GITHUB_ENV
} else {
echo "msvc-toolset=14.16" >> $env:GITHUB_ENV
echo "msvc-toolset=14.0" >> $env:GITHUB_ENV
}
-
name: Set MSVC toolset
Expand Down Expand Up @@ -215,7 +215,7 @@ jobs:
max-parallel: 3
fail-fast: false
needs: build
runs-on: windows-latest
runs-on: windows-2019
steps:
-
name: Set Python
Expand Down Expand Up @@ -253,7 +253,7 @@ jobs:
max-parallel: 1
if: startsWith(github.event.ref, 'refs/tags/v')
needs: test
runs-on: windows-latest
runs-on: windows-2019
environment: PyPI
steps:
-
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ https://semver.org/spec/v2.0.0.html

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

### Changed
- Upgrade `matplotlib` upper pin to 3.7.
- Upgrade `pyproj` upper pin to 3.5.

### Fixed
- Set MSVC 14.0 (VS2015) to build the precompiled Windows wheels in
GitHub workflows (PR [#564]).

## [1.3.5] - 2022-10-25

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


[#564]:
https://github.com/matplotlib/basemap/pull/564
[#563]:
https://github.com/matplotlib/basemap/pull/563
[#561]:
Expand Down
6 changes: 4 additions & 2 deletions packages/basemap/utils/GeosLibrary.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def extract(self, overwrite=True):
line = line.replace(oldtext2, newtext2)
fd.write(line.encode())

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

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

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