-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
The problem
Currently, in order to use the feature of uv
to fetch Python versions (uv python install
), in internal and air-gapped networks,
one needs to
- download all the needed binaries (using https://github.com/astral-sh/uv/blob/main/scripts/create-python-mirror.py )
- then get the resulting folder (14~ GB for a single
uv
version) to the target network - depending on the organization it may be a complicated stage, that is very hard (or even impossible) to automate - and serve it to everyone else in the target network.
a process that may take hours.
The big issue is that the paths of the CPython binaries are hardcoded in the binary and change almost every release of uv
. Thus, the one who maintains the mirror must go through that process frequently, or else the feature of uv python install
will break when updating the uv version locally.
(see https://github.com/astral-sh/uv/commits/main/crates/uv-python/download-metadata.json for the frequency)
Suggested solution
instead of hardcoded URLs, fetch the json externally.
I think that one way of solving this issue is, instead of hardcoding the list of URLs in the binary, you can fetch the list (json) https://github.com/astral-sh/uv/blob/main/crates/uv-python/download-metadata.json
from external URL (probably from the repo), letting you update the available python binaries versions without the need to update uv
, and let the users change the URL the binary uses to fetch the JSON (https://github.com/astral-sh/uv/blob/main/crates/uv-python/download-metadata.json), so it will work for every version of uv
, and if you update your list, we can download and update it in the target network later without consequences.