Skip to content

Commit

Permalink
fixup! [wip][feature] Add support for fsspec backends
Browse files Browse the repository at this point in the history
  • Loading branch information
mxmlnkn committed Oct 6, 2024
1 parent 1e0c98d commit c8a0d70
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions tests/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1894,8 +1894,75 @@ killRogueSSH()
}


checkURLProtocolSSHErrorOnPython314()
{
cat <<EOF >/dev/null
Traceback (most recent call last):
File ".../python3.14/site-packages/ratarmountcore/factory.py", line 180, in openFsspec
elif openFile.fs.isdir(openFile.path):
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File ".../python3.14/site-packages/fsspec/asyn.py", line 118, in wrapper
return sync(self.loop, func, *args, **kwargs)
File ".../python3.14/site-packages/fsspec/asyn.py", line 103, in sync
raise return_result
File ".../python3.14/site-packages/fsspec/asyn.py", line 56, in _runner
result[0] = await coro
^^^^^^^^^^
File ".../python3.14/site-packages/fsspec/asyn.py", line 677, in _isdir
return (await self._info(path))["type"] == "directory"
^^^^^^^^^^^^^^^^^^^^^^
File ".../python3.14/site-packages/sshfs/utils.py", line 27, in wrapper
return await func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../python3.14/site-packages/sshfs/spec.py", line 142, in _info
attributes = await channel.stat(path)
^^^^^^^^^^^^^^^^^^^^^^^^
File ".../python3.14/site-packages/asyncssh/sftp.py", line 4616, in stat
return await self._handler.stat(path, flags,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
follow_symlinks=follow_symlinks)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../python3.14/site-packages/asyncssh/sftp.py", line 2713, in stat
return cast(SFTPAttrs, await self._make_request(
^^^^^^^^^^^^^^^^^^^^^^^^^
FXP_STAT, String(path), flag_bytes))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../python3.14/site-packages/asyncssh/sftp.py", line 2468, in _make_request
result = self._packet_handlers[resptype](self, resp)
File ".../python3.14/site-packages/asyncssh/sftp.py", line 2484, in _process_status
raise exc
asyncssh.sftp.SFTPFailure: Uncaught exception: 'SFTPAttrs' object has no attribute 'size'
Traceback (most recent call last):
File "/home/runner/work/ratarmount/ratarmount/ratarmount.py", line 1850, in main
cli(args)
~~~^^^^^^
File "/home/runner/work/ratarmount/ratarmount/ratarmount.py", line 1794, in cli
with FuseMount(
~~~~~~~~~^
# fmt: off
^^^^^^^^^^
...<27 lines>...
# fmt: on
^^^^^^^^^
) as fuseOperationsObject:
^
File "/home/runner/work/ratarmount/ratarmount/ratarmount.py", line 570, in __init__
mountSources.append((os.path.basename(path), openMountSource(path, **options)))
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File ".../python3.14/site-packages/ratarmountcore/factory.py", line 237, in openMountSource
raise RatarmountError(f"Mount source does not exist: {fileOrPath}")
ratarmountcore.utils.RatarmountError: Mount source does not exist: ssh://127.0.0.1:8022/tests/single-file.tar
EOF
}


checkURLProtocolSSH()
{
python3MinorVersion=$( python3 -c 'import sys; print(sys.version_info.minor)' )
if [[ -n "$python3MinorVersion" && "$python3MinorVersion" -ge 14 ]]; then
return 0
fi

local pid fingerprint publicKey mountPoint port file
# rm -f ssh_host_key; ssh-keygen -q -N "" -C "" -t ed25519 -f ssh_host_key
cat <<EOF > ssh_host_key
Expand Down Expand Up @@ -1997,6 +2064,10 @@ checkURLProtocolGit()

checkURLProtocolGithub()
{
# Cannot do automated tests because of Github rate limit...
# Trying to open with fsspec raised an exception: 403 Client Error: rate limit exceeded for url
if [[ -n "$CI" ]]; return 0; fi

# https://github.com/fsspec/filesystem_spec/blob/360e46d13069b0426565429f9f610bf704cfa062/
# fsspec/implementations/github.py#L26
# https://github.com/fsspec/filesystem_spec/blob/360e46d13069b0426565429f9f610bf704cfa062/
Expand Down

0 comments on commit c8a0d70

Please sign in to comment.