Skip to content

🐛 fix(lock): use bundled uv binary for uv sync#292

Merged
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:fix/required-version-warning
Feb 23, 2026
Merged

🐛 fix(lock): use bundled uv binary for uv sync#292
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:fix/required-version-warning

Conversation

@gaborbernat
Copy link
Copy Markdown
Member

When a project sets tool.uv.required-version in pyproject.toml and the system-installed uv is older than that constraint, uv sync in the lock runner fails with Required uv version does not match the running version. 🐛 This happens because the lock runner invokes a bare "uv" string that gets resolved via PATH to the system binary, while all other commands (uv venv, uv pip install, uv pip freeze) already use self.uv which resolves to the bundled binary from find_uv_bin().

The fix aligns uv sync with every other uv invocation by using self.uv instead of a hardcoded string. This ensures the bundled uv version (which tox-uv pins as a dependency) is always used, avoiding version mismatches with required-version constraints.

No behavioral change for users whose system uv matches or exceeds the bundled version. Users who previously hit this error no longer need to manually update their system uv.

Fixes #239

When a system-installed uv is older than the project's
`tool.uv.required-version`, `uv sync` fails because the lock runner
was invoking a bare `"uv"` string resolved via PATH rather than the
bundled binary from `find_uv_bin()`.

All other commands (`uv venv`, `uv pip install`, `uv pip freeze`)
already use `self.uv` which returns the bundled path. Aligning
`uv sync` to do the same ensures version consistency.

Fixes tox-dev#239
@gaborbernat gaborbernat added the bug Something isn't working label Feb 23, 2026
@gaborbernat gaborbernat merged commit c9a78a1 into tox-dev:main Feb 23, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tox-uv fails at uv sync when system uv is older than minimal required version

1 participant