Repository navigation
Add support for customizing Astral mirror URLs #18525
Description
Activity
- addedenhancementNew feature or improvement to existing functionalityNew feature or improvement to existing functionality
on Mar 17, 2026 Some extra context:
- Current status of what's fetched from the mirror and what isn't is tracked under Fetch release assets from
releases.astral.shfirst #18503 - You can customize
UV_DOWNLOAD_URLwhen fetching uv using the standalone installer scripts, in which case the mirror won't be used - There's also
UV_INSTALLER_GITHUB_BASE_URLwhich apparentlyuv self updatealso respects - For Python downloads there's this setting that already controls the mirror URL, but I don't think there's an environment variable
- Fetching of Ruff isn't configurable at all at the moment
- Current status of what's fetched from the mirror and what isn't is tracked under Fetch release assets from
- addedarea:networkNetwork connectivity e.g. proxies, DNS, and SSLNetwork connectivity e.g. proxies, DNS, and SSLarea:configurationSettings and suchSettings and such
on Mar 17, 2026 Some extra context:
* Current status of what's fetched from the mirror and what isn't is tracked under [Fetch release assets from `releases.astral.sh` first #18503](https://github.com/astral-sh/uv/issues/18503) * You can customize [`UV_DOWNLOAD_URL`](https://docs.astral.sh/uv/reference/environment/#uv_download_url) when fetching uv using the standalone installer scripts, in which case the mirror won't be used * There's also [`UV_INSTALLER_GITHUB_BASE_URL`](https://docs.astral.sh/uv/reference/environment/#uv_installer_github_base_url) which apparently `uv self update` also respects * For Python downloads there's [this setting](https://docs.astral.sh/uv/reference/settings/#python-install-mirror) that already controls the mirror URL, but I don't think there's an environment variable * Fetching of Ruff isn't configurable at all at the momentThank you for the quick answer!
UV_DOWNLOAD_URLandUV_PYTHON_INSTALL_MIRRORcan be used to make it possible to install uv and CPython, but it remains impossible to run updates.UV_INSTALLER_GITHUB_BASE_URLcannot be used in environments without access to GitHub or GitHub Enterprise as the updater uses the GitHub REST API to fetch release metadata.Because
UV_DOWNLOAD_URLincludes the version to install and because there is no solution to makeuv self updatework in isolated environments, uv needs to be reinstalled regularly to keep up-to-date.I believe that #9134 (Sonatype Nexus Repository) and #16519 (JFrog Artifactory) are related and would be solved with the resolution of the current issue.
Congrats on completing #18503! It makes it easier to install the latest versions of uv. Now that everything (?) has been migrated to releases.astral.sh, do you believe that such configuration could be implemented?
An unmentioned issue with GitHub-related environment variables is that any path is stripped and only the domain name is kept. This makes sense but it makes it impossible to use with proxy repositories.
- added a commit that references this issue
on May 12, 2026 Thank you for your work on this, the new env var is very useful !
Would it be possible for the install script to support it as well ? It contains
if [ -n "${UV_DOWNLOAD_URL:-}" ]; then ARTIFACT_DOWNLOAD_URLS="$UV_DOWNLOAD_URL" elif [ -n "${INSTALLER_DOWNLOAD_URL:-}" ]; then ARTIFACT_DOWNLOAD_URLS="$INSTALLER_DOWNLOAD_URL" elif [ -n "${UV_INSTALLER_GHE_BASE_URL:-}" ]; then INSTALLER_BASE_URL="$UV_INSTALLER_GHE_BASE_URL" ARTIFACT_DOWNLOAD_URLS="${INSTALLER_BASE_URL}/astral-sh/uv/releases/download/0.11.14" elif [ -n "${UV_INSTALLER_GITHUB_BASE_URL:-}" ]; then INSTALLER_BASE_URL="$UV_INSTALLER_GITHUB_BASE_URL" ARTIFACT_DOWNLOAD_URLS="${INSTALLER_BASE_URL}/astral-sh/uv/releases/download/0.11.14" else ARTIFACT_DOWNLOAD_URLS="https://releases.astral.sh/github/uv/releases/download/0.11.14 https://github.com/astral-sh/uv/releases/download/0.11.14" fi
So there is no path to installing the latest version from a mirror
something in that vein:
ARTIFACT_DOWNLOAD_URLS="${UV_ASTRAL_MIRROR_URL:-https://releases.astral.sh}/github/uv/releases/download/0.11.14 https://github.com/astral-sh/uv/releases/download/0.11.14"would allow that
I don't fully understand why the existing env vars aren't enough for the standalone installer. Keep in mind that an installer is always tied to a particular version (the hashes of that version's binaries are embedded within the script).
Right, let me start by clarifying this is purely for convenience
I'm trying to give our users installation instructions similar to
curl -LsSf https://astral.sh/uv/install.sh | sh, in an environment whereastral.shcan't be reached directly. The goal is "install the latest version without knowing what the latest version number is".The latest installer is available at
https://releases.astral.sh/installers/uv/latest/uv-installer.sh, which is mirrored athttps://our-mirror.our-company.com/installers/uv/latest/uv-installer.shBut there is currently no variable we can set to make the installer pull the
uvbinaries for the latest version from our mirror - we need to either:- specify
ARTIFACT_DOWNLOAD_URLSwith the full URL, including the version (so this is no longer "whatever the latest version is" - use
sedor similar to replacehttps://releases.astral.shwithhttps://our-mirror.our-company.com, which seems a bit brittle
So reading
ARTIFACT_DOWNLOAD_URLSwould allow us to go from:curl -LsSf https://our-mirror.our-company.com/installers/uv/latest/uv-installer.sh | sed 's#https://releases.astral.sh#hhttps://our-mirror.our-company.com/astral#g' | sh
to
curl -LsSf https://our-mirror.our-company.com/installers/uv/latest/uv-installer.sh | shThis is a bit of an edge case, but might be worth considering for consistency with
UV_INSTALLER_GITHUB_BASE_URL/UV_INSTALLER_GHE_BASE_URL(both allow setting a base URL without specifying the version, but rely on the github releases API)- specify
Summary
Hello!
Following the introduction of an Astral mirror which is used to fetch Ruff release metadata, Ruff, CPython and uv itself, I was wondering whether it could be made possible to customize these URLs.
In isolated environments, access to github.com or releases.astral.sh might not permitted, and it is currently impossible to proxy requests to proxy repositories or internal mirrors. Thus, it is impossible to download Ruff using uv, uv cannot update itself, and the uv version must be provided explicitly when installing uv using its standalone installer.
I believe that adding support for customizing the base URL of the Astral mirror could solve these issues.
I know that the updater does not fetch uv release metadata and uv archives from an Astral mirror yet, but I believe that this is already on Astral's roadmap.
Design-wise, I believe that adding configuration support using a single environment variable would be enough.
Example
Considering that
UV_ASTRAL_MIRROR_URLcould be set to customize the base URL of the Astral mirror, it could be used as such: