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

Fail fast when use_2to3 is supplied. #2770

Merged
merged 1 commit into from
Sep 6, 2021
Merged

Conversation

jaraco
Copy link
Member

@jaraco jaraco commented Sep 6, 2021

Fixes #2769.

@@ -289,6 +289,10 @@ def assert_bool(dist, attr, value):
raise DistutilsSetupError(tmpl.format(attr=attr, value=value))


def invalid(dist, attr, value):
raise DistutilsSetupError(f"{attr} is invalid.")
Copy link
Member

Choose a reason for hiding this comment

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

@jaraco in the light of #2775, maybe this could at least be turned into

Suggested change
raise DistutilsSetupError(f"{attr} is invalid.")
if not value: # it's okay, if it's False
warnings.warn(f"Remove the {attr} setting from your packaging.")
return
raise DistutilsSetupError(f"{attr} is invalid.")

Copy link
Member Author

Choose a reason for hiding this comment

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

I originally was writing the function with this check, but then I wanted to make the "check" function suitable for any invalid value. I'll review the referenced bug and consider this proposal.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, it turned out more impactful on the scale than you've probably expected. Seems rather urgent.

@samdoran
Copy link

samdoran commented Sep 8, 2021

@jaraco Thank you for the fast and excellent fix. Much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Should fail hard when installing packages that want 2to3
3 participants