Skip to content

Commit f4259f2

Browse files
fix: run pytest directly from venv for lowest-direct tests
The issue was that 'uv run' (even with --no-sync) was still interacting with the project configuration and potentially re-resolving packages. Solution: For lowest-direct tests, bypass uv run entirely and execute pytest directly from the venv: .venv/bin/pytest This ensures we use exactly what was installed by --resolution lowest-direct without any interference from uv's project management or lockfile validation. For highest tests, continue using 'uv run --frozen --no-sync pytest' which validates against the lockfile as intended. Github-Issue: #1325
1 parent 5b9f8ea commit f4259f2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/shared.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,13 @@ jobs:
7777
uv run --frozen --no-sync python -c "from importlib.metadata import version; print('anyio version:', version('anyio'))" || echo "Failed with --frozen"
7878
7979
- name: Run pytest
80-
run: uv run ${{ matrix.dep-resolution.name == 'lowest-direct' && '--no-sync' || '--frozen --no-sync' }} pytest
80+
shell: bash
81+
run: |
82+
if [ "${{ matrix.dep-resolution.name }}" == "lowest-direct" ]; then
83+
.venv/bin/pytest
84+
else
85+
uv run --frozen --no-sync pytest
86+
fi
8187
8288
readme-snippets:
8389
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)