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

fix non-canonical names don't work with provisioning #1360

Merged
merged 1 commit into from
Jul 1, 2019
Merged

fix non-canonical names don't work with provisioning #1360

merged 1 commit into from
Jul 1, 2019

Conversation

gaborbernat
Copy link
Member

@gaborbernat gaborbernat commented Jul 1, 2019

Resolves #1359

@@ -1161,7 +1161,7 @@ def ensure_requires_satisfied(config, requires, min_version):
# noinspection PyBroadException
try:
package = requirements.Requirement(require)
package_name = canonicalize_name(package.name)
package_name = package.name
if package_name not in exists:
deps.append(DepConfig(require, None))
exists.add(package_name)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the exists set still needs canonicalization -- but the dist does not (?). The intention here was to use the canonicalization as a deduping mechanims (essentially what pkg_resources.Requirement.key was doing in tox 1.12) and it looks like I goofed and passed that to distribution(...) -- I think the minimal patch is to change the distribution call from package_name to package.name (1 character change)

Copy link
Member Author

Choose a reason for hiding this comment

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

well we still need tests to validate and it's nice to break infinite loop provisioning, so a bit more characters 😄 but yeah what you say can work 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

oh yeah of course :D

Copy link
Contributor

@asottile asottile left a comment

Choose a reason for hiding this comment

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

@gaborbernat gaborbernat merged commit e2ae954 into tox-dev:master Jul 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

non canonical names within requires break provisining
2 participants