Respect constraints passed in uv tool install --from (#4563)

I accidentally trimmed this to just the `requirement.name`
This commit is contained in:
Zanie Blue 2024-06-26 16:32:13 -04:00 committed by GitHub
parent b44c47fdab
commit 909b69dfa2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -78,13 +78,13 @@ pub(crate) async fn install(
false
};
let requirements = [Requirement::from_str(from.name.as_ref())]
let requirements = [Ok(from.clone())]
.into_iter()
.chain(with.iter().map(|name| Requirement::from_str(name)))
.collect::<Result<Vec<Requirement<VerbatimParsedUrl>>, _>>()?;
// TODO(zanieb): Duplicative with the above parsing but needed for `update_environment`
let requirements_sources = [RequirementsSource::from_package(from.name.to_string())]
let requirements_sources = [RequirementsSource::from_package(from.to_string())]
.into_iter()
.chain(with.into_iter().map(RequirementsSource::from_package))
.collect::<Vec<_>>();