Skip to content
Myr

deprecate __version__ attribute

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parent a327751 · Browse files · 3 files+16 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+16 added−3 removed

  • other:+16 added−3 removed

3 files+16 added−3 removed

modified:src/click/__init__.py+13 added-2 removed
67 unmodified lines
68from .utils import get_binary_stream as get_binary_stream69from .utils import get_text_stream as get_text_stream70from .utils import open_file as open_file7172__version__ = "8.2.0.dev0"727473def __getattr__(name: str) -> object:74 import warnings7576 if name == "BaseCommand":
28 unmodified lines
105 stacklevel=2,106 )107 return _OptionParser108109 if name == "__version__":110 import importlib.metadata111 import warnings112113 warnings.warn(114 "The '__version__' attribute is deprecated and will be removed in"115 " Click 9.1. Use feature detection or"116 " 'importlib.metadata.version(\"click\")' instead.",117 DeprecationWarning,118 stacklevel=2,119 )120 return importlib.metadata.version("click")121122 raise AttributeError(name)
modified:CHANGES.rst+2 added
7 unmodified lines
8- Drop support for Python 3.7. :pr:`2588`9- Use modern packaging metadata with ``pyproject.toml`` instead of ``setup.cfg``.10 :pr:`326`11- Use ``flit_core`` instead of ``setuptools`` as build backend.12- Deprecate the ``__version__`` attribute. Use feature detection, or13 ``importlib.metadata.version("click")``, instead. :issue:`2598`14- ``BaseCommand`` is deprecated. ``Command`` is the base class for all15 commands. :issue:`2589`16- ``MultiCommand`` is deprecated. ``Group`` is the base class for all group17 commands. :issue:`2590`
1117 unmodified lines
modified:pyproject.toml+1 added-1 removed