Skip to content

Commit 97cd848

Browse files
fix: Use dynamic site-packages detection for cross-platform compatibility
- Replace hardcoded Python version paths with dynamic detection - Use site.getsitepackages() to find correct virtualenv paths - Improves compatibility across Python versions and platforms - Should resolve remaining Python 3.12 and macOS CI failures Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
1 parent 60466b2 commit 97cd848

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/unit_tests.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,17 @@ jobs:
4545
- name: Install dependencies
4646
run: make install-python-dependencies-ci
4747
- name: Test Python
48-
env:
49-
PYTHONPATH: "${{ github.workspace }}/.venv/lib/python${{ matrix.python-version }}/site-packages"
5048
run: |
49+
# Set up environment for Ray workers to access packages
5150
export PATH="${{ github.workspace }}/.venv/bin:$PATH"
51+
52+
# Dynamically detect the correct site-packages path
53+
SITE_PACKAGES=$(uv run python -c "import site; print(site.getsitepackages()[0])")
54+
export PYTHONPATH="$SITE_PACKAGES"
55+
56+
echo "Using PYTHONPATH: $PYTHONPATH"
57+
echo "Using PATH: $PATH"
58+
5259
make test-python-unit
5360
- name: Minimize uv cache
5461
run: uv cache prune --ci

0 commit comments

Comments
 (0)