From 98d049407f626bd5ced0855b32359902f15b5b33 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Tue, 15 Oct 2024 17:53:19 -0700 Subject: [PATCH] Ignore sources in build requirements for non-source trees (#8235) ## Summary We shouldn't enforce sources when, e.g., you provide a `.tar.gz` file. Closes https://github.com/astral-sh/uv/issues/8236. --- crates/uv-distribution/src/source/mod.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/crates/uv-distribution/src/source/mod.rs b/crates/uv-distribution/src/source/mod.rs index 94e1d6ded012..a5492bdededc 100644 --- a/crates/uv-distribution/src/source/mod.rs +++ b/crates/uv-distribution/src/source/mod.rs @@ -473,7 +473,7 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> { source_dist_entry.path(), subdirectory, &cache_shard, - self.build_context.sources(), + SourceStrategy::Disabled, ) .await?; @@ -586,7 +586,7 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> { source, source_dist_entry.path(), subdirectory, - self.build_context.sources(), + SourceStrategy::Disabled, ) .boxed_local() .await? @@ -617,7 +617,7 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> { source_dist_entry.path(), subdirectory, &cache_shard, - self.build_context.sources(), + SourceStrategy::Disabled, ) .await?; @@ -775,7 +775,7 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> { source_entry.path(), None, &cache_shard, - self.build_context.sources(), + SourceStrategy::Disabled, ) .await?; @@ -862,12 +862,7 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> { // If the backend supports `prepare_metadata_for_build_wheel`, use it. if let Some(metadata) = self - .build_metadata( - source, - source_entry.path(), - None, - self.build_context.sources(), - ) + .build_metadata(source, source_entry.path(), None, SourceStrategy::Disabled) .boxed_local() .await? { @@ -905,7 +900,7 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> { source_entry.path(), None, &cache_shard, - self.build_context.sources(), + SourceStrategy::Disabled, ) .await?;