Skip to content

Fail fast when use_2to3 is supplied.#2770

Merged
jaraco merged 1 commit intomainfrom
bugfix/2769-fail-fast-2to3
Sep 6, 2021
Merged

Fail fast when use_2to3 is supplied.#2770
jaraco merged 1 commit intomainfrom
bugfix/2769-fail-fast-2to3

Conversation

@jaraco
Copy link
Copy Markdown
Member

@jaraco jaraco commented Sep 6, 2021

Fixes #2769.



def invalid(dist, attr, value):
raise DistutilsSetupError(f"{attr} is invalid.")
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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