RocketPy icon indicating copy to clipboard operation
RocketPy copied to clipboard

MNT: Implement a @deprecated decorator

Open Gui-FernandesBR opened this issue 1 year ago • 2 comments

The @deprecated decorator is used to mark functions or methods as deprecated, indicating that they will be removed in future versions. This helps in managing deprecations and informing users of the codebase about outdated functionalities. This could help us to organize the code and manage deprecations.

Basic Implementation Steps:

  • [ ] Create a decorator function named deprecated.
  • [ ] The decorator should issue a warning when the decorated function is called, indicating that it is deprecated.
  • [ ] Include a message or version information in the warning to provide more context.
  • [ ] Search in the code any deprecation messages and use the decorator you created.

OBS.: Please be aware of 2 different status we may have:

  • 1: The method is already deprecated.
  • 2: The method is set to be deprecated in a future version (this happens when we want to deprecate something, but we are obligated to give users some time ahead).

Gui-FernandesBR avatar Aug 19 '24 02:08 Gui-FernandesBR

Just wanted to inform that this feature has been added to python 3.13. More info here: https://peps.python.org/pep-0702/

LUCKIN13 avatar Nov 21 '24 00:11 LUCKIN13

Just wanted to inform that this feature has been added to python 3.13. More info here: https://peps.python.org/pep-0702/

Thank you!

It will take us 4 years from now until we are finally able to drop support for python 3.12, therefore, I see this issue with less priority, but if someone wants to implement a "brute force" version of the deprecator, that would also be welcome.

Gui-FernandesBR avatar Nov 21 '24 00:11 Gui-FernandesBR