Skip to content

Commit 95d4a98

Browse files
authored
Merge pull request #1453 from K20shores/windows_arm
Windows arm wheel build
2 parents bdceb17 + 9fe4f65 commit 95d4a98

File tree

2 files changed

+54
-4
lines changed

2 files changed

+54
-4
lines changed

.github/workflows/cibuildwheel.yml

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
include:
5656
- os: ubuntu-22.04
5757
arch: x86_64
58-
- os: ubuntu-22.04
58+
- os: ubuntu-24.04-arm
5959
arch: aarch64
6060

6161
steps:
@@ -138,8 +138,48 @@ jobs:
138138
path: ${{ github.workspace }}/wheelhouse/*.whl
139139

140140

141+
build_wheels_windows_arm:
142+
name: Build wheels for ARM64 on Windows
143+
runs-on: windows-11-arm
144+
steps:
145+
- uses: actions/checkout@v6
146+
with:
147+
fetch-depth: 0
148+
149+
- uses: actions/setup-python@v6
150+
name: Install Python
151+
with:
152+
python-version: 3.x
153+
154+
- name: Install vcpkg dependencies
155+
shell: pwsh
156+
run: |
157+
# Install vcpkg
158+
git clone https://github.com/Microsoft/vcpkg.git C:\vcpkg
159+
cd C:\vcpkg
160+
.\bootstrap-vcpkg.bat
161+
162+
# Install netcdf and dependencies
163+
.\vcpkg.exe install hdf5:arm64-windows netcdf-c:arm64-windows zlib:arm64-windows
164+
165+
# Set environment variables for build
166+
echo "HDF5_DIR=C:\vcpkg\installed\arm64-windows" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
167+
echo "NETCDF4_DIR=C:\vcpkg\installed\arm64-windows" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
168+
169+
- name: Build wheels for Windows ARM64
170+
uses: pypa/[email protected]
171+
env:
172+
CIBW_ARCHS: ARM64
173+
CIBW_SKIP: "cp310-* cp314t-*"
174+
175+
- uses: actions/upload-artifact@v5
176+
with:
177+
name: pypi-artifacts-windows-11-arm-ARM64
178+
path: ${{ github.workspace }}/wheelhouse/*.whl
179+
180+
141181
show-artifacts:
142-
needs: [build_bdist, build_sdist, build_wheels_winmac]
182+
needs: [build_bdist, build_sdist, build_wheels_winmac, build_wheels_windows_arm]
143183
name: "Show artifacts"
144184
runs-on: ubuntu-22.04
145185
steps:
@@ -155,7 +195,7 @@ jobs:
155195
156196
157197
publish-artifacts-pypi:
158-
needs: [build_bdist, build_sdist, build_wheels_winmac]
198+
needs: [build_bdist, build_sdist, build_wheels_winmac, build_wheels_windows_arm]
159199
name: "Publish to PyPI"
160200
runs-on: ubuntu-22.04
161201
# upload to PyPI for every tag starting with 'v'

pyproject.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ classifiers = [
3636
dependencies = [
3737
"cftime",
3838
"certifi",
39-
"numpy",
39+
"numpy>=2.3.0; platform_system == 'Windows' and platform_machine == 'ARM64'",
40+
"numpy>=1.21.2; platform_system != 'Windows' or platform_machine != 'ARM64'",
4041
]
4142
dynamic = ["version"]
4243

@@ -156,3 +157,12 @@ environment = {MACOSX_DEPLOYMENT_TARGET="14.0",HDF5_DIR="/Users/runner/micromamb
156157
select = "*-win_*"
157158
inherit.environment = "append"
158159
environment = {HDF5_DIR='C:\\\\Users\\runneradmin\\micromamba\\envs\\build\\Library',netCDF4_DIR='C:\\\\Users\\runneradmin\\micromamba\\envs\\build\\Library',PATH='C:\\\\Users\\runneradmin\\micromamba\\envs\\build\\Library\\bin;${PATH}',NETCDF_PLUGIN_DIR='C:\\\\Users\\runneradmin\\micromamba\\envs\\build\\Library\\hdf5\\lib\\plugin'}
160+
161+
[[tool.cibuildwheel.overrides]]
162+
select = "*-win_arm64"
163+
inherit.environment = "append"
164+
environment = { HDF5_DIR = 'C:\\\\vcpkg\\\\installed\\\\arm64-windows', netCDF4_DIR = 'C:\\\\vcpkg\\\\installed\\\\arm64-windows', PATH = 'C:\\\\vcpkg\\\\installed\\\\arm64-windows\\\\bin;${PATH}', NO_CDL = '1' }
165+
repair-wheel-command = [
166+
"delvewheel show {wheel}",
167+
"delvewheel repair -w {dest_dir} {wheel}",
168+
]

0 commit comments

Comments
 (0)