GitHub CI: fix and re-enable macOS tests with python 3.13

Fix the `Failed to load shared library 'libglib-2.0.0.dylib' referenced
by the typelib` error by adding the common Homebrew's shared library
directory (i.e., `$(brew --prefix)/lib`) to the dyld library search path.
This ensures that all Homebrew-installed shared libraries are discoverable
via `dlopen()`-like loading mechanism. (Previously, only directory
with `libhidapi` shared library was explicitly added to search path).

Use `DYLD_FALLBACK_LIBRARY_PATH` instead of `DYLD_LIBRARY_PATH` to
register the Homebrew library directory as a fallback search path
rather than preferred/default one. In general, this should be
preferred way of modifying library search path with 3rd-party
installations, even though it probably bears no real difference in
this particular scenario.
This commit is contained in:
Rok Mandeljc 2025-09-14 13:51:02 +02:00 committed by Peter F. Patel-Schneider
parent 694caf635e
commit 62aaeac595
1 changed files with 5 additions and 2 deletions

View File

@ -54,7 +54,7 @@ jobs:
strategy:
matrix:
python-version: [3.8]
python-version: [3.8, 3.13]
fail-fast: false
steps:
@ -69,12 +69,15 @@ jobs:
- name: Set up macOS dependencies
run: |
make install_brew
- name: Add Homebrew's library directory to dyld search path
run: |
echo "DYLD_FALLBACK_LIBRARY_PATH=$(brew --prefix)/lib:$DYLD_FALLBACK_LIBRARY_PATH" >> $GITHUB_ENV
- name: Install Python dependencies
run: |
make install_pip PIP_ARGS='.["test"]'
- name: Run tests on macOS
run: |
export DYLD_LIBRARY_PATH=$(brew --prefix hidapi)/lib:$DYLD_LIBRARY_PATH && pytest --cov --cov-report=xml
pytest --cov --cov-report=xml
- name: Upload coverage to Codecov
if: github.ref == 'refs/heads/master'
uses: codecov/codecov-action@v4.5.0