-
Notifications
You must be signed in to change notification settings - Fork 192
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
CLI: Deprecate the deprecated_command
decorator
#6461
CLI: Deprecate the deprecated_command
decorator
#6461
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6461 +/- ##
==========================================
+ Coverage 77.51% 77.73% +0.23%
==========================================
Files 560 561 +1
Lines 41444 41724 +280
==========================================
+ Hits 32120 32432 +312
+ Misses 9324 9292 -32 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also replace the one in the cmd_database
? There it was where I was not sure if should remove commands, because at least one is saying to be removed with v2.1
(aiida-dev) alexgo@fw:~/code/aiida-core/src/aiida/cmdline(fix/verdi-update-deprecation-method)$ rg 'deprecated.command'
utils/echo.py <-- can be ignored
187: This should be used to indicate deprecated commands.
utils/decorators.py <-- can be ignored
242:def deprecated_command(message):
248: @deprecated_command('This command has been deprecated in AiiDA v1.0, please use 'foo' instead.)
257: warn_deprecation('The `deprecated_command` decorator is deprecated', version=3)
commands/cmd_database.py
27:@decorators.deprecated_command(
43:@decorators.deprecated_command(
76:@decorators.deprecated_command(
97:@decorators.deprecated_command(
110:@decorators.deprecated_command(
122:@decorators.deprecated_command(
Ironicallly, this decorator itself has been deprecated. ``verdi`` commands that should be deprecated should simply | ||
use the ``deprecated`` argument in the ``command`` decorator and specify the deprecation message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we put this into a sphinx deprecation decorator?
Ironicallly, this decorator itself has been deprecated. ``verdi`` commands that should be deprecated should simply | |
use the ``deprecated`` argument in the ``command`` decorator and specify the deprecation message. | |
.. deprecated:: 2.6 | |
Ironicallly, this decorator itself has been deprecated. ``verdi`` commands that should be deprecated should simply | |
use the ``deprecated`` argument in the ``command`` decorator and specify the deprecation message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
I am actually removing that one entirely. See #6461 I think that command was a bit of an outlier since it was the only one deprecated when we released v2.0. Nowadays, when we deprecate, we default to it being removed to 3.0. If we want to change this policy, I think that would require a separate discussion. |
In an ironic turn of events, the `deprecated_command` decorator is itself deprecated. The current way of deprecating `verdi` commands is by passing the deprecation message in the `deprecated` argument in the `command` decorator when the command is declared. New functionality in `VerdiCommandGroup` then ensures that a deprecation message is printed when the command is invoked and the help text is updated accordingly.
7d50aaf
to
fd5ec5b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
In an ironic turn of events, the `deprecated_command` decorator is itself deprecated. The current way of deprecating `verdi` commands is by passing the deprecation message in the `deprecated` argument in the `command` decorator when the command is declared. New functionality in `VerdiCommandGroup` then ensures that a deprecation message is printed when the command is invoked and the help text is updated accordingly.
In an ironic turn of events, the
deprecated_command
decorator is itself deprecated. The current way of deprecatingverdi
commands is by passing the deprecation message in thedeprecated
argument in thecommand
decorator when the command is declared. New functionality inVerdiCommandGroup
then ensures that a deprecation message is printed when the command is invoked and the help text is updated accordingly.