mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-22 08:12:44 +00:00
Treat missing top_level.txt
as non-fatal (#6881)
## Summary Closes https://github.com/astral-sh/uv/issues/6872.
This commit is contained in:
parent
0510842e1b
commit
fa1498396e
2 changed files with 47 additions and 2 deletions
|
@ -463,7 +463,15 @@ pub(crate) async fn install(
|
|||
install_wheel_rs::Error::MissingRecord(_),
|
||||
)) => {
|
||||
warn_user!(
|
||||
"Failed to uninstall package at {} due to missing RECORD file. Installation may result in an incomplete environment.",
|
||||
"Failed to uninstall package at {} due to missing `RECORD` file. Installation may result in an incomplete environment.",
|
||||
dist_info.path().user_display().cyan(),
|
||||
);
|
||||
}
|
||||
Err(uv_installer::UninstallError::Uninstall(
|
||||
install_wheel_rs::Error::MissingTopLevel(_),
|
||||
)) => {
|
||||
warn_user!(
|
||||
"Failed to uninstall package at {} due to missing `top-level.txt` file. Installation may result in an incomplete environment.",
|
||||
dist_info.path().user_display().cyan(),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -672,7 +672,7 @@ fn reinstall_incomplete() -> Result<()> {
|
|||
----- stderr -----
|
||||
Resolved 3 packages in [TIME]
|
||||
Prepared 1 package in [TIME]
|
||||
warning: Failed to uninstall package at [SITE_PACKAGES]/anyio-3.7.0.dist-info due to missing RECORD file. Installation may result in an incomplete environment.
|
||||
warning: Failed to uninstall package at [SITE_PACKAGES]/anyio-3.7.0.dist-info due to missing `RECORD` file. Installation may result in an incomplete environment.
|
||||
Uninstalled 1 package in [TIME]
|
||||
Installed 1 package in [TIME]
|
||||
- anyio==3.7.0
|
||||
|
@ -6455,3 +6455,40 @@ fn stale_egg_info() -> Result<()> {
|
|||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// `suds-community` has an incorrect layout whereby the wheel includes `suds_community.egg-info` at
|
||||
/// the top-level. We're then under the impression that `suds` is installed twice, but when we go to
|
||||
/// uninstall the second "version", we can't find the `egg-info` directory.
|
||||
#[test]
|
||||
fn missing_top_level() {
|
||||
let context = TestContext::new("3.12");
|
||||
|
||||
uv_snapshot!(context.filters(), context.pip_install()
|
||||
.arg("suds-community==0.8.5"), @r###"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
Resolved 1 package in [TIME]
|
||||
Prepared 1 package in [TIME]
|
||||
Installed 1 package in [TIME]
|
||||
+ suds-community==0.8.5
|
||||
"###
|
||||
);
|
||||
|
||||
uv_snapshot!(context.filters(), context.pip_install()
|
||||
.arg("suds-community==0.8.5"), @r###"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
|
||||
----- 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.
|
||||
Uninstalled 2 packages in [TIME]
|
||||
Installed 1 package in [TIME]
|
||||
~ suds-community==0.8.5
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue