|
8 | 8 | from contextlib import AbstractAsyncContextManager |
9 | 9 | from enum import Enum |
10 | 10 | from pathlib import Path |
11 | | -from typing import Any, Protocol |
| 11 | +from typing import TYPE_CHECKING, Any, Protocol |
12 | 12 |
|
13 | 13 | import docker |
14 | 14 | import yaml |
15 | | -from servicelib.rabbitmq import RabbitMQClient |
16 | | -from servicelib.redis import RedisClientSDK |
17 | 15 | from tenacity import retry |
18 | 16 | from tenacity.after import after_log |
19 | 17 | from tenacity.asyncio import AsyncRetrying |
20 | 18 | from tenacity.retry import retry_if_exception_type |
21 | 19 | from tenacity.stop import stop_after_attempt, stop_after_delay |
22 | 20 | from tenacity.wait import wait_fixed |
23 | 21 |
|
| 22 | +if TYPE_CHECKING: |
| 23 | + from servicelib.rabbitmq import RabbitMQClient |
| 24 | + from servicelib.redis import RedisClientSDK |
| 25 | + |
24 | 26 |
|
25 | 27 | # NOTE: CANNOT use models_library.generated_models.docker_rest_api.Status2 because some of the |
26 | 28 | # packages tests installations do not include this library!! |
@@ -288,8 +290,8 @@ async def ping(self) -> bool: ... |
288 | 290 | class ServiceManager: |
289 | 291 | def __init__( |
290 | 292 | self, |
291 | | - redis_client: RedisClientSDK, |
292 | | - rabbit_client: RabbitMQClient, |
| 293 | + redis_client: "RedisClientSDK", |
| 294 | + rabbit_client: "RabbitMQClient", |
293 | 295 | paused_container: Callable[[str], AbstractAsyncContextManager[None]], |
294 | 296 | ) -> None: |
295 | 297 | self.redis_client = redis_client |
|
0 commit comments