Skip to content

Commit be083a2

Browse files
committed
just embed it
1 parent a5487f3 commit be083a2

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

fsspec-proxy/fsspec_proxy/file_manager.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,35 @@
22
import fsspec.utils
33
import io
44
import os
5-
import pkgutil
65
import yaml
76
import logging
87

98
logger = logging.getLogger("fsspec_proxy")
10-
9+
default_config = b"""sources:
10+
- name: inmemory
11+
path: memory://mytests
12+
- name: local
13+
path: file:///Users
14+
readonly: true
15+
- name: "Conda Stats"
16+
path: "s3://anaconda-package-data/conda/hourly/"
17+
kwargs:
18+
anon: True
19+
- name: "MyAnaconda"
20+
path: "anaconda://my/"
21+
allow_reload: true
22+
"""
1123

1224
class FileSystemManager:
1325
def __init__(self, config_path=None):
1426
self.filesystems = {}
15-
if config_path is None and "FSSPEC_PROXY_CONFIG" in os.environ:
16-
self.config = self.load_config(os.getenv("FSSPEC_PROXY_CONFIG"))
17-
else:
18-
self.config = self.load_config()
27+
config_path = config_path or os.getenv("FSSPEC_PROXY_CONFIG", None)
28+
self.config = self.load_config(config_path)
1929
self.initialize_filesystems()
2030

2131
def load_config(self, config_path=None):
2232
if config_path is None:
23-
data = pkgutil.get_data(__name__, "config.yaml")
33+
data = default_config
2434
elif not os.path.exists(config_path):
2535
return {}
2636
else:

tests/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def server():
1717
try:
1818
requests.get(f"{s}/health")
1919
break
20-
except Exception:
20+
except BaseException:
2121
if count < 0:
2222
raise
2323
count -= 1

0 commit comments

Comments
 (0)