From baff0155075ae36ba1ca0070e9d0c6ef26e339b7 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Thu, 4 Aug 2022 22:11:49 -0500 Subject: [PATCH 1/3] chore!(test): Remove retry(), deprecated in 0.13 This function didn't work, see #368 --- libtmux/test.py | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/libtmux/test.py b/libtmux/test.py index bdad6e29d..4af61b11e 100644 --- a/libtmux/test.py +++ b/libtmux/test.py @@ -6,7 +6,6 @@ import time import types import typing as t -import warnings from typing import Callable, Optional from libtmux.server import Server @@ -42,41 +41,6 @@ def __next__(self) -> str: fixtures_dir = os.path.realpath(os.path.join(current_dir, "fixtures")) -def retry(seconds: float = RETRY_TIMEOUT_SECONDS) -> bool: - """ - Retry a block of code until a time limit or ``break``. - - .. deprecated:: 0.12.0 - `retry` doesn't work, it will be removed in libtmux 0.13.0, it is replaced by - `retry_until`, more info: https://github.com/tmux-python/libtmux/issues/368. - - Parameters - ---------- - seconds : float - Seconds to retry, defaults to ``RETRY_TIMEOUT_SECONDS``, which is - configurable via environmental variables. - - Returns - ------- - bool - True if time passed since retry() invoked less than seconds param. - - Examples - -------- - - >>> while retry(): - ... p = w.attached_pane - ... p.server._update_panes() - ... if p.current_path == pane_path: - ... break - """ - warnings.warn( - "retry() is being deprecated and will soon be replaced by retry_until()", - DeprecationWarning, - ) - return (lambda: time.time() < time.time() + seconds)() - - def retry_until( fun: Callable[[], bool], seconds: float = RETRY_TIMEOUT_SECONDS, From 25508319434c9fbeddd2095496ef63b0d5557648 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Thu, 4 Aug 2022 22:13:40 -0500 Subject: [PATCH 2/3] docs(CHANGES): Note removal of retry --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index d71feac48..d1e851555 100644 --- a/CHANGES +++ b/CHANGES @@ -61,6 +61,8 @@ $ pip install --user --upgrade --pre libtmux window.show_window_option('DISPLAY') ``` +- Remove `libtmux.test.retry()`, deprecated since 0.12.x ({issue}`393`) + ## What's new - **Improved typings** From 826df1787bc3025b40de7de7aff089ecc4b5203b Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Thu, 4 Aug 2022 22:14:03 -0500 Subject: [PATCH 3/3] docs(CHANGES): Move What's new up --- CHANGES | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index d1e851555..5554ff68e 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,14 @@ $ pip install --user --upgrade --pre libtmux - _Insert changes/features/fixes for next release here_ +## What's new + +- **Improved typings** + + Now [`mypy --strict`] compliant ({issue}`383`) + + [`mypy --strict`]: https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-strict + ### Breaking changes - Deprecated individual item lookups ({issue}`390`) @@ -63,14 +71,6 @@ $ pip install --user --upgrade --pre libtmux - Remove `libtmux.test.retry()`, deprecated since 0.12.x ({issue}`393`) -## What's new - -- **Improved typings** - - Now [`mypy --strict`] compliant ({issue}`383`) - - [`mypy --strict`]: https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-strict - ### Development - Fix incorrect function name `findWhere()` ({issue}`391`)