33import atexit
44import logging
55import sys
6+ from collections .abc import Awaitable
7+ from collections .abc import Callable
68from contextlib import AsyncExitStack
79from contextlib import suppress
810from copy import copy
1113from pathlib import Path
1214from typing import TYPE_CHECKING
1315from typing import Any
14- from typing import Awaitable
15- from typing import Callable
1616from typing import TypeVar
1717from typing import cast
1818
2828from dipdup .report import save_report
2929from dipdup .sys import set_up_process
3030
31+ if TYPE_CHECKING :
32+ from dipdup .config import DipDupConfig
33+
34+
3135_click_wrap_text = click .formatting .wrap_text
3236
3337
3438def _wrap_text (text : str , * a : Any , ** kw : Any ) -> str :
3539 # NOTE: WELCOME_ASCII and EPILOG
36- if text .startswith (( ' ' ) ):
40+ if text .startswith (' ' ):
3741 return text
38- if text .startswith (( '\0 \n ' ) ):
42+ if text .startswith ('\0 \n ' ):
3943 return text [2 :]
4044 return _click_wrap_text (text , * a , ** kw )
4145
@@ -60,8 +64,6 @@ def _wrap_text(text: str, *a: Any, **kw: Any) -> str:
6064 'wipe' ,
6165}
6266
63- if TYPE_CHECKING :
64- from dipdup .config import DipDupConfig
6567
6668_logger = logging .getLogger (__name__ )
6769
@@ -218,7 +220,7 @@ async def cli(ctx: click.Context, config: list[str], env_file: list[str]) -> Non
218220
219221 # NOTE: Fire and forget, do not block instant commands
220222 if not any ((_config .advanced .skip_version_check , env .TEST , env .CI )):
221- asyncio .ensure_future (_check_version ())
223+ _ = asyncio .ensure_future (_check_version ())
222224
223225 try :
224226 # NOTE: Avoid early import errors if project package is incomplete.
@@ -242,7 +244,6 @@ async def run(ctx: click.Context) -> None:
242244
243245 Execution can be gracefully interrupted with `Ctrl+C` or `SIGINT` signal.
244246 """
245- from dipdup .config import DipDupConfig
246247 from dipdup .dipdup import DipDup
247248
248249 config : DipDupConfig = ctx .obj .config
@@ -388,7 +389,6 @@ async def schema(ctx: click.Context) -> None:
388389async def schema_approve (ctx : click .Context ) -> None :
389390 """Continue to use existing schema after reindexing was triggered."""
390391
391- from dipdup .config import DipDupConfig
392392 from dipdup .database import tortoise_wrapper
393393 from dipdup .models import Index
394394 from dipdup .models import Schema
0 commit comments