fix: deprecate ScrapyCommand.help() which is never called

The help() method claimed it would be displayed by the 'help' command,
but that command doesn't exist and the method is never invoked by the
framework. Added deprecation warning so subclasses use long_desc() instead.
This commit is contained in:
十二月作曲家 2026-06-18 17:48:54 +08:00
parent fada8be1db
commit cb28d74867
1 changed files with 12 additions and 0 deletions

View File

@ -71,7 +71,19 @@ class ScrapyCommand(ABC):
"""An extensive help for the command. It will be shown when using the
"help" command. It can contain newlines since no post-formatting will
be applied to its contents.
.. deprecated::
This method is never called by the framework. Use ``long_desc()``
instead. Will be removed in Scrapy 2.15.
"""
import warnings
warnings.warn(
"ScrapyCommand.help() is deprecated and never called by the framework. "
"
"Use long_desc() instead.",
DeprecationWarning,
stacklevel=2,
)
return self.long_desc()
def add_options(self, parser: argparse.ArgumentParser) -> None: