From 879765cb88c4a1ca4131cdcc18545c0c4d6754e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saugat=20Pachhai=20=28=E0=A4=B8=E0=A5=8C=E0=A4=97=E0=A4=BE?= =?UTF-8?q?=E0=A4=A4=29?= Date: Wed, 5 Feb 2025 08:40:34 +0545 Subject: [PATCH] reorganize asyncssh imports --- dvc_ssh/client.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/dvc_ssh/client.py b/dvc_ssh/client.py index 0347044..29620eb 100644 --- a/dvc_ssh/client.py +++ b/dvc_ssh/client.py @@ -5,26 +5,24 @@ from getpass import getpass from typing import TYPE_CHECKING, Optional, cast -from asyncssh import SSHClient -from asyncssh.public_key import ( - _DEFAULT_KEY_FILES, +from asyncssh import ( KeyEncryptionError, KeyImportError, - SSHLocalKeyPair, + SSHClient, read_private_key, read_public_key, ) +from asyncssh.public_key import _DEFAULT_KEY_FILES, SSHLocalKeyPair if TYPE_CHECKING: + from asyncssh import SSHClientConnection, SSHKey from asyncssh.auth import KbdIntPrompts, KbdIntResponse - from asyncssh.config import FilePath - from asyncssh.connection import SSHClientConnection - from asyncssh.misc import MaybeAwait - from asyncssh.public_key import KeyPairListArg, SSHKey + from asyncssh.misc import FilePath + from asyncssh.public_key import KeyPairListArg class InteractiveSSHClient(SSHClient): - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: super().__init__(*args, **kwargs) self._conn: Optional[SSHClientConnection] = None self._keys_to_try: Optional[list[FilePath]] = None @@ -95,7 +93,7 @@ async def _read_private_key_interactive(self, path: "FilePath") -> "SSHKey": pass raise KeyImportError("Incorrect passphrase") - def kbdint_auth_requested(self) -> "MaybeAwait[Optional[str]]": + def kbdint_auth_requested(self) -> str: return "" async def kbdint_challenge_received(