ci: run pytest via uv run to fix venv PATH breakage from #9214 - #9286
Merged
Merged
Conversation
PR #9214 switched dependency installation from 'uv pip install' (which honored UV_SYSTEM_PYTHON=1 and installed into the system Python) to 'uv sync', which always installs into a project-local .venv. The bare 'pytest' invocation in the next step never saw that venv, failing with 'pytest: command not found' (exit 127) on every matrix job. - Run pytest via 'uv run --no-sync pytest'. The --no-sync flag is required: a plain 'uv run' would re-sync without '--extra test' and uninstall pytest before running it. - Drop UV_SYSTEM_PYTHON=1, which is dead config now that nothing uses the 'uv pip' interface. - Drop the actions/setup-python step; setup-uv is already given the matrix python-version and uv sync provisions its own interpreter. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
dunkeroni
pushed a commit
to dunkeroni/InvokeAI
that referenced
this pull request
Jun 29, 2026
PR invoke-ai#9214 switched dependency installation from 'uv pip install' (which honored UV_SYSTEM_PYTHON=1 and installed into the system Python) to 'uv sync', which always installs into a project-local .venv. The bare 'pytest' invocation in the next step never saw that venv, failing with 'pytest: command not found' (exit 127) on every matrix job. - Run pytest via 'uv run --no-sync pytest'. The --no-sync flag is required: a plain 'uv run' would re-sync without '--extra test' and uninstall pytest before running it. - Drop UV_SYSTEM_PYTHON=1, which is dead config now that nothing uses the 'uv pip' interface. - Drop the actions/setup-python step; setup-uv is already given the matrix python-version and uv sync provisions its own interpreter. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #9214 switched the python-tests workflow's install step from
uv pip install --editable ".[test]"touv sync --no-progress --locked --extra test. This broke every pytest matrix job with:(Visible on PR #9246's CI; only one job shows the error — the rest report "canceled" because the matrix's default fail-fast kills them once the first fails.)
Root cause
The old
uv pip installhonoredUV_SYSTEM_PYTHON: 1and installed into the runner's system Python, puttingpyteston thePATH.uv syncis a project command — it always installs into a project-local.venvand ignoresUV_SYSTEM_PYTHON— so the barepytestinvocation in the next step never sees the synced environment.Fix
uv run --no-sync pytest. The--no-syncflag matters: a plainuv run pytestwould first re-sync the environment without--extra test, uninstalling pytest right before trying to run it.UV_SYSTEM_PYTHON: 1— dead config now that nothing in the job uses theuv pipinterface.actions/setup-pythonstep —setup-uvis already given the matrixpython-version, anduv syncprovisions its own interpreter.Related Issues / Discussions
QA Instructions
Note that this PR's own pull_request CI run skips the pytest steps (no python files changed, and the
changed-filesfilter only matchespyproject.toml/invokeai/**/tests/**), so a green check there is vacuous. To exercise the fix for real, aworkflow_dispatchrun withalways_run=truewas triggered on this branch: https://github.com/invoke-ai/InvokeAI/actions/runs/27374428547 — all six matrix jobs should reach pytest and pass.Merge Plan
Straight merge. Unblocks CI for all open PRs touching python files.
Checklist
🤖 Generated with Claude Code