python / importlib_metadata

Library to access metadata for Python packages
https://importlib-metadata.readthedocs.io
Apache License 2.0
123 stars 80 forks source link

Fix .files and inferred packages_distributions for .egg-info packages #437

Closed jherland closed 1 year ago

jherland commented 1 year ago

The first three commits fix #115 for the case where a .egg-info package includes installed-files.txt: We prefer installed-files.txt over SOURCES.txt as a source for Distribution.files, as the former is deemed more accurate when it is available.

The last two commits attempts to fix #115 for the case where we have no choice but to parse SOURCES.txt: This assumes that Distribution.files should never contain a path to a non-existent file. We simply remove non-existent files with a filter, thus removing any entries from SOURCES.txt that refer to files that were part of the source package, but not part of the final installation.

Commits:

jherland commented 1 year ago

Thanks for the review @FFY00. I took a look at the failing tests. The 3.12 failures seem related to #436, and the other three are cases of #434/#435.

FFY00 commented 1 year ago

Yep. I am just gonna wait a couple days to give Jason a bit more time to review, otherwise I'll just merge the fixes, unblocking this PR.