Skip to content

Commit 9fbc192

Browse files
simmsajmcvey3
andauthored
Fix failing pip tests (#422)
Status: Ready This is a fix for failing pip tests in main.yml: https://github.com/MHKiT-Software/MHKiT-Python/actions/runs/18511807517/job/52754343805?pr=421 https://github.com/MHKiT-Software/MHKiT-Python/actions/runs/18511807517/job/52754343883?pr=421 There are lots of errors in both of these tests related to h5 and netcdf4. One fix for this is installing the system h5 and nc binaries and having pip rebuild against these binaries --------- Co-authored-by: jmcvey3 <[email protected]>
1 parent 265956d commit 9fbc192

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,20 @@ jobs:
282282
name: data
283283
path: ~/.cache/mhkit
284284

285+
- name: Install system dependencies
286+
if: runner.os == 'Linux'
287+
run: sudo apt-get install -y libhdf5-dev libnetcdf-dev
288+
285289
- name: Update and install packages
286290
shell: bash -l {0}
287291
run: |
288292
python -m pip install --upgrade pip wheel
289293
pip install -e ".[all,dev]"
290294
295+
- name: Reinstall h5py and netCDF4 with system libraries
296+
if: runner.os == 'Linux'
297+
run: "pip install --force-reinstall --no-binary=:all: h5py netCDF4"
298+
291299
- name: Install setuptools for Python 3.12
292300
if: matrix.python-version == '3.12'
293301
run: pip install setuptools
@@ -469,12 +477,18 @@ jobs:
469477
name: data
470478
path: ~/.cache/mhkit
471479

480+
- name: Install system dependencies
481+
run: sudo apt-get install -y libhdf5-dev libnetcdf-dev
482+
472483
- name: Install MHKiT with optional dependency
473484
run: |
474485
python -m pip install --upgrade pip
475486
pip install "mhkit[${{ matrix.module }}]"
476487
pip install pytest
477488
489+
- name: Reinstall h5py and netCDF4 with system libraries
490+
run: "pip install --force-reinstall --no-binary=:all: h5py netCDF4"
491+
478492
- name: Run tests for ${{ matrix.module }}
479493
env:
480494
MPLBACKEND: Agg

0 commit comments

Comments
 (0)