Skip to content

Try and fetch manifest from astral-sh/setup-uv@main first#739

Open
zsol wants to merge 2 commits intomainfrom
zsol/jj-uqymlkmxvtzz
Open

Try and fetch manifest from astral-sh/setup-uv@main first#739
zsol wants to merge 2 commits intomainfrom
zsol/jj-uqymlkmxvtzz

Conversation

@zsol
Copy link
Member

@zsol zsol commented Jan 22, 2026

This PR makes setup-uv fetch the version manifests straight from https://raw.githubusercontent.com/astral-sh/setup-uv/main/version-manifest.json first, before falling back to the locally bundled version of that file.

Notably, we no longer use GitHub APIs to fetch version information, which fixes #325.

Note

This is a stopgap to fix #325 and give time to polish something more sophisticated like #737

Test plan

https://github.com/zsol/test-setup-uv/actions/runs/21246431004 runs this branch of the action in various scenarios (shamelessly stolen from @zanieb, thank you :) )

@zsol zsol marked this pull request as ready for review January 22, 2026 11:37
@zsol zsol requested a review from eifinger as a code owner January 22, 2026 11:37
@zsol zsol requested a review from zanieb January 22, 2026 11:37
"https://raw.githubusercontent.com/astral-sh/setup-uv/main/version-manifest.json";

// Cache for manifest entries to avoid re-fetching
const manifestCache = new Map<string, ManifestEntry[]>();
Copy link
Collaborator

Choose a reason for hiding this comment

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

When would this become useful? We are determining the desired version only once.

async function getAvailableVersions(githubToken: string): Promise<string[]> {
core.info("Getting available versions from GitHub API...");
async function getAvailableVersions(): Promise<string[]> {
// 1. Try remote manifest first (no rate limits, always current)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This would remove the fallback to GitHub and treat the manifest on the main branch as the source of truth.
The problem with that is that the manifest is manually updated by me merging (automated) PRs. It could be out of date when a new uv version is released and I have not yet merged the PR for it.
Determining the latest version or the greatest matching a version spec would behave differently then a user would expect.

We would first need to this repo to be automatically updated like https://github.com/astral-sh/uv-pre-commit/
The support is already there:

repository_dispatch:
types: [ pypi_release ]

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.

Error: API rate limit exceeded

2 participants