Skip to content

Commit 011a4f5

Browse files
committed
fix windows setup
1 parent 1cfb6ea commit 011a4f5

2 files changed

Lines changed: 21 additions & 18 deletions

File tree

.github/workflows/cibuildwheel.yml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -123,25 +123,10 @@ jobs:
123123
create-args: >-
124124
python=${{ matrix.python-version }} libnetcdf=4.9.2 --channel conda-forge
125125
126-
- name: Install cibuildwheel
127-
run: |
128-
python -m pip install --upgrade cibuildwheel delvewheel
129-
130126
- name: Build wheels for Windows (${{ matrix.arch }})
131-
run: cibuildwheel --output-dir wheelhouse
127+
uses: pypa/cibuildwheel@v3.1.4
132128
env:
133-
CIBW_BUILD: "cp39-${{ matrix.arch }} cp310-${{ matrix.arch }} cp311-${{ matrix.arch }} cp312-${{ matrix.arch }} cp313-${{ matrix.arch }}"
134-
CIBW_ENVIRONMENT_WINDOWS: >
135-
HDF5_DIR="C:\\Users\\runneradmin\\micromamba\\envs\\build\\Library"
136-
netCDF4_DIR="C:\\Users\\runneradmin\\micromamba\\envs\\build\\Library"
137-
PATH="C:\\Users\\runneradmin\\micromamba\\envs\\build\\Library\\bin;${PATH}"
138-
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >
139-
delvewheel show {wheel}
140-
&& delvewheel repair -w {dest_dir} {wheel}
141-
CIBW_TEST_REQUIRES: pytest cython packaging typing-extensions
142-
CIBW_TEST_COMMAND: >
143-
python -c "import netCDF4; print(f'netCDF4 v{netCDF4.__version__}')"
144-
&& pytest -s -rxs -v {project}\\test
129+
CIBW_ARCHS: ${{ matrix.arch }}
145130

146131
- uses: actions/upload-artifact@v4
147132
with:

pyproject.toml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,13 @@ skip = [
112112
"cp314t-*",
113113
]
114114
test-extras = "tests"
115+
test-sources = [
116+
"test",
117+
"pyproject.toml"
118+
]
115119
test-command = [
116120
"""python -c 'import netCDF4; print(f"netCDF4 v{netCDF4.__version__}")'""",
117-
"pytest -s -rxs -v {project}/test",
121+
"pytest -s -rxs -v test",
118122
]
119123
manylinux-x86_64-image = "ghcr.io/ocefpaf/manylinux_2_28_x86_64-netcdf"
120124
manylinux-aarch64-image = "ghcr.io/ocefpaf/manylinux_2_28_aarch64-netcdf"
@@ -132,3 +136,17 @@ environment.MACOSX_DEPLOYMENT_TARGET = "13.0"
132136
select = "*-macosx_*_arm64*"
133137
inherit.environment = "append"
134138
environment.MACOSX_DEPLOYMENT_TARGET = "14.0"
139+
140+
[tool.cibuildwheel.windows]
141+
before-build = "python -m pip install delvewheel"
142+
repair-wheel-command = [
143+
"delvewheel show {wheel}",
144+
"delvewheel repair -w {dest_dir} {wheel}",
145+
]
146+
147+
[[tool.cibuildwheel.overrides]]
148+
select = "*-win_*"
149+
inherit.environment = "append"
150+
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}" }
151+
152+

0 commit comments

Comments
 (0)