From b7d47a555eecc27a7247ecc6929cf27364a171ff Mon Sep 17 00:00:00 2001 From: Ruben Arts Date: Thu, 1 Aug 2024 15:36:41 +0200 Subject: [PATCH] fix: ignore pypi logic on non pypi projects (#1705) fixes #1702 Co-authored-by: Tim de Jager --- src/cli/list.rs | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/cli/list.rs b/src/cli/list.rs index d57f91f4a..3bc382076 100644 --- a/src/cli/list.rs +++ b/src/cli/list.rs @@ -142,19 +142,23 @@ pub async fn execute(args: Args) -> miette::Result<()> { let uv_context; let index_locations; let mut registry_index = if let Some(python_record) = python_record { - uv_context = UvResolutionContext::from_project(&project)?; - index_locations = pypi_options_to_index_locations(&environment.pypi_options()); - tags = get_pypi_tags( - platform, - &environment.system_requirements(), - python_record.package_record(), - )?; - Some(RegistryWheelIndex::new( - &uv_context.cache, - &tags, - &index_locations, - &uv_types::HashStrategy::None, - )) + if environment.has_pypi_dependencies() { + uv_context = UvResolutionContext::from_project(&project)?; + index_locations = pypi_options_to_index_locations(&environment.pypi_options()); + tags = get_pypi_tags( + platform, + &environment.system_requirements(), + python_record.package_record(), + )?; + Some(RegistryWheelIndex::new( + &uv_context.cache, + &tags, + &index_locations, + &uv_types::HashStrategy::None, + )) + } else { + None + } } else { None };