mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
add UV_NO_GITHUB_FAST_PATH
This commit is contained in:
parent
f5382c010b
commit
dc455bfc26
3 changed files with 12 additions and 0 deletions
|
@ -12,6 +12,7 @@ use tracing::debug;
|
||||||
use uv_cache_key::{RepositoryUrl, cache_digest};
|
use uv_cache_key::{RepositoryUrl, cache_digest};
|
||||||
use uv_fs::LockedFile;
|
use uv_fs::LockedFile;
|
||||||
use uv_git_types::{GitHubRepository, GitOid, GitReference, GitUrl};
|
use uv_git_types::{GitHubRepository, GitOid, GitReference, GitUrl};
|
||||||
|
use uv_static::EnvVars;
|
||||||
use uv_version::version;
|
use uv_version::version;
|
||||||
|
|
||||||
use crate::{Fetch, GitSource, Reporter};
|
use crate::{Fetch, GitSource, Reporter};
|
||||||
|
@ -54,6 +55,10 @@ impl GitResolver {
|
||||||
url: &GitUrl,
|
url: &GitUrl,
|
||||||
client: ClientWithMiddleware,
|
client: ClientWithMiddleware,
|
||||||
) -> Result<Option<GitOid>, GitResolverError> {
|
) -> 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);
|
let reference = RepositoryReference::from(url);
|
||||||
|
|
||||||
// If the URL is already precise, return it.
|
// If the URL is already precise, return it.
|
||||||
|
|
|
@ -727,4 +727,7 @@ impl EnvVars {
|
||||||
|
|
||||||
/// Equivalent to the `--project` command-line argument.
|
/// Equivalent to the `--project` command-line argument.
|
||||||
pub const UV_PROJECT: &'static str = "UV_PROJECT";
|
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";
|
||||||
}
|
}
|
||||||
|
|
|
@ -235,6 +235,10 @@ non-editable
|
||||||
|
|
||||||
Ignore `.env` files when executing `uv run` commands.
|
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`
|
### `UV_NO_INSTALLER_METADATA`
|
||||||
|
|
||||||
Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories.
|
Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue