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

Adding deprecated to command and parameter decorators #526

Merged
merged 6 commits into from
Jan 24, 2025

Conversation

1maple1
Copy link
Contributor

@1maple1 1maple1 commented Jan 2, 2025

No description provided.

@1maple1 1maple1 requested a review from TheBurchLog January 2, 2025 15:29
@@ -473,6 +485,24 @@ def pre_shutdown(self):
return _wrapped


def deprecated(_wrapped=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

This will conflict with the python provided solution. Instead we need to inspect for this being set.
https://docs.python.org/3/library/warnings.html#warnings.deprecated

Copy link
Contributor Author

@1maple1 1maple1 Jan 3, 2025

Choose a reason for hiding this comment

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

Removed deprecated in favor of deprecated decorator in standard library.

Prior to 3.13: from typing_extensions import deprecated
Python 3.13 and later: from warnings import deprecated
@deprecated("Do not use")

@TheBurchLog
Copy link
Contributor

Could you add a unit test in this file to ensure things get marked as hidden and the flags are set:
https://github.com/beer-garden/brewtils/blob/parameter-deprecation/test/decorators_test.py

@1maple1 1maple1 merged commit dbdbd46 into develop Jan 24, 2025
6 checks passed
@1maple1 1maple1 deleted the parameter-deprecation branch January 24, 2025 13:54
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.

2 participants