Skip to content

Commit

Permalink
Debug libhdf5 version in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
crusaderky committed Nov 19, 2024
1 parent 37f700c commit e0fc469
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: pre-commit hooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.1
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
python-version: '3.12'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
# Always checkout master branch, even if triggered by a tag.
# Otherwise sphinx-multiversion does not pull the master branch.
- uses: actions/checkout@v4
with:
ref: master
with:
ref: master

- uses: actions/setup-python@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 💻 Checkout the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 🐍 Set up Python
uses: actions/setup-python@v4
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
numpy-version: ['latest', '1.24.4']
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -40,17 +40,21 @@ jobs:
set -xe
pip install .
- name: Print hdf5 configuration
run: |
set -xe
h5cc -showconfig
- name: Install versioned-hdf5 test packages and extra h5py compression types
run: |
set -xe
pip install .[test]
pip install hdf5plugin tables
- name: Dump pip environment
run: pip list

- name: Print hdf5 configuration
run: |
set -xe
python -c 'import utils; utils.debug_libhdf5_so()'
h5cc -showconfig
- name: Run Tests
run: |
set -xe
Expand Down
18 changes: 16 additions & 2 deletions utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import absolute_import, division, print_function, with_statement

import os
import shutil
import subprocess
import tempfile
from contextlib import contextmanager

Expand All @@ -10,3 +10,17 @@ def temp_dir_ctx():
tmp_dir = tempfile.mkdtemp()
yield tmp_dir
shutil.rmtree(tmp_dir)


def debug_libhdf5_so():
"""Print out which .so file is actually loaded at runtime for libhdf5"""
import h5py

for row in (
subprocess.check_output(["lsof", "-p", str(os.getpid())])
.decode("utf-8")
.splitlines()
):
row = row.strip()
if "libhdf5" in row:
print(row)

0 comments on commit e0fc469

Please sign in to comment.