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.
This commit is contained in:
Charlie Marsh 2024-11-09 20:59:00 -05:00 committed by GitHub
parent dac8c41af6
commit 73ad9f9a07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 9 deletions

View File

@ -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.