Move parsing http retries to EnvironmentOptions (#16284)
## Summary - Move parsing `UV_HTTP_RETRIES` to `EnvironmentOptions` Relates https://github.com/astral-sh/uv/issues/14720 ## Test Plan - Tests with existing tests
This commit is contained in:
@@ -5,11 +5,10 @@ use std::str::FromStr;
|
||||
|
||||
use indexmap::IndexMap;
|
||||
use ref_cast::RefCast;
|
||||
use reqwest_retry::policies::ExponentialBackoff;
|
||||
use tracing::{debug, info};
|
||||
|
||||
use uv_cache::Cache;
|
||||
use uv_client::{BaseClientBuilder, retries_from_env};
|
||||
use uv_client::BaseClientBuilder;
|
||||
use uv_pep440::{Prerelease, Version};
|
||||
use uv_platform::{Arch, Libc, Os, Platform};
|
||||
use uv_preview::Preview;
|
||||
@@ -231,8 +230,7 @@ impl PythonInstallation {
|
||||
|
||||
// Python downloads are performing their own retries to catch stream errors, disable the
|
||||
// default retries to avoid the middleware from performing uncontrolled retries.
|
||||
let retry_policy =
|
||||
ExponentialBackoff::builder().build_with_max_retries(retries_from_env()?);
|
||||
let retry_policy = client_builder.retry_policy();
|
||||
let client = client_builder.clone().retries(0).build();
|
||||
|
||||
info!("Fetching requested Python...");
|
||||
|
||||
Reference in New Issue
Block a user