Skip to content

ci: use uv.lock when running tests - #9214

Merged
lstein merged 7 commits into
invoke-ai:mainfrom
keturn:ci-uv-lock
Jun 11, 2026
Merged

ci: use uv.lock when running tests#9214
lstein merged 7 commits into
invoke-ai:mainfrom
keturn:ci-uv-lock

Conversation

@keturn

@keturn keturn commented May 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Given we run a "uv lock checks" workflow, I assume that means we intend uv.lock to be used.

The uv pip interface is a different thing than the rest of uv (sync, run, etc), it doesn't use uv.lock (but can use version constraints expressed in other ways). Use uv sync instead.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • ❗Changes to a redux slice have a corresponding migration
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

@github-actions github-actions Bot added the CI-CD Continuous integration / Continuous delivery label May 19, 2026
@keturn

keturn commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

All Checks Have Passed
python tests / py3.11: linux-cpu (pull_request) Successful in 31s

This is misleading because this doesn't change a python file, so it didn't actually run the python tests.

@lstein lstein added the 6.13.5 Library Updates label May 22, 2026
@lstein lstein moved this to 6.13.5 LIBRARY UPDATES in Invoke - Community Roadmap May 22, 2026

@JPPhoto JPPhoto left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. @keturn Any reason we don't use --frozen?

@keturn

keturn commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

Any reason we don't use --frozen?

--locked and --frozen are similar in that neither will change the lockfile, but --locked exits with an error if there was some change in dependencies that hasn't been reflected in the lockfile yet.

I figured --locked was more appropriate for CI, though one could argue it's redundant with the "uv lock checks" workflow and it only needs to be done in one of those places.

@lstein
lstein enabled auto-merge (squash) June 11, 2026 19:55
@lstein
lstein merged commit 837a877 into invoke-ai:main Jun 11, 2026
17 checks passed
lstein added a commit that referenced this pull request Jun 11, 2026
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>
@keturn
keturn deleted the ci-uv-lock branch June 16, 2026 13:50
dunkeroni pushed a commit to dunkeroni/InvokeAI that referenced this pull request Jun 29, 2026
Co-authored-by: Jonathan <34005131+JPPhoto@users.noreply.github.com>
Co-authored-by: Alexander Eichhorn <alex@eichhorn.dev>
Co-authored-by: Lincoln Stein <lincoln.stein@gmail.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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.13.5 Library Updates CI-CD Continuous integration / Continuous delivery

Projects

Status: 6.13.5 LIBRARY UPDATES

Development

Successfully merging this pull request may close these issues.

4 participants