Skip to content
Merged

bits #1828

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ documentation carefully before using any particular package.
- `p9fs`_ for 9P (Plan 9 Filesystem Protocol) servers
- `PyAthena`_ for S3 access to Amazon Athena, with protocol "s3://" or "s3a://"
- `PyDrive2`_ for Google Drive access
- `fsspec-proxy`_ for "pyscript:" URLs via a proxy server
- `s3fs`_ for Amazon S3 and other compatible stores, with protocol "s3://"
- `sshfs`_ for access to SSH servers, with protocol "ssh://" or "sftp://"
- `swiftspec`_ for OpenStack SWIFT, with protocol "swift://"
Expand All @@ -254,6 +255,7 @@ documentation carefully before using any particular package.
.. _dropbox: https://github.com/fsspec/dropboxdrivefs
.. _dvc: https://github.com/iterative/dvc
.. _fsspec-encrypted: https://github.com/thevgergroup/fsspec-encrypted
.. _fsspec-proxy: https://github.com/fsspec/fsspec-proxy
.. _gcsfs: https://gcsfs.readthedocs.io/en/latest/
.. _gdrive: https://github.com/fsspec/gdrivefs
.. _git: https://github.com/iterative/scmrepo
Expand Down
6 changes: 4 additions & 2 deletions fsspec/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from importlib.metadata import entry_points

from . import caching
from ._version import __version__ # noqa: F401
from .callbacks import Callback
Expand Down Expand Up @@ -38,6 +36,10 @@


def process_entries():
try:
from importlib.metadata import entry_points
except ImportError:
return
if entry_points is not None:
try:
eps = entry_points()
Expand Down
19 changes: 15 additions & 4 deletions fsspec/implementations/asyn_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import functools
import inspect

import fsspec
from fsspec.asyn import AsyncFileSystem, running_async


Expand Down Expand Up @@ -42,14 +43,24 @@ class AsyncFileSystemWrapper(AsyncFileSystem):
The synchronous filesystem instance to wrap.
"""

protocol = "async_wrapper"
protocol = "asyncwrapper", "async_wrapper"
cachable = False

def __init__(self, fs, *args, asynchronous=None, **kwargs):
def __init__(
self,
fs=None,
asynchronous=None,
target_protocol=None,
target_options=None,
**kwargs,
):
if asynchronous is None:
asynchronous = running_async()
super().__init__(*args, asynchronous=asynchronous, **kwargs)
self.sync_fs = fs
super().__init__(asynchronous=asynchronous, **kwargs)
if fs is not None:
self.sync_fs = fs
else:
self.sync_fs = fsspec.filesystem(target_protocol, **target_options)
self.protocol = self.sync_fs.protocol
self._wrap_all_sync_methods()

Expand Down
10 changes: 7 additions & 3 deletions fsspec/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ def register_implementation(name, cls, clobber=False, errtxt=None):
"class": "fsspec.implementations.arrow.HadoopFileSystem",
"err": "pyarrow and local java libraries required for HDFS",
},
"async_wrapper": {
"class": "fsspec.asyn_wrapper.AsyncWrapperFileSystem",
},
"asynclocal": {
"class": "morefs.asyn_local.AsyncLocalFileSystem",
"err": "Install 'morefs[asynclocalfs]' to use AsyncLocalFileSystem",
},
"asyncwrapper": {
"class": "fsspec.implementations.asyn_wrapper.AsyncFileSystemWrapper",
},
"az": {
"class": "adlfs.AzureBlobFileSystem",
"err": "Install adlfs to access Azure Datalake Gen2 and Azure Blob Storage",
Expand Down Expand Up @@ -180,6 +180,10 @@ def register_implementation(name, cls, clobber=False, errtxt=None):
"class": "ossfs.OSSFileSystem",
"err": "Install ossfs to access Alibaba Object Storage System",
},
"pyscript": {
"class": "pyscript_fsspec_client.client.PyscriptFileSystem",
"err": "Install requests (cpython) or run in pyscript",
},
"reference": {"class": "fsspec.implementations.reference.ReferenceFileSystem"},
"root": {
"class": "fsspec_xrootd.XRootDFileSystem",
Expand Down
Loading