Skip to content

Commit cb560c2

Browse files
debug: add sys.path debugging and isolate pytest environment
1 parent 18aa79b commit cb560c2

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/shared.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,25 @@ jobs:
8282
echo "=== Testing import from anyio with uv run ==="
8383
uv run --no-project --no-sync python -c "from anyio._backends import _asyncio; print('Import successful')" || echo "Import failed"
8484
85+
echo "=== Checking sys.path from venv Python ==="
86+
.venv/bin/python -c "import sys; import pprint; pprint.pprint(sys.path)"
87+
88+
echo "=== Checking where anyio is loaded from ==="
89+
.venv/bin/python -c "import anyio; print('anyio location:', anyio.__file__)"
90+
8591
- name: Run pytest
8692
shell: bash
8793
run: |
8894
if [ "${{ matrix.dep-resolution.name }}" == "lowest-direct" ]; then
8995
# Run pytest directly from venv to avoid any uv resolution issues
96+
# Isolate the Python environment completely
97+
export PYTHONNOUSERSITE=1
98+
export PYTHONPATH=""
99+
export UV_PYTHON_PREFERENCE=only-system
90100
if [ "$RUNNER_OS" == "Windows" ]; then
91-
.venv/Scripts/python -m pytest
101+
.venv/Scripts/python -m pytest -v
92102
else
93-
.venv/bin/python -m pytest
103+
.venv/bin/python -m pytest -v
94104
fi
95105
else
96106
uv run --frozen --no-sync pytest

0 commit comments

Comments
 (0)