Skip to content

Commit 3ca087e

Browse files
fix: clear uv cache and .pyc files for lowest-direct tests
1 parent cb560c2 commit 3ca087e

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
@@ -54,7 +54,13 @@ jobs:
5454
version: 0.9.5
5555

5656
- name: Install the project
57-
run: uv sync ${{ matrix.dep-resolution.install-flags }} --all-extras --python ${{ matrix.python-version }}
57+
run: |
58+
if [ "${{ matrix.dep-resolution.name }}" == "lowest-direct" ]; then
59+
# Clear cache for lowest-direct to ensure clean install
60+
rm -rf $UV_CACHE_DIR/* 2>/dev/null || true
61+
fi
62+
uv sync ${{ matrix.dep-resolution.install-flags }} --all-extras --python ${{ matrix.python-version }}
63+
shell: bash
5864

5965
- name: Debug - Inspect installed anyio package
6066
if: matrix.dep-resolution.name == 'lowest-direct'
@@ -92,11 +98,15 @@ jobs:
9298
shell: bash
9399
run: |
94100
if [ "${{ matrix.dep-resolution.name }}" == "lowest-direct" ]; then
101+
# Clean any stale .pyc files that might be causing issues
102+
find .venv -name "*.pyc" -delete 2>/dev/null || true
103+
find .venv -name "__pycache__" -type d -delete 2>/dev/null || true
104+
95105
# Run pytest directly from venv to avoid any uv resolution issues
96106
# Isolate the Python environment completely
97107
export PYTHONNOUSERSITE=1
98108
export PYTHONPATH=""
99-
export UV_PYTHON_PREFERENCE=only-system
109+
export PYTHONDONTWRITEBYTECODE=1
100110
if [ "$RUNNER_OS" == "Windows" ]; then
101111
.venv/Scripts/python -m pytest -v
102112
else

0 commit comments

Comments
 (0)