-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
Raising a proper diagnostic here would be good. However, it may be better to detect and warn/error out on invalid metadata in a centralized manner. IMO we should start flagging missing or malformed installed distribution metadata more aggressively to A) provide context when pip inevitably crashes/misbehaves, and B) encourage standards compliance. Some issues to flag (which pip may be able to flag already or not) include:
- Missing core metadata fields (name, version)
- Mismatches between distribution metadata directory name and core metadata
- Invalid core metadata values -- this is likely just a matter of making sure whatever error
packagingraises is handled appropriately- Duplicate installations (indicated by duplicate
dist-infodirectories)1- Missing installation metadata files (
METADATA,RECORD)- Flagging incomplete uninstalls -- pip already warns on these invalid distributions, but it should notice the atypical prefix (
~or-IIRC?) and inform the user that it's likely an uninstall that failed midway through (and can be safely removed)This should probably be broken out into its own issue. If we agree this is worthwhile, of course.
Originally posted by @ichard26 in #13458
Footnotes
-
We can only warn if the duplicate installations are contained within the same import path. Overriding installations via
sys.pathordering can be and is done in practice (even pip's build isolation logic does it). ↩