From 62aaeac59573704a2476341e6033ed5fcb29c7f0 Mon Sep 17 00:00:00 2001 From: Rok Mandeljc Date: Sun, 14 Sep 2025 13:51:02 +0200 Subject: [PATCH] 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. --- .github/workflows/tests.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 37907ff9..47d9702a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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