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:
Andrei Berenda
2025-10-21 13:14:37 +04:00
committed by GitHub
parent 29cec24d5c
commit 51e8da2d1c
19 changed files with 123 additions and 91 deletions
+2 -4
View File
@@ -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...");