From e17ab0ceef26a23ddf095a5d82cc41eb1be41c5d Mon Sep 17 00:00:00 2001 From: osobh Date: Sun, 20 Sep 2026 04:55:09 -0700 Subject: [PATCH] ci: name the interop interpreter instead of relying on $GITHUB_PATH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The workflow already installed h5py into /opt/interop and set CLAWHDF5_REQUIRE_INTEROP=1, but it reached the tests only by appending that venv to $GITHUB_PATH, which Gitea's runner does not reliably propagate into test subprocesses. If `python3` resolved to the system interpreter instead, every interop suite would skip. Setting CLAWHDF5_PYTHON outright removes the question: together with REQUIRE_INTEROP the suites either run or the build goes red. Verified both directions locally — with a venv the four suites run 94 tests green; with a bogus interpreter and REQUIRE_INTEROP=1 the facade and netCDF4 suites fail 22 tests rather than skipping. Also documents creating the local `.venv` that `ci-test.sh` detects. Co-Authored-By: Claude Opus 5 (1M context) --- .gitea/workflows/ci.yml | 8 +++++++- README.md | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 289d7cc..2e09af0 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -33,8 +33,14 @@ jobs: /opt/interop/bin/pip install --no-cache-dir h5py numpy netCDF4 xarray echo "/opt/interop/bin" >> "$GITHUB_PATH" - name: Show interop library versions - run: python3 -c "import h5py, netCDF4; print('h5py', h5py.__version__, 'HDF5', h5py.version.hdf5_version, 'netCDF4', netCDF4.__version__)" + run: /opt/interop/bin/python -c "import h5py, netCDF4; print('h5py', h5py.__version__, 'HDF5', h5py.version.hdf5_version, 'netCDF4', netCDF4.__version__)" - name: Run CI script env: + # Name the interpreter outright rather than relying on $GITHUB_PATH + # reaching the test processes: if `python3` resolved to the system + # one instead of the venv, every interop suite would skip. + # CLAWHDF5_REQUIRE_INTEROP turns that skip into a failure, so the + # two together mean the suites either run or the build goes red. + CLAWHDF5_PYTHON: /opt/interop/bin/python CLAWHDF5_REQUIRE_INTEROP: "1" run: bash scripts/ci-test.sh diff --git a/README.md b/README.md index b9bed33..53e8b85 100644 --- a/README.md +++ b/README.md @@ -499,6 +499,14 @@ cargo build -p clawhdf5-agent --features "agent,float16,accelerate,parallel,gpu" # Tests cargo test --workspace # all 1,650+ tests cargo test -p clawhdf5-agent # agent memory tests +scripts/ci-test.sh # what CI runs: fmt, clippy matrix, tests, + # h5py/netCDF4 interop, no_std + +# The interop suites need a Python with h5py; on a PEP 668 system that has to +# be a virtualenv. `ci-test.sh` finds `.venv` on its own, or set +# CLAWHDF5_PYTHON. Without one they skip — set CLAWHDF5_REQUIRE_INTEROP=1 to +# make that a failure instead. +python3 -m venv .venv && .venv/bin/pip install h5py numpy netCDF4 xarray # Benchmarks cargo bench -p clawhdf5-agent # agent memory suite