Skip to content

Commit

Permalink
Remove manual seeding of cache
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Apr 15, 2024
1 parent c68e397 commit f7820ce
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 32 deletions.
8 changes: 0 additions & 8 deletions crates/uv-auth/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,10 @@ pub use keyring::KeyringProvider;
pub use middleware::AuthMiddleware;
use netloc::NetLoc;
use once_cell::sync::Lazy;
use url::Url;

// TODO(zanieb): Consider passing a cache explicitly throughout

/// Global authentication cache for a uv invocation
///
/// This is used to share credentials across uv clients.
pub(crate) static CREDENTIALS_CACHE: Lazy<CredentialsCache> = Lazy::new(CredentialsCache::default);

/// Populate the global authentication store with credentials on a URL, if there are any.
///
/// Returns `true` if the store was updated.
pub fn store_credentials_from_url(_url: &Url) -> bool {
true
}
6 changes: 0 additions & 6 deletions crates/uv/src/commands/pip_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use tracing::debug;
use distribution_types::{IndexLocations, LocalEditable, LocalEditables, Verbatim};
use platform_tags::Tags;
use requirements_txt::EditableRequirement;
use uv_auth::store_credentials_from_url;
use uv_cache::Cache;
use uv_client::{BaseClientBuilder, Connectivity, FlatIndexClient, RegistryClientBuilder};
use uv_configuration::KeyringProviderType;
Expand Down Expand Up @@ -211,11 +210,6 @@ pub(crate) async fn pip_compile(
let index_locations =
index_locations.combine(index_url, extra_index_urls, find_links, no_index);

// Add all authenticated sources to the store.
for url in index_locations.urls() {
store_credentials_from_url(url);
}

// Initialize the registry client.
let client = RegistryClientBuilder::new(cache.clone())
.native_tls(native_tls)
Expand Down
6 changes: 0 additions & 6 deletions crates/uv/src/commands/pip_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use pep508_rs::{MarkerEnvironment, Requirement};
use platform_tags::Tags;
use pypi_types::{Metadata23, Yanked};
use requirements_txt::EditableRequirement;
use uv_auth::store_credentials_from_url;
use uv_cache::Cache;
use uv_client::{
BaseClientBuilder, Connectivity, FlatIndexClient, RegistryClient, RegistryClientBuilder,
Expand Down Expand Up @@ -204,11 +203,6 @@ pub(crate) async fn pip_install(
let index_locations =
index_locations.combine(index_url, extra_index_urls, find_links, no_index);

// Add all authenticated sources to the store.
for url in index_locations.urls() {
store_credentials_from_url(url);
}

// Initialize the registry client.
let client = RegistryClientBuilder::new(cache.clone())
.native_tls(native_tls)
Expand Down
6 changes: 0 additions & 6 deletions crates/uv/src/commands/pip_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use install_wheel_rs::linker::LinkMode;
use platform_tags::Tags;
use pypi_types::Yanked;
use requirements_txt::EditableRequirement;
use uv_auth::store_credentials_from_url;
use uv_cache::{ArchiveTarget, ArchiveTimestamp, Cache};
use uv_client::{
BaseClientBuilder, Connectivity, FlatIndexClient, RegistryClient, RegistryClientBuilder,
Expand Down Expand Up @@ -151,11 +150,6 @@ pub(crate) async fn pip_sync(
let index_locations =
index_locations.combine(index_url, extra_index_urls, find_links, no_index);

// Add all authenticated sources to the store.
for url in index_locations.urls() {
store_credentials_from_url(url);
}

// Initialize the registry client.
let client = RegistryClientBuilder::new(cache.clone())
.native_tls(native_tls)
Expand Down
6 changes: 0 additions & 6 deletions crates/uv/src/commands/venv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use thiserror::Error;

use distribution_types::{DistributionMetadata, IndexLocations, Name, ResolvedDist};
use pep508_rs::Requirement;
use uv_auth::store_credentials_from_url;
use uv_cache::Cache;
use uv_client::{Connectivity, FlatIndexClient, RegistryClientBuilder};
use uv_configuration::KeyringProviderType;
Expand Down Expand Up @@ -144,11 +143,6 @@ async fn venv_impl(
// Extract the interpreter.
let interpreter = venv.interpreter();

// Add all authenticated sources to the store.
for url in index_locations.urls() {
store_credentials_from_url(url);
}

// Instantiate a client.
let client = RegistryClientBuilder::new(cache.clone())
.native_tls(native_tls)
Expand Down

0 comments on commit f7820ce

Please sign in to comment.