From e0fc469b54147ca35189d6abda8b35ae519400f0 Mon Sep 17 00:00:00 2001 From: crusaderky Date: Tue, 19 Nov 2024 12:17:29 +0000 Subject: [PATCH] Debug libhdf5 version in CI --- .github/workflows/pre-commit.yml | 2 +- .github/workflows/publish_docs.yml | 4 ++-- .github/workflows/pypi_publish.yml | 2 +- .github/workflows/tests.yml | 16 ++++++++++------ utils/__init__.py | 18 ++++++++++++++++-- 5 files changed, 30 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 92305c81..6d04efda 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -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/setup-python@v5.2.0 with: python-version: '3.12' diff --git a/.github/workflows/publish_docs.yml b/.github/workflows/publish_docs.yml index d5fc8c62..58852d4a 100644 --- a/.github/workflows/publish_docs.yml +++ b/.github/workflows/publish_docs.yml @@ -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: diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index 7055be32..6178bb4e 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 88bacbc9..54ca102d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 }} @@ -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 diff --git a/utils/__init__.py b/utils/__init__.py index aa6b95e1..720a34d9 100644 --- a/utils/__init__.py +++ b/utils/__init__.py @@ -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 @@ -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)