summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lord <davidism@gmail.com>2021-11-10 16:45:03 -0800
committerDavid Lord <davidism@gmail.com>2021-11-10 16:45:03 -0800
commitd88e771a004c34e4b863123333a259b28a2bf8f4 (patch)
tree7f5755367db9f4a03507eaedccb579e625183987
parent51736b9566637351362f1eaeb32ea42aecdec704 (diff)
downloadclick-d88e771a004c34e4b863123333a259b28a2bf8f4.tar.gz
remove deprecated get_terminal_size
-rw-r--r--CHANGES.rst2
-rw-r--r--docs/api.rst2
-rw-r--r--src/click/__init__.py1
-rw-r--r--src/click/termui.py20
4 files changed, 2 insertions, 23 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index cc12060..af97e24 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -11,6 +11,8 @@ Unreleased
- ``Group.resultcallback`` is renamed to ``result_callback``.
- ``autocompletion`` parameter to ``Command`` is renamed to
``shell_complete``.
+ - ``get_terminal_size`` is removed, use
+ ``shutil.get_terminal_size`` instead.
- Single options boolean flags with ``show_default=True`` only show
the default if it is ``True``. :issue:`1971`
diff --git a/docs/api.rst b/docs/api.rst
index 5133085..09efd03 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -63,8 +63,6 @@ Utilities
.. autofunction:: pause
-.. autofunction:: get_terminal_size
-
.. autofunction:: get_binary_stream
.. autofunction:: get_text_stream
diff --git a/src/click/__init__.py b/src/click/__init__.py
index 8790877..8c12e0f 100644
--- a/src/click/__init__.py
+++ b/src/click/__init__.py
@@ -41,7 +41,6 @@ from .termui import clear as clear
from .termui import confirm as confirm
from .termui import echo_via_pager as echo_via_pager
from .termui import edit as edit
-from .termui import get_terminal_size as get_terminal_size
from .termui import getchar as getchar
from .termui import launch as launch
from .termui import pause as pause
diff --git a/src/click/termui.py b/src/click/termui.py
index cf8d5f1..19dced0 100644
--- a/src/click/termui.py
+++ b/src/click/termui.py
@@ -252,26 +252,6 @@ def confirm(
return rv
-def get_terminal_size() -> os.terminal_size:
- """Returns the current size of the terminal as tuple in the form
- ``(width, height)`` in columns and rows.
-
- .. deprecated:: 8.0
- Will be removed in Click 8.1. Use
- :func:`shutil.get_terminal_size` instead.
- """
- import shutil
- import warnings
-
- warnings.warn(
- "'click.get_terminal_size()' is deprecated and will be removed"
- " in Click 8.1. Use 'shutil.get_terminal_size()' instead.",
- DeprecationWarning,
- stacklevel=2,
- )
- return shutil.get_terminal_size()
-
-
def echo_via_pager(
text_or_generator: t.Union[t.Iterable[str], t.Callable[[], t.Iterable[str]], str],
color: t.Optional[bool] = None,