Skip to content

Commit c4459b4

Browse files
committed
maybe this
1 parent 434a640 commit c4459b4

2 files changed

Lines changed: 85 additions & 64 deletions

File tree

.github/workflows/cibuildwheel.yml

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ jobs:
106106
arch: arm64
107107
- os: macos-15-intel
108108
arch: x86_64
109-
- os: windows-11-arm
110-
arch: ARM64
111109

112110
steps:
113111
- uses: actions/checkout@v6
@@ -138,8 +136,47 @@ jobs:
138136
path: ${{ github.workspace }}/wheelhouse/*.whl
139137

140138

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

pyproject.toml

Lines changed: 44 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,48 @@
11
[build-system]
22
requires = [
3-
"Cython>=0.29",
4-
"numpy>=2.0.0",
5-
"setuptools>=77.0.1",
6-
"setuptools_scm[toml]>=3.4",
3+
"Cython>=0.29",
4+
"numpy>=2.0.0",
5+
"setuptools>=77.0.1",
6+
"setuptools_scm[toml]>=3.4",
77
]
88
build-backend = "setuptools.build_meta"
99

1010
[project]
1111
name = "netCDF4"
1212
description = "Provides an object-oriented python interface to the netCDF version 4 library"
13-
authors = [
14-
{name = "Jeff Whitaker", email = "whitaker.jeffrey@gmail.com"},
15-
]
13+
authors = [{ name = "Jeff Whitaker", email = "whitaker.jeffrey@gmail.com" }]
1614
requires-python = ">=3.10"
1715
keywords = [
18-
"numpy", "netcdf", "data", "science", "network", "oceanography",
19-
"meteorology", "climate",
16+
"numpy",
17+
"netcdf",
18+
"data",
19+
"science",
20+
"network",
21+
"oceanography",
22+
"meteorology",
23+
"climate",
2024
]
2125
license = "MIT"
2226
license-files = ["LICENSE"]
2327
classifiers = [
24-
"Development Status :: 3 - Alpha",
25-
"Programming Language :: Python :: 3",
26-
"Programming Language :: Python :: 3.10",
27-
"Programming Language :: Python :: 3.11",
28-
"Programming Language :: Python :: 3.12",
29-
"Programming Language :: Python :: 3.13",
30-
"Programming Language :: Python :: 3.14",
31-
"Intended Audience :: Science/Research",
32-
"Topic :: Software Development :: Libraries :: Python Modules",
33-
"Topic :: System :: Archiving :: Compression",
34-
"Operating System :: OS Independent",
35-
]
36-
dependencies = [
37-
"cftime",
38-
"certifi",
39-
"numpy",
28+
"Development Status :: 3 - Alpha",
29+
"Programming Language :: Python :: 3",
30+
"Programming Language :: Python :: 3.10",
31+
"Programming Language :: Python :: 3.11",
32+
"Programming Language :: Python :: 3.12",
33+
"Programming Language :: Python :: 3.13",
34+
"Programming Language :: Python :: 3.14",
35+
"Intended Audience :: Science/Research",
36+
"Topic :: Software Development :: Libraries :: Python Modules",
37+
"Topic :: System :: Archiving :: Compression",
38+
"Operating System :: OS Independent",
4039
]
40+
dependencies = ["cftime", "certifi", "numpy"]
4141
dynamic = ["version"]
4242

4343
[project.optional-dependencies]
44-
tests = [
45-
"Cython",
46-
"packaging",
47-
"pytest",
48-
"typing-extensions>=4.15.0",
49-
]
50-
parallel = [
51-
"mpi4py",
52-
]
44+
tests = ["Cython", "packaging", "pytest", "typing-extensions>=4.15.0"]
45+
parallel = ["mpi4py"]
5346

5447
[project.readme]
5548
text = """\
@@ -81,10 +74,7 @@ where = ["src"]
8174

8275
[tool.pytest.ini_options]
8376
pythonpath = ["test"]
84-
filterwarnings = [
85-
"error",
86-
"ignore::UserWarning",
87-
]
77+
filterwarnings = ["error", "ignore::UserWarning"]
8878

8979
[tool.mypy]
9080
files = ["src/netCDF4"]
@@ -97,32 +87,21 @@ explicit_package_bases = true
9787

9888
[[tool.mypy.overrides]]
9989
ignore_missing_imports = true
100-
module = [
101-
"cftime.*",
102-
"cython.*",
103-
"filter_availability",
104-
"matplotlib.*"
105-
]
90+
module = ["cftime.*", "cython.*", "filter_availability", "matplotlib.*"]
10691

10792
[tool.cibuildwheel]
10893
build-verbosity = 1
10994
build-frontend = "build"
110-
skip = [
111-
"*-musllinux*",
112-
"cp314t-*",
113-
]
95+
skip = ["*-musllinux*", "cp314t-*"]
11496
test-extras = "tests"
115-
test-sources = [
116-
"test",
117-
"pyproject.toml"
118-
]
97+
test-sources = ["test", "pyproject.toml"]
11998
test-command = [
120-
'''python -c "import netCDF4; print(f'netCDF4 v{netCDF4.__version__}')"''',
121-
"pytest -s -rxs -v test",
99+
'''python -c "import netCDF4; print(f'netCDF4 v{netCDF4.__version__}')"''',
100+
"pytest -s -rxs -v test",
122101
]
123102
manylinux-x86_64-image = "ghcr.io/ocefpaf/manylinux_2_28_x86_64-netcdf"
124103
manylinux-aarch64-image = "ghcr.io/ocefpaf/manylinux_2_28_aarch64-netcdf"
125-
environment = {NETCDF4_LIMITED_API="1"}
104+
environment = { NETCDF4_LIMITED_API = "1" }
126105

127106
[tool.cibuildwheel.macos]
128107
# https://cibuildwheel.pypa.io/en/stable/faq/#macos-passing-dyld_library_path-to-delocate
@@ -140,19 +119,24 @@ repair-wheel-command = [
140119

141120
[[tool.cibuildwheel.overrides]]
142121
select = "*linux*"
143-
environment = {NETCDF_PLUGIN_DIR="/usr/local/hdf5/lib/plugin/"}
122+
environment = { NETCDF_PLUGIN_DIR = "/usr/local/hdf5/lib/plugin/" }
144123

145124
[[tool.cibuildwheel.overrides]]
146125
select = "*-macosx_x86_64"
147126
inherit.environment = "append"
148-
environment = {MACOSX_DEPLOYMENT_TARGET="13.0",HDF5_DIR="/Users/runner/micromamba/envs/build",netCDF4_DIR="/Users/runner/micromamba/envs/build",PATH="${PATH}:/Users/runner/micromamba/envs/build/bin",NETCDF_PLUGIN_DIR="/Users/runner/micromamba/envs/build/hdf5/lib/plugin"}
127+
environment = { MACOSX_DEPLOYMENT_TARGET = "13.0", HDF5_DIR = "/Users/runner/micromamba/envs/build", netCDF4_DIR = "/Users/runner/micromamba/envs/build", PATH = "${PATH}:/Users/runner/micromamba/envs/build/bin", NETCDF_PLUGIN_DIR = "/Users/runner/micromamba/envs/build/hdf5/lib/plugin" }
149128

150129
[[tool.cibuildwheel.overrides]]
151130
select = "*-macosx_arm64"
152131
inherit.environment = "append"
153-
environment = {MACOSX_DEPLOYMENT_TARGET="14.0",HDF5_DIR="/Users/runner/micromambe/envs/build",netCDF4_DIR="/Users/runner/micromambe/envs/build",PATH="${PATH}:/Users/runner/micromamba/envs/build/bin",NETCDF_PLUGIN_DIR="/Users/runner/micromamba/envs/build/hdf5/lib/plugin"}
132+
environment = { MACOSX_DEPLOYMENT_TARGET = "14.0", HDF5_DIR = "/Users/runner/micromambe/envs/build", netCDF4_DIR = "/Users/runner/micromambe/envs/build", PATH = "${PATH}:/Users/runner/micromamba/envs/build/bin", NETCDF_PLUGIN_DIR = "/Users/runner/micromamba/envs/build/hdf5/lib/plugin" }
133+
134+
[[tool.cibuildwheel.overrides]]
135+
select = "*-win_amd64"
136+
inherit.environment = "append"
137+
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' }
154138

155139
[[tool.cibuildwheel.overrides]]
156-
select = "*-win_*"
140+
select = "*-win_arm64"
157141
inherit.environment = "append"
158-
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'}
142+
environment = { HDF5_DIR = 'C:\\\\vcpkg\\installed\\arm64-windows', netCDF4_DIR = 'C:\\\\vcpkg\\installed\\arm64-windows', PATH = 'C:\\\\vcpkg\\installed\\arm64-windows\\bin;${PATH}' }

0 commit comments

Comments
 (0)