-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Warnings for skipped <pkg>.dist-info
are unclear when METADATA
file is missing
#12446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I would like to work on this if it is still open |
Is it fixed? If it's not, I would love to contribute on it:) |
No PR linked so I assume this is open. Feel free. |
Fixes pypa#12446 Update the warning message for missing `METADATA` file in dist-info directories. * Update the warning message in `src/pip/_internal/metadata/importlib/_compat.py` to differentiate between a missing `METADATA` file and other metadata issues. * Add a check for the existence of the `METADATA` file in the `get_dist_canonical_name` function. * Add a test case in `tests/functional/test_list.py` to verify the new warning message for a missing `METADATA` file. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/pypa/pip/issues/12446?shareId=XXXX-XXXX-XXXX-XXXX).
I have been doing testing as part of pull request #13402. The reproducer in the ticket contains an invalid .dist-info directory name (missing the version), and I can't reproduce the problem using a properly formatted .dist-info name, even if the METADATA file is missing. Unless someone can provide an example of why we should expect to encounter invalid .dist-info directories, I am inclined to close my PR, as I think the error message as it exists is valid. |
Uh oh!
There was an error while loading. Please reload this page.
Description
When you uninstall a package with extra files (as described in #12445) you can end up in a bad state where
pip
warns due to the existence of an invaliddist-info
directory e.g.However, this warning is shown in cases where there is no METADATA file at all and it's not clear how to resolve this as a user.
Expected behavior
Instead of suggesting that the metadata has an invalid 'name', the warning should suggest that the dist-info is invalid
Perhaps there's even a better user experience to be had here? Curious to hear others' thoughts.
pip version
23.3.2
Python version
3.11.4
OS
macOS
How to Reproduce
Here, we construct a bad dist-info entry manually though a user can get in this state accidentally without editing
site-packages
.Output
Code of Conduct
The text was updated successfully, but these errors were encountered: