Skip to content

Commit

Permalink
update to hdf5 1.14 for windows, since h5py made the jump (#477)
Browse files Browse the repository at this point in the history
* update to hdf5 1.14 for windows, since h5py made the jump
  • Loading branch information
mgeplf authored Nov 27, 2023
1 parent 89fcfe3 commit d3464e1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
32 changes: 25 additions & 7 deletions .github/workflows/publish-sdist-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ on: [pull_request, push]
env:
CIBW_BUILD_VERBOSITY: 3
CIBW_BUILD: 'cp*'
CIBW_SKIP: 'cp35-* cp36-* *-manylinux_i686 *-musllinux_* *-win32 cp311-macosx_x86_64'
CIBW_SKIP: 'cp35-* cp36-* cp37-* *-manylinux_i686 *-musllinux_* *-win32 cp311-macosx_x86_64'
CIBW_BEFORE_TEST: pip install -r {project}/tests/requirement_tests.txt
CIBW_TEST_COMMAND: pytest -s -v {project}/tests
WINDOWS_HDF5: 1.14.2

jobs:
build_wheels:
Expand Down Expand Up @@ -89,6 +90,24 @@ jobs:
run: |
python -m cibuildwheel --output-dir dist
- name: Cache HDF5 On Windows
if: runner.os == 'Windows'
id: cache-hdf5-windows
uses: actions/cache@v3
env:
cache-name: cache-hdf5-windows
with:
path: C:\cache\hdf5\${{ env.WINDOWS_HDF5 }}
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.WINDOWS_HDF5 }}

- name: Fill Windows Cache
if: runner.os == 'Windows' && steps.cache-hdf5-windows.outputs.cache-hit != 'true'
continue-on-error: false
shell: cmd
run: |
mkdir C:\cache\hdf5\${{ env.WINDOWS_HDF5 }}
curl -L -o C:\cache\hdf5\${{ env.WINDOWS_HDF5 }}\hdf5.zip https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.14/hdf5-1.14.2/bin/windows/hdf5-1.14.2-Std-win10_64-vs16.zip
- name: Build wheels Windows
if: runner.os == 'Windows'
shell: cmd
Expand All @@ -99,13 +118,12 @@ jobs:
# this has a partial table:
# https://devblogs.microsoft.com/cppblog/side-by-side-minor-version-msvc-toolsets-in-visual-studio-2017/
run: |
curl -O https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0/bin/hdf5-1.12.0-Std-win10_64-vs16.zip
C:\windows\system32\tar.exe xf hdf5-1.12.0-Std-win10_64-vs16.zip
start /wait msiexec /a "%cd%\hdf\HDF5-1.12.0-win64.msi" /qn TARGETDIR="c:\hdf5\"
C:\windows\system32\tar.exe xf C:\cache\hdf5\${{ env.WINDOWS_HDF5 }}\hdf5.zip
start /wait msiexec /a "%cd%\hdf\HDF5-${{ env.WINDOWS_HDF5 }}-win64.msi" /qn TARGETDIR="c:\hdf5\"
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.1
set HDF5_DIR=C:\hdf5\HDF_Group\HDF5\1.12.0\cmake
set HDF5_DIR=C:\hdf5\HDF_Group\HDF5\${{ env.WINDOWS_HDF5 }}\cmake
python -m cibuildwheel --output-dir dist
Expand All @@ -125,10 +143,10 @@ jobs:
with:
submodules: 'true'

- name: Set up Python 3.7
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.8

- name: Build a source tarball
run:
Expand Down
4 changes: 2 additions & 2 deletions morphio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# there cannot be a mismatch between version, when using windows,
# and MorphIO doesn't need to build hdf5
import h5py as _h5py
if (1, 12) != _h5py.version.hdf5_version_tuple[:2]:
raise RuntimeError(f'HDF5 library version mismatch. 1.12.x != {_h5py.version.hdf5_version}')
if (1, 14) != _h5py.version.hdf5_version_tuple[:2]:
raise RuntimeError(f'HDF5 library version mismatch. 1.14.x != {_h5py.version.hdf5_version}')
del _h5py


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ def build_extension(self, ext):
setup_requires=[
'setuptools_scm',
],
python_requires=">=3.7",
python_requires=">=3.8",
)

0 comments on commit d3464e1

Please sign in to comment.