Skip to content

Commit 465f7e6

Browse files
committed
modify manager entrypoint
1 parent ef2a970 commit 465f7e6

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

jupyter_drives/base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@
77
# Supported third-party services
88
MANAGERS = {}
99

10+
# Moved to the arhitecture of having one provider independent manager.
11+
# Keeping the loop in case of future developments that need this feature.
1012
for entry in entrypoints.get_group_all("jupyter_drives.manager_v1"):
1113
MANAGERS[entry.name] = entry
1214

15+
# Supported providers
16+
PROVIDERS = ['s3', 'gcs', 'http']
17+
1318
class DrivesConfig(Configurable):
1419
"""
1520
Allows configuration of supported drives via jupyter_notebook_config.py
@@ -65,7 +70,7 @@ def set_default_api_base_url(self):
6570
return "https://www.googleapis.com/"
6671

6772
provider = Enum(
68-
MANAGERS.keys(),
73+
PROVIDERS,
6974
default_value="s3",
7075
config=True,
7176
help="The source control provider.",

jupyter_drives/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def setup_handlers(web_app: tornado.web.Application, config: traitlets.config.Co
9999
log = log or logging.getLogger(__name__)
100100

101101
provider = DrivesConfig(config=config).provider
102-
entry_point = MANAGERS.get(provider)
102+
entry_point = MANAGERS.get('drives_manager')
103103
if entry_point is None:
104104
log.error(f"JupyterDrives Manager: No manager defined for provider '{provider}'.")
105105
raise NotImplementedError()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ test = [
4343
]
4444

4545
[project.entry-points."jupyter_drives.manager_v1"]
46-
s3 = "jupyter_drives:get_manager"
46+
drives_manager = "jupyter_drives:get_manager"
4747

4848
[tool.hatch.version]
4949
source = "nodejs"

0 commit comments

Comments
 (0)