Skip to content

Make uv run --no-sync still perform a lock - #19915

Open
Gankra wants to merge 1 commit into
mainfrom
gankra/implement-uv-run-followup
Open

Make uv run --no-sync still perform a lock#19915
Gankra wants to merge 1 commit into
mainfrom
gankra/implement-uv-run-followup

Conversation

@Gankra

@Gankra Gankra commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

This should hopefully be a straightforward port of #19909 to uv run.

Discussion needed on whether this is a breaking change or just a bug fix. The fact that this changes documented behaviour seems like a pretty straightforward break.

@Gankra Gankra added bug Something isn't working breaking A breaking change labels Jun 18, 2026
@zanieb

zanieb commented Jun 18, 2026

Copy link
Copy Markdown
Member

I think we could technically skip the lock unless --with is used, because otherwise we don't need to read anything from the lockfile and updating it has no effect on the command?

@zanieb

zanieb commented Jun 18, 2026

Copy link
Copy Markdown
Member

The assumption at

/// Implies `--frozen`, as the project dependencies will be ignored (i.e., the lockfile will not
/// be updated, since the environment will not be synced regardless).

is generally correct but we determined it's wrong for --with cases due to resolver preferences.

In uv check, since we need to read the ty version from the lock, the logic there does not hold.

@zsol

zsol commented Jun 18, 2026

Copy link
Copy Markdown
Member

I think I'd weakly prefer consistency and path of least surprise here: if we update the lock, we should do so both with --with and without --with, with the added caveat that we might be able to get away with falling back to an --isolated behavior (for the purposes of the lockfile) if the existing lockfile is outdated and we're using --with

@zanieb

zanieb commented Jun 18, 2026

Copy link
Copy Markdown
Member

I worry about doing unnecessary work in a hot command like uv run

@zanieb

zanieb commented Jun 18, 2026

Copy link
Copy Markdown
Member

(we could also do this staged: if it's scoped to --with, it's a bug fix, if it's broader, I think it's a breaking change)

@zsol

zsol commented Jun 19, 2026

Copy link
Copy Markdown
Member

I meant to suggest: the bug would also be fixed if we would update the lock in-memory without writing it when --with is passed. Then we don't need to change the behavior of uv run --no-sync without --with

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking A breaking change bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants