Skip to content
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

Don't consider dist-info in a wheel as "installed" #11217

Merged

Conversation

uranusjr
Copy link
Member

This applies to the new importlib.metadata backend. The legacy pkg_resources backend already does this (albeit accidentally).

A package inside a wheel is not guaranteed to "work" when directly imported, so we should not treat it as an installed distribution.

This fixes #11183 on our side. Note that this new logic slightly differs from the pkg_resources implementation, which blindly ignores all entries with a .whl suffix, while we only ignore files that actually look like a valid wheel. This means that something named pip.whl will not be ignored by this logic.

This applies to the new importlib.metadata backend. The legacy
pkg_resources backend already does this (albeit accidentally).

A package inside a wheel is not guaranteed to "work" when directly
imported, so we should not treat it as an installed distribution.
@uranusjr uranusjr force-pushed the importlib-metadata-ignore-dist-info-in-wheel branch from 6eebf2b to 6eaa8e9 Compare June 30, 2022 13:49
@uranusjr uranusjr merged commit c260ecc into pypa:main Jul 1, 2022
@uranusjr uranusjr deleted the importlib-metadata-ignore-dist-info-in-wheel branch July 1, 2022 06:01
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ensurepip fails with importlib.metadata backend
3 participants