Skip to content

Resolve official uv self-update versions before axoupdater#18674

Merged
zsol merged 2 commits intomainfrom
zsol/jj-molomyntlmzo
Mar 23, 2026
Merged

Resolve official uv self-update versions before axoupdater#18674
zsol merged 2 commits intomainfrom
zsol/jj-molomyntlmzo

Conversation

@zsol
Copy link
Copy Markdown
Member

@zsol zsol commented Mar 23, 2026

This PR changes uv self update to use the uv.ndjson hosted at https://raw.githubusercontent.com/astral-sh/versions/main/v1/ to resolve the desired uv version.

This behavior change happens only if:

  • there are no override env vars in effect
  • the currently running uv was installed from the "official" place (i.e. the receipt says the binary is from github.com/astral-sh/uv)

Important

Because of the move to pep440 version specifiers, this means that uv self update 0.10 will now resolve to 0.10.0 instead of failing. This is consistent with uvx uv@0.10 behavior, but it isn't intuitive. We could consider failing such commands like before, but I chose consistency with uvx uv@0.10, because I'm planning to add version bounds (uv self update '<0.11') too, which would make it clearer that these are Python version strings.

Towards #18503.

Test Plan

Happy path:

❯ uv self update --dry-run -vv 0.10
DEBUG uv 0.10.12+12 (4bc25a1c0 2026-03-23 aarch64-apple-darwin)
info: Checking for updates...
DEBUG Using official public self-update path
DEBUG Using request connect timeout of 10s and read timeout of 30s
TRACE Handling request for https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson with authentication policy auto
TRACE Request for https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson is unauthenticated, checking cache
TRACE No credentials in cache for URL https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson
TRACE Attempting unauthenticated request for https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson
DEBUG Resolved self-update target to `uv==0.10.0`
Would update uv from v0.10.12 to v0.10.0

One of the many sad paths:

❯ uv self update --dry-run -vv 0.11
DEBUG uv 0.10.12+12 (4bc25a1c0 2026-03-23 aarch64-apple-darwin)
info: Checking for updates...
DEBUG Using official public self-update path
DEBUG Using request connect timeout of 10s and read timeout of 30s
TRACE Handling request for https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson with authentication policy auto
TRACE Request for https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson is unauthenticated, checking cache
TRACE No credentials in cache for URL https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson
TRACE Attempting unauthenticated request for https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson
TRACE Considering retry of error: NoMatchingVersion { binary: Uv, constraints: VersionSpecifiers([VersionSpecifier { operator: Equal, version: "0.11" }]), platform: "aarch64-apple-darwin" }
TRACE Cannot retry error: neither an IO error nor a reqwest error
TRACE Error trace: Failed to resolve uv version `0.11`

Caused by:
    No version of uv found matching `==0.11` for platform `aarch64-apple-darwin`
error: Failed to resolve uv version `0.11`
  Caused by: No version of uv found matching `==0.11` for platform `aarch64-apple-darwin`

@zsol zsol force-pushed the zsol/jj-molomyntlmzo branch from 4bc25a1 to 3a51035 Compare March 23, 2026 17:51
@zsol zsol marked this pull request as ready for review March 23, 2026 18:08
@zanieb
Copy link
Copy Markdown
Member

zanieb commented Mar 23, 2026

We might want to continue to ban uv self update 0.10 such that we can have it support wildcard patch version semantics in the future. Adding consistency with uvx will limit our future decisions.

@zanieb
Copy link
Copy Markdown
Member

zanieb commented Mar 23, 2026

Generally, the .0 version expansion only makes sense with >= and ==, etc. it doesn't really make sense with our @<version> user experience.

@zsol
Copy link
Copy Markdown
Member Author

zsol commented Mar 23, 2026

Alright, I'll add a check that ensures the version number roundtrips cleanly (to_string(parse(input)) == input), that should ban the version expansions for now.

@zsol zsol force-pushed the zsol/jj-molomyntlmzo branch from e514256 to d884aa8 Compare March 23, 2026 19:32
@zsol zsol enabled auto-merge (squash) March 23, 2026 19:35
@zsol zsol disabled auto-merge March 23, 2026 19:37
@zsol zsol force-pushed the zsol/jj-molomyntlmzo branch from d884aa8 to e8f3afe Compare March 23, 2026 19:43
@zsol zsol enabled auto-merge (squash) March 23, 2026 19:44
@zsol zsol merged commit e280625 into main Mar 23, 2026
54 checks passed
@zsol zsol deleted the zsol/jj-molomyntlmzo branch March 23, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants