add UV_NO_GITHUB_FAST_PATH

This commit is contained in:
Jack O'Connor 2025-06-09 14:44:43 -07:00
parent f5382c010b
commit dc455bfc26
3 changed files with 12 additions and 0 deletions

View file

@ -12,6 +12,7 @@ use tracing::debug;
use uv_cache_key::{RepositoryUrl, cache_digest};
use uv_fs::LockedFile;
use uv_git_types::{GitHubRepository, GitOid, GitReference, GitUrl};
use uv_static::EnvVars;
use uv_version::version;
use crate::{Fetch, GitSource, Reporter};
@ -54,6 +55,10 @@ impl GitResolver {
url: &GitUrl,
client: ClientWithMiddleware,
) -> Result<Option<GitOid>, GitResolverError> {
if std::env::var_os(EnvVars::UV_NO_GITHUB_FAST_PATH).is_some() {
return Ok(None);
}
let reference = RepositoryReference::from(url);
// If the URL is already precise, return it.

View file

@ -727,4 +727,7 @@ impl EnvVars {
/// Equivalent to the `--project` command-line argument.
pub const UV_PROJECT: &'static str = "UV_PROJECT";
/// Disable GitHub-specific requests that allow uv to skip `git fetch` in some circumstances.
pub const UV_NO_GITHUB_FAST_PATH: &'static str = "UV_NO_GITHUB_FAST_PATH";
}

View file

@ -235,6 +235,10 @@ non-editable
Ignore `.env` files when executing `uv run` commands.
### `UV_NO_GITHUB_FAST_PATH`
Disable GitHub-specific requests that allow uv to skip `git fetch` in some circumstances.
### `UV_NO_INSTALLER_METADATA`
Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories.