Skip to content

Commit 14dce8c

Browse files
authored
sort known_implementations (#1539)
1 parent 1dfed9d commit 14dce8c

File tree

2 files changed

+109
-101
lines changed

2 files changed

+109
-101
lines changed

fsspec/registry.py

+103-101
Original file line numberDiff line numberDiff line change
@@ -60,156 +60,158 @@ def register_implementation(name, cls, clobber=False, errtxt=None):
6060
# protocols mapped to the class which implements them. This dict can be
6161
# updated with register_implementation
6262
known_implementations = {
63-
"data": {"class": "fsspec.implementations.data.DataFileSystem"},
64-
"file": {"class": "fsspec.implementations.local.LocalFileSystem"},
65-
"local": {"class": "fsspec.implementations.local.LocalFileSystem"},
66-
"memory": {"class": "fsspec.implementations.memory.MemoryFileSystem"},
67-
"dropbox": {
68-
"class": "dropboxdrivefs.DropboxDriveFileSystem",
69-
"err": (
70-
'DropboxFileSystem requires "dropboxdrivefs",'
71-
'"requests" and "dropbox" to be installed'
72-
),
73-
},
74-
"http": {
75-
"class": "fsspec.implementations.http.HTTPFileSystem",
76-
"err": 'HTTPFileSystem requires "requests" and "aiohttp" to be installed',
77-
},
78-
"https": {
79-
"class": "fsspec.implementations.http.HTTPFileSystem",
80-
"err": 'HTTPFileSystem requires "requests" and "aiohttp" to be installed',
81-
},
82-
"zip": {"class": "fsspec.implementations.zip.ZipFileSystem"},
83-
"tar": {"class": "fsspec.implementations.tar.TarFileSystem"},
84-
"gcs": {
85-
"class": "gcsfs.GCSFileSystem",
86-
"err": "Please install gcsfs to access Google Storage",
87-
},
88-
"gs": {
89-
"class": "gcsfs.GCSFileSystem",
90-
"err": "Please install gcsfs to access Google Storage",
91-
},
92-
"gdrive": {
93-
"class": "gdrivefs.GoogleDriveFileSystem",
94-
"err": "Please install gdrivefs for access to Google Drive",
95-
},
96-
"sftp": {
97-
"class": "fsspec.implementations.sftp.SFTPFileSystem",
98-
"err": 'SFTPFileSystem requires "paramiko" to be installed',
99-
},
100-
"ssh": {
101-
"class": "fsspec.implementations.sftp.SFTPFileSystem",
102-
"err": 'SFTPFileSystem requires "paramiko" to be installed',
63+
"abfs": {
64+
"class": "adlfs.AzureBlobFileSystem",
65+
"err": "Install adlfs to access Azure Datalake Gen2 and Azure Blob Storage",
10366
},
104-
"ftp": {"class": "fsspec.implementations.ftp.FTPFileSystem"},
105-
"hdfs": {
106-
"class": "fsspec.implementations.arrow.HadoopFileSystem",
107-
"err": "pyarrow and local java libraries required for HDFS",
67+
"adl": {
68+
"class": "adlfs.AzureDatalakeFileSystem",
69+
"err": "Install adlfs to access Azure Datalake Gen1",
10870
},
10971
"arrow_hdfs": {
11072
"class": "fsspec.implementations.arrow.HadoopFileSystem",
11173
"err": "pyarrow and local java libraries required for HDFS",
11274
},
113-
"webhdfs": {
114-
"class": "fsspec.implementations.webhdfs.WebHDFS",
115-
"err": 'webHDFS access requires "requests" to be installed',
116-
},
117-
"s3": {"class": "s3fs.S3FileSystem", "err": "Install s3fs to access S3"},
118-
"s3a": {"class": "s3fs.S3FileSystem", "err": "Install s3fs to access S3"},
119-
"wandb": {"class": "wandbfs.WandbFS", "err": "Install wandbfs to access wandb"},
120-
"oci": {
121-
"class": "ocifs.OCIFileSystem",
122-
"err": "Install ocifs to access OCI Object Storage",
123-
},
124-
"ocilake": {
125-
"class": "ocifs.OCIFileSystem",
126-
"err": "Install ocifs to access OCI Data Lake",
127-
},
12875
"asynclocal": {
12976
"class": "morefs.asyn_local.AsyncLocalFileSystem",
13077
"err": "Install 'morefs[asynclocalfs]' to use AsyncLocalFileSystem",
13178
},
132-
"adl": {
133-
"class": "adlfs.AzureDatalakeFileSystem",
134-
"err": "Install adlfs to access Azure Datalake Gen1",
135-
},
136-
"abfs": {
137-
"class": "adlfs.AzureBlobFileSystem",
138-
"err": "Install adlfs to access Azure Datalake Gen2 and Azure Blob Storage",
139-
},
14079
"az": {
14180
"class": "adlfs.AzureBlobFileSystem",
14281
"err": "Install adlfs to access Azure Datalake Gen2 and Azure Blob Storage",
14382
},
144-
"cached": {"class": "fsspec.implementations.cached.CachingFileSystem"},
14583
"blockcache": {"class": "fsspec.implementations.cached.CachingFileSystem"},
146-
"filecache": {"class": "fsspec.implementations.cached.WholeFileCacheFileSystem"},
147-
"simplecache": {"class": "fsspec.implementations.cached.SimpleCacheFileSystem"},
84+
"box": {
85+
"class": "boxfs.BoxFileSystem",
86+
"err": "Please install boxfs to access BoxFileSystem",
87+
},
88+
"cached": {"class": "fsspec.implementations.cached.CachingFileSystem"},
14889
"dask": {
14990
"class": "fsspec.implementations.dask.DaskWorkerFileSystem",
15091
"err": "Install dask distributed to access worker file system",
15192
},
93+
"data": {"class": "fsspec.implementations.data.DataFileSystem"},
15294
"dbfs": {
15395
"class": "fsspec.implementations.dbfs.DatabricksFileSystem",
15496
"err": "Install the requests package to use the DatabricksFileSystem",
15597
},
156-
"github": {
157-
"class": "fsspec.implementations.github.GithubFileSystem",
158-
"err": "Install the requests package to use the github FS",
98+
"dir": {"class": "fsspec.implementations.dirfs.DirFileSystem"},
99+
"dropbox": {
100+
"class": "dropboxdrivefs.DropboxDriveFileSystem",
101+
"err": (
102+
'DropboxFileSystem requires "dropboxdrivefs","requests" and "'
103+
'"dropbox" to be installed'
104+
),
105+
},
106+
"dvc": {
107+
"class": "dvc.api.DVCFileSystem",
108+
"err": "Install dvc to access DVCFileSystem",
109+
},
110+
"file": {"class": "fsspec.implementations.local.LocalFileSystem"},
111+
"filecache": {"class": "fsspec.implementations.cached.WholeFileCacheFileSystem"},
112+
"ftp": {"class": "fsspec.implementations.ftp.FTPFileSystem"},
113+
"gcs": {
114+
"class": "gcsfs.GCSFileSystem",
115+
"err": "Please install gcsfs to access Google Storage",
159116
},
117+
"gdrive": {
118+
"class": "gdrivefs.GoogleDriveFileSystem",
119+
"err": "Please install gdrivefs for access to Google Drive",
120+
},
121+
"generic": {"class": "fsspec.generic.GenericFileSystem"},
160122
"git": {
161123
"class": "fsspec.implementations.git.GitFileSystem",
162124
"err": "Install pygit2 to browse local git repos",
163125
},
164-
"smb": {
165-
"class": "fsspec.implementations.smb.SMBFileSystem",
166-
"err": 'SMB requires "smbprotocol" or "smbprotocol[kerberos]" installed',
126+
"github": {
127+
"class": "fsspec.implementations.github.GithubFileSystem",
128+
"err": "Install the requests package to use the github FS",
167129
},
168-
"jupyter": {
130+
"gs": {
131+
"class": "gcsfs.GCSFileSystem",
132+
"err": "Please install gcsfs to access Google Storage",
133+
},
134+
"hdfs": {
135+
"class": "fsspec.implementations.arrow.HadoopFileSystem",
136+
"err": "pyarrow and local java libraries required for HDFS",
137+
},
138+
"hf": {
139+
"class": "huggingface_hub.HfFileSystem",
140+
"err": "Install huggingface_hub to access HfFileSystem",
141+
},
142+
"http": {
143+
"class": "fsspec.implementations.http.HTTPFileSystem",
144+
"err": 'HTTPFileSystem requires "requests" and "aiohttp" to be installed',
145+
},
146+
"https": {
147+
"class": "fsspec.implementations.http.HTTPFileSystem",
148+
"err": 'HTTPFileSystem requires "requests" and "aiohttp" to be installed',
149+
},
150+
"jlab": {
169151
"class": "fsspec.implementations.jupyter.JupyterFileSystem",
170152
"err": "Jupyter FS requires requests to be installed",
171153
},
172-
"jlab": {
154+
"jupyter": {
173155
"class": "fsspec.implementations.jupyter.JupyterFileSystem",
174156
"err": "Jupyter FS requires requests to be installed",
175157
},
158+
"lakefs": {
159+
"class": "lakefs_spec.LakeFSFileSystem",
160+
"err": "Please install lakefs-spec to access LakeFSFileSystem",
161+
},
176162
"libarchive": {
177163
"class": "fsspec.implementations.libarchive.LibArchiveFileSystem",
178164
"err": "LibArchive requires to be installed",
179165
},
180-
"reference": {"class": "fsspec.implementations.reference.ReferenceFileSystem"},
181-
"generic": {"class": "fsspec.generic.GenericFileSystem"},
166+
"local": {"class": "fsspec.implementations.local.LocalFileSystem"},
167+
"memory": {"class": "fsspec.implementations.memory.MemoryFileSystem"},
168+
"oci": {
169+
"class": "ocifs.OCIFileSystem",
170+
"err": "Install ocifs to access OCI Object Storage",
171+
},
172+
"ocilake": {
173+
"class": "ocifs.OCIFileSystem",
174+
"err": "Install ocifs to access OCI Data Lake",
175+
},
182176
"oss": {
183177
"class": "ossfs.OSSFileSystem",
184178
"err": "Install ossfs to access Alibaba Object Storage System",
185179
},
186-
"webdav": {
187-
"class": "webdav4.fsspec.WebdavFileSystem",
188-
"err": "Install webdav4 to access WebDAV",
180+
"reference": {"class": "fsspec.implementations.reference.ReferenceFileSystem"},
181+
"root": {
182+
"class": "fsspec_xrootd.XRootDFileSystem",
183+
"err": (
184+
"Install fsspec-xrootd to access xrootd storage system. "
185+
"Note: 'root' is the protocol name for xrootd storage systems, "
186+
"not referring to root directories"
187+
),
189188
},
190-
"dvc": {
191-
"class": "dvc.api.DVCFileSystem",
192-
"err": "Install dvc to access DVCFileSystem",
189+
"s3": {"class": "s3fs.S3FileSystem", "err": "Install s3fs to access S3"},
190+
"s3a": {"class": "s3fs.S3FileSystem", "err": "Install s3fs to access S3"},
191+
"sftp": {
192+
"class": "fsspec.implementations.sftp.SFTPFileSystem",
193+
"err": 'SFTPFileSystem requires "paramiko" to be installed',
193194
},
194-
"hf": {
195-
"class": "huggingface_hub.HfFileSystem",
196-
"err": "Install huggingface_hub to access HfFileSystem",
195+
"simplecache": {"class": "fsspec.implementations.cached.SimpleCacheFileSystem"},
196+
"smb": {
197+
"class": "fsspec.implementations.smb.SMBFileSystem",
198+
"err": 'SMB requires "smbprotocol" or "smbprotocol[kerberos]" installed',
197199
},
198-
"root": {
199-
"class": "fsspec_xrootd.XRootDFileSystem",
200-
"err": "Install fsspec-xrootd to access xrootd storage system."
201-
+ " Note: 'root' is the protocol name for xrootd storage systems,"
202-
+ " not referring to root directories",
200+
"ssh": {
201+
"class": "fsspec.implementations.sftp.SFTPFileSystem",
202+
"err": 'SFTPFileSystem requires "paramiko" to be installed',
203203
},
204-
"dir": {"class": "fsspec.implementations.dirfs.DirFileSystem"},
205-
"box": {
206-
"class": "boxfs.BoxFileSystem",
207-
"err": "Please install boxfs to access BoxFileSystem",
204+
"tar": {"class": "fsspec.implementations.tar.TarFileSystem"},
205+
"wandb": {"class": "wandbfs.WandbFS", "err": "Install wandbfs to access wandb"},
206+
"webdav": {
207+
"class": "webdav4.fsspec.WebdavFileSystem",
208+
"err": "Install webdav4 to access WebDAV",
208209
},
209-
"lakefs": {
210-
"class": "lakefs_spec.LakeFSFileSystem",
211-
"err": "Please install lakefs-spec to access LakeFSFileSystem",
210+
"webhdfs": {
211+
"class": "fsspec.implementations.webhdfs.WebHDFS",
212+
"err": 'webHDFS access requires "requests" to be installed',
212213
},
214+
"zip": {"class": "fsspec.implementations.zip.ZipFileSystem"},
213215
}
214216

215217

fsspec/tests/test_registry.py

+6
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ def clean_imports():
3636
sys.modules["fsspec"] = real_module
3737

3838

39+
def test_sorted_known_implementations():
40+
expected = sorted(known_implementations.keys())
41+
actual = list(known_implementations.keys())
42+
assert actual == expected
43+
44+
3945
def test_registry_readonly():
4046
get_filesystem_class("file")
4147
assert "file" in registry

0 commit comments

Comments
 (0)