From 73ad9f9a0780a80c7fccd058b88de07cf0f3fd14 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sat, 9 Nov 2024 20:59:00 -0500 Subject: [PATCH] Remove use of `resolution_environment` from `uv add` (#8979) ## Summary This should only be used in the pip commands; not clear how it ended up here. --- crates/uv/src/commands/project/add.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/crates/uv/src/commands/project/add.rs b/crates/uv/src/commands/project/add.rs index ceaa7798c..6a6f6753d 100644 --- a/crates/uv/src/commands/project/add.rs +++ b/crates/uv/src/commands/project/add.rs @@ -42,7 +42,6 @@ use crate::commands::pip::loggers::{ DefaultInstallLogger, DefaultResolveLogger, SummaryResolveLogger, }; use crate::commands::pip::operations::Modifications; -use crate::commands::pip::resolution_environment; use crate::commands::project::lock::LockMode; use crate::commands::project::{ init_script_python_requirement, validate_script_requires_python, ProjectError, ScriptPython, @@ -249,14 +248,8 @@ pub(crate) async fn add( let build_constraints = Constraints::default(); let build_hasher = HashStrategy::default(); let hasher = HashStrategy::default(); - let python_platform = None; - let python_version = None; let sources = SourceStrategy::Enabled; - // Determine the environment for the resolution. - let (tags, markers) = - resolution_environment(python_version, python_platform, target.interpreter())?; - // Add all authenticated sources to the cache. for index in settings.index_locations.allowed_indexes() { if let Some(credentials) = index.credentials() { @@ -268,7 +261,7 @@ pub(crate) async fn add( let client = RegistryClientBuilder::try_from(client_builder)? .index_urls(settings.index_locations.index_urls()) .index_strategy(settings.index_strategy) - .markers(&markers) + .markers(target.interpreter().markers()) .platform(target.interpreter().platform()) .build(); @@ -293,7 +286,7 @@ pub(crate) async fn add( let entries = client .fetch(settings.index_locations.flat_indexes().map(Index::url)) .await?; - FlatIndex::from_entries(entries, Some(&tags), &hasher, &settings.build_options) + FlatIndex::from_entries(entries, None, &hasher, &settings.build_options) }; // Create a build dispatch.