From 57f56467d96f29ecfee219978a8e218ec361f317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Dahlgren?= Date: Sun, 19 Oct 2025 11:32:50 +0200 Subject: [PATCH] Fix typo in MissingTopLevel warning (#16351) ## Summary The warning shown when `egg-info` lacks `top_level.txt` incorrectly warns about missing `top-level.txt` https://github.com/astral-sh/uv/blob/ee2649feaa78b847ebcd44daebdce28c2e974842/crates/uv-install-wheel/src/uninstall.rs#L179-L188 https://github.com/astral-sh/uv/blob/ee2649feaa78b847ebcd44daebdce28c2e974842/crates/uv/src/commands/pip/operations.rs#L687-L693 The non fatal warning with incorrect filename was introduced in https://github.com/astral-sh/uv/pull/6881 which changed previous fatal error https://github.com/astral-sh/uv/issues/6872 with correct `top_level.txt` output. ## Test Plan Updated unit test to reflect change in warning --- crates/uv/src/commands/pip/operations.rs | 2 +- crates/uv/tests/it/pip_install.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/uv/src/commands/pip/operations.rs b/crates/uv/src/commands/pip/operations.rs index 118606ab8..5a50fe769 100644 --- a/crates/uv/src/commands/pip/operations.rs +++ b/crates/uv/src/commands/pip/operations.rs @@ -688,7 +688,7 @@ async fn execute_plan( uv_install_wheel::Error::MissingTopLevel(_), )) => { warn_user!( - "Failed to uninstall package at {} due to missing `top-level.txt` file. Installation may result in an incomplete environment.", + "Failed to uninstall package at {} due to missing `top_level.txt` file. Installation may result in an incomplete environment.", dist_info.install_path().user_display().cyan(), ); } diff --git a/crates/uv/tests/it/pip_install.rs b/crates/uv/tests/it/pip_install.rs index 1255a77a1..7f883c364 100644 --- a/crates/uv/tests/it/pip_install.rs +++ b/crates/uv/tests/it/pip_install.rs @@ -9019,7 +9019,7 @@ fn missing_top_level() { ----- stderr ----- Resolved 1 package in [TIME] - warning: Failed to uninstall package at [SITE_PACKAGES]/suds_community.egg-info due to missing `top-level.txt` file. Installation may result in an incomplete environment. + warning: Failed to uninstall package at [SITE_PACKAGES]/suds_community.egg-info due to missing `top_level.txt` file. Installation may result in an incomplete environment. Uninstalled 2 packages in [TIME] Installed 1 package in [TIME] ~ suds-community==0.8.5