Skip to content

Conversation

@pmrowla
Copy link
Contributor

@pmrowla pmrowla commented Mar 16, 2022

Will close #43

@pmrowla pmrowla marked this pull request as draft March 16, 2022 09:22
@pmrowla pmrowla self-assigned this Mar 16, 2022
We were using wrong typehints - SSHConnection vs SSHClientConnection.
And SFTPFileProtocol.read() is typed as requiring `read` and `offset`
explicitly now, which has been updated in the test.

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SFTPFileProtocol.read requires read and offset to be passed explicitly. This is most likely a bug in typings in asyncssh, but this does not hurt us that much, so just fixing it here.

class AsyncSSHWrapper(BaseAsyncObject):
def __init__(
self, conn: "SSHConnection", proc: "SSHClientProcess", **kwargs
self, conn: "SSHClientConnection", proc: "SSHClientProcess", **kwargs
Copy link
Collaborator

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. :)

] = _process_public_key_ok_gh

conn: "SSHClientConnection" = await asyncssh.connect(
conn = await asyncssh.connect(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer required, since asyncssh is now typed. :)

proc: "SSHClientProcess" = await conn.create_process(
command, encoding=None
)
proc = await conn.create_process(command, encoding=None)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer required, since asyncssh is now typed. :)

@skshetry skshetry marked this pull request as ready for review March 17, 2022 10:06
@skshetry skshetry merged commit dbbb223 into treeverse:main Mar 17, 2022
@pmrowla pmrowla deleted the asyncssh-2.9 branch March 17, 2022 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Version restriction on asyncssh

2 participants