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

gh-121277: Raise nice error on next as second argument to deprecated-removed #124623

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Doc/tools/extensions/pyspecific.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,9 @@ def run(self):
version_deprecated = expand_version_arg(self.arguments[0],
self.config.release)
version_removed = self.arguments.pop(1)
if version_removed == 'next':
raise ValueError(
'deprecated-removed:: second argument cannot be `next`')
Comment on lines +291 to +293
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if version_removed == 'next':
raise ValueError(
'deprecated-removed:: second argument cannot be `next`')
if version_removed == 'next':
raise ValueError(
'deprecated-removed:: second argument should be the version in which '
'the API will be removed, and cannot be `next`')

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! But I do think it's too long, and I hope anyone who adds deprecated-removed:: already knows what the args are. If they need this error to find that out, something's very wrong :)

self.arguments[0] = version_deprecated, version_removed

# Set the label based on if we have reached the removal version
Expand Down
Loading