-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
asyncssh: loosen upper version limit #44
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
from scmrepo.asyn import BaseAsyncObject, sync_wrapper | ||
|
||
if TYPE_CHECKING: | ||
from asyncssh.connection import SSHClientConnection, SSHConnection | ||
from asyncssh.connection import SSHClientConnection | ||
from asyncssh.process import SSHClientProcess | ||
from asyncssh.stream import SSHReader | ||
|
||
|
@@ -37,7 +37,7 @@ async def _read(self, n: Optional[int] = None) -> bytes: | |
|
||
class AsyncSSHWrapper(BaseAsyncObject): | ||
def __init__( | ||
self, conn: "SSHConnection", proc: "SSHClientProcess", **kwargs | ||
self, conn: "SSHClientConnection", proc: "SSHClientProcess", **kwargs | ||
): | ||
super().__init__(**kwargs) | ||
self.conn: "SSHClientConnection" = conn | ||
|
@@ -146,7 +146,7 @@ async def _run_command( | |
MSG_USERAUTH_PK_OK | ||
] = _process_public_key_ok_gh | ||
|
||
conn: "SSHClientConnection" = await asyncssh.connect( | ||
conn = await asyncssh.connect( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No longer required, since |
||
host, | ||
port=port if port is not None else (), | ||
username=username if username is not None else (), | ||
|
@@ -156,9 +156,7 @@ async def _run_command( | |
known_hosts=None, | ||
encoding=None, | ||
) | ||
proc: "SSHClientProcess" = await conn.create_process( | ||
command, encoding=None | ||
) | ||
proc = await conn.create_process(command, encoding=None) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No longer required, since |
||
return AsyncSSHWrapper(conn, proc) | ||
|
||
run_command = sync_wrapper(_run_command) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
import pytest | ||
from asyncssh import SFTPClient | ||
from asyncssh.connection import SSHConnection | ||
from asyncssh.connection import SSHClientConnection | ||
from git import Repo as GitPythonRepo | ||
from pytest_test_utils import TempDirFactory, TmpDir | ||
from pytest_test_utils.matchers import Matcher | ||
|
@@ -844,7 +844,7 @@ async def test_git_ssh( | |
scm: Git, | ||
git: Git, | ||
sftp: SFTPClient, | ||
ssh_connection: SSHConnection, | ||
ssh_connection: SSHClientConnection, | ||
ssh_conn_info: Dict[str, Any], | ||
): | ||
host, port = ssh_conn_info["host"], ssh_conn_info["port"] | ||
|
@@ -868,7 +868,7 @@ async def test_git_ssh( | |
) | ||
|
||
async with sftp.open("test-repo.git/refs/heads/master") as fobj: | ||
assert (await fobj.read()).strip() == rev | ||
assert (await fobj.read(-1, 0)).strip() == rev | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
shutil.rmtree(tmp_dir / ".git") | ||
(tmp_dir / "foo").unlink() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were using incorrect type-hints. :)