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

Canonicalize name in check_if_exists #8659

Merged
merged 1 commit into from
Aug 2, 2020

Conversation

uranusjr
Copy link
Member

The previous implementation uses both pkg_resources.get_distribution() and pip’s own get_distribution(), use different name canonicalisation logic. This patch makes InstallRequirement.check_if_exists() only use pip's
own get_distribution() so different package name forms are matched as expected.

Fix #8645.

The previous implementation uses pkg_resources.get_distribution(), which
does not canonicalize the package name correctly, and fails when
combined with pip's own get_distribution(), which does canonicalize
names. This makes InstallRequirement.check_if_exists() only use pip's
own canonicalization logic so different package name forms are matched
as expected.
@deveshks
Copy link
Contributor

Thanks for this. Noting here that this will also close #8550

@pradyunsg pradyunsg added this to the 20.2 milestone Jul 30, 2020
@uranusjr uranusjr closed this Jul 30, 2020
@uranusjr uranusjr reopened this Jul 30, 2020
Copy link
Member

@sbidoul sbidoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change LGTM, and tested with the reproducer. Thanks @uranusjr

@pradyunsg pradyunsg merged commit e51a027 into pypa:master Aug 2, 2020
@pradyunsg pradyunsg modified the milestones: 20.2, 20.2.1 Aug 2, 2020
pradyunsg added a commit to pradyunsg/pip that referenced this pull request Aug 4, 2020
…n-name

Canonicalize name in check_if_exists
@uranusjr uranusjr deleted the fix-get-distribution-dot-in-name branch September 28, 2020 14:28
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 9, 2021
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.

Error checking if package with dotted name is installed (pip==20.2)
4 participants