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

deprecate base classes BaseCommand and MultiCommand #2591

Merged
merged 3 commits into from
Aug 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
deprecate MultiCommand
  • Loading branch information
davidism committed Aug 19, 2023
commit 9e0d0b26d9c2e149d909dc70c91d1fee5a185cfd
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Unreleased
- Use ``flit_core`` instead of ``setuptools`` as build backend.
- ``BaseCommand`` is deprecated. ``Command`` is the base class for all
commands. :issue:`2589`
- ``MultiCommand`` is deprecated. ``Group`` is the base class for all group
commands. :issue:`2590`


Version 8.1.7
Expand Down
12 changes: 11 additions & 1 deletion src/click/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from .core import CommandCollection as CommandCollection
from .core import Context as Context
from .core import Group as Group
from .core import MultiCommand as MultiCommand
from .core import Option as Option
from .core import Parameter as Parameter
from .decorators import argument as argument
Expand Down Expand Up @@ -86,4 +85,15 @@ def __getattr__(name: str) -> object:
)
return _BaseCommand

if name == "MultiCommand":
from .core import _MultiCommand

warnings.warn(
"'MultiCommand' is deprecated and will be removed in Click 9.0. Use"
" 'Group' instead.",
DeprecationWarning,
stacklevel=2,
)
return _MultiCommand

raise AttributeError(name)
Loading