Skip to content

Commit 2fc9bc5

Browse files
fix: remove --frozen flag from lowest-direct pytest runs
Root cause identified: The --frozen flag was causing uv to validate against the lockfile, which has anyio 4.10.0 (from highest resolution). When running lowest-direct tests, we install anyio 4.5.0, but uv run with --frozen was re-resolving or using the lockfile version, causing the ImportError for RunFinishedError (which only exists in 4.11+). Changes: - lowest-direct tests now use: uv run --no-sync pytest - highest tests still use: uv run --frozen --no-sync pytest - Improved debugging to check venv directly without triggering re-resolution - Added comparison tests between --no-sync and --frozen --no-sync This ensures lowest-direct tests use the packages installed by --resolution lowest-direct without interference from the lockfile. Github-Issue: #1325
1 parent c1492fb commit 2fc9bc5

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

.github/workflows/shared.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,25 +59,24 @@ jobs:
5959
- name: Debug - Inspect installed anyio package
6060
if: matrix.dep-resolution.name == 'lowest-direct'
6161
run: |
62-
set -x
63-
echo "=== Anyio Version ==="
64-
uv run python -c "from importlib.metadata import version; print(version('anyio'))"
62+
echo "=== Anyio version from venv (direct check) ==="
63+
.venv/bin/python -c "from importlib.metadata import version; print(version('anyio'))"
6564
66-
echo "=== Anyio Package Location ==="
67-
ANYIO_PATH=$(uv run python -c "import anyio, os; print(os.path.dirname(anyio.__file__))")
65+
echo "=== Anyio location ==="
66+
ANYIO_PATH=$(.venv/bin/python -c "import anyio, os; print(os.path.dirname(anyio.__file__))")
6867
echo "$ANYIO_PATH"
6968
7069
echo "=== Checking for RunFinishedError in _asyncio.py ==="
7170
grep -n "RunFinishedError" "$ANYIO_PATH/_backends/_asyncio.py" || echo "Not found"
7271
73-
echo "=== First 100 lines of _asyncio.py ==="
74-
head -100 "$ANYIO_PATH/_backends/_asyncio.py"
72+
echo "=== Testing with 'uv run --no-sync' (what pytest will use) ==="
73+
uv run --no-sync python -c "from importlib.metadata import version; print('anyio version:', version('anyio'))"
7574
76-
echo "=== List anyio package contents ==="
77-
ls -la "$ANYIO_PATH"
75+
echo "=== Comparing with 'uv run --frozen --no-sync' (old approach) ==="
76+
uv run --frozen --no-sync python -c "from importlib.metadata import version; print('anyio version:', version('anyio'))" || echo "Failed with --frozen"
7877
7978
- name: Run pytest
80-
run: uv run --frozen --no-sync pytest
79+
run: uv run ${{ matrix.dep-resolution.name == 'lowest-direct' && '--no-sync' || '--frozen --no-sync' }} pytest
8180

8281
readme-snippets:
8382
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)