From 73a9a413ea23c17aa16ee9816fc64f1b48a8d0c9 Mon Sep 17 00:00:00 2001 From: Hadi Alqattan Date: Sat, 26 Feb 2022 16:23:38 +0300 Subject: [PATCH] Run pycln over the entire project and double check the accuracy. --- examples/downloader.py | 2 +- rich/__init__.py | 1 - rich/control.py | 2 +- rich/pager.py | 2 +- rich/protocol.py | 2 +- rich/traceback.py | 2 +- tests/test_ansi.py | 1 - tests/test_live.py | 1 - tests/test_lrucache.py | 1 - tests/test_panel.py | 1 - tests/test_table.py | 1 - tools/make_emoji.py | 1 - 12 files changed, 5 insertions(+), 12 deletions(-) diff --git a/examples/downloader.py b/examples/downloader.py index 3671cee4..919aa734 100644 --- a/examples/downloader.py +++ b/examples/downloader.py @@ -4,7 +4,7 @@ A rudimentary URL downloader (like wget or curl) to demonstrate Rich progress ba import os.path import sys -from concurrent.futures import as_completed, ThreadPoolExecutor +from concurrent.futures import ThreadPoolExecutor import signal from functools import partial from threading import Event diff --git a/rich/__init__.py b/rich/__init__.py index 01faa6e6..2b2a29f1 100644 --- a/rich/__init__.py +++ b/rich/__init__.py @@ -3,7 +3,6 @@ import os from typing import Callable, IO, TYPE_CHECKING, Any, Optional, Union -from ._extension import load_ipython_extension __all__ = ["get_console", "reconfigure", "print", "inspect"] diff --git a/rich/control.py b/rich/control.py index c98d0d7d..e17b2c63 100644 --- a/rich/control.py +++ b/rich/control.py @@ -1,4 +1,4 @@ -from typing import Any, Callable, Dict, Iterable, List, TYPE_CHECKING, Union +from typing import Callable, Dict, Iterable, List, TYPE_CHECKING, Union from .segment import ControlCode, ControlType, Segment diff --git a/rich/pager.py b/rich/pager.py index dbfb973e..a3f7aa62 100644 --- a/rich/pager.py +++ b/rich/pager.py @@ -1,5 +1,5 @@ from abc import ABC, abstractmethod -from typing import Any, Callable +from typing import Any class Pager(ABC): diff --git a/rich/protocol.py b/rich/protocol.py index ff69cc8b..c6923dd7 100644 --- a/rich/protocol.py +++ b/rich/protocol.py @@ -1,4 +1,4 @@ -from typing import Any, Callable, cast, Set, TYPE_CHECKING +from typing import Any, cast, Set, TYPE_CHECKING from inspect import isclass if TYPE_CHECKING: diff --git a/rich/traceback.py b/rich/traceback.py index bebf22f3..912821cb 100644 --- a/rich/traceback.py +++ b/rich/traceback.py @@ -14,7 +14,7 @@ from pygments.token import Text as TextToken from pygments.token import Token from . import pretty -from ._loop import loop_first, loop_last +from ._loop import loop_last from .columns import Columns from .console import Console, ConsoleOptions, ConsoleRenderable, RenderResult, group from .constrain import Constrain diff --git a/tests/test_ansi.py b/tests/test_ansi.py index 898286cf..e54a29a8 100644 --- a/tests/test_ansi.py +++ b/tests/test_ansi.py @@ -1,4 +1,3 @@ -import io from rich.ansi import AnsiDecoder from rich.console import Console diff --git a/tests/test_live.py b/tests/test_live.py index 0c732f63..eeb6ab6e 100644 --- a/tests/test_live.py +++ b/tests/test_live.py @@ -1,5 +1,4 @@ # encoding=utf-8 -import io import time from typing import Optional diff --git a/tests/test_lrucache.py b/tests/test_lrucache.py index 9a1d7d10..3cb1e298 100644 --- a/tests/test_lrucache.py +++ b/tests/test_lrucache.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -import unittest from rich._lru_cache import LRUCache diff --git a/tests/test_panel.py b/tests/test_panel.py index 877715fa..daf48986 100644 --- a/tests/test_panel.py +++ b/tests/test_panel.py @@ -1,6 +1,5 @@ import io from rich.console import Console -from rich.measure import Measurement from rich.panel import Panel import pytest diff --git a/tests/test_table.py b/tests/test_table.py index 6fc863f2..040f9614 100644 --- a/tests/test_table.py +++ b/tests/test_table.py @@ -5,7 +5,6 @@ import io import pytest from rich import box, errors -from rich.align import VerticalAlignMethod from rich.console import Console from rich.measure import Measurement from rich.style import Style diff --git a/tools/make_emoji.py b/tools/make_emoji.py index b23803d5..2b9d05cd 100644 --- a/tools/make_emoji.py +++ b/tools/make_emoji.py @@ -1,4 +1,3 @@ -from unicodedata import normalize try: import emoji