Skip to content

Commit ad22ece

Browse files
remove old plugins
1 parent b588e16 commit ad22ece

File tree

6 files changed

+5
-171
lines changed

6 files changed

+5
-171
lines changed

datajoint/attribute_adapter.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import re
22

33
from .errors import DataJointError, _support_adapted_types
4-
from .plugin import type_plugins
54

65

76
class AttributeAdapter:
@@ -44,11 +43,7 @@ def get_adapter(context, adapter_name):
4443
raise DataJointError("Support for Adapted Attribute types is disabled.")
4544
adapter_name = adapter_name.lstrip("<").rstrip(">")
4645
try:
47-
adapter = (
48-
context[adapter_name]
49-
if adapter_name in context
50-
else type_plugins[adapter_name]["object"].load()
51-
)
46+
adapter = context[adapter_name]
5247
except KeyError:
5348
raise DataJointError(
5449
"Attribute adapter '{adapter_name}' is not defined.".format(

datajoint/connection.py

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from .blob import pack, unpack
1717
from .dependencies import Dependencies
1818
from .hash import uuid_from_buffer
19-
from .plugin import connection_plugins
2019
from .settings import config
2120
from .version import __version__
2221

@@ -27,33 +26,6 @@
2726
cache_key = "query_cache" # the key to lookup the query_cache folder in dj.config
2827

2928

30-
def get_host_hook(host_input):
31-
if "://" in host_input:
32-
plugin_name = host_input.split("://")[0]
33-
try:
34-
return connection_plugins[plugin_name]["object"].load().get_host(host_input)
35-
except KeyError:
36-
raise errors.DataJointError(
37-
"Connection plugin '{}' not found.".format(plugin_name)
38-
)
39-
else:
40-
return host_input
41-
42-
43-
def connect_host_hook(connection_obj):
44-
if "://" in connection_obj.conn_info["host_input"]:
45-
plugin_name = connection_obj.conn_info["host_input"].split("://")[0]
46-
try:
47-
connection_plugins[plugin_name]["object"].load().connect_host(
48-
connection_obj
49-
)
50-
except KeyError:
51-
raise errors.DataJointError(
52-
"Connection plugin '{}' not found.".format(plugin_name)
53-
)
54-
else:
55-
connection_obj.connect()
56-
5729

5830
def translate_query_error(client_error, query):
5931
"""
@@ -177,7 +149,6 @@ class Connection:
177149
"""
178150

179151
def __init__(self, host, user, password, port=None, init_fun=None, use_tls=None):
180-
host_input, host = (host, get_host_hook(host))
181152
if ":" in host:
182153
# the port in the hostname overrides the port argument
183154
host, port = host.split(":")
@@ -190,11 +161,9 @@ def __init__(self, host, user, password, port=None, init_fun=None, use_tls=None)
190161
use_tls if isinstance(use_tls, dict) else {"ssl": {}}
191162
)
192163
self.conn_info["ssl_input"] = use_tls
193-
self.conn_info["host_input"] = host_input
194164
self.init_fun = init_fun
195165
self._conn = None
196166
self._query_cache = None
197-
connect_host_hook(self)
198167
if self.is_connected:
199168
logger.info(
200169
"DataJoint {version} connected to {user}@{host}:{port}".format(
@@ -232,7 +201,7 @@ def connect(self):
232201
**{
233202
k: v
234203
for k, v in self.conn_info.items()
235-
if k not in ["ssl_input", "host_input"]
204+
if k not in ["ssl_input"]
236205
},
237206
)
238207
except client.err.InternalError:
@@ -245,7 +214,7 @@ def connect(self):
245214
k: v
246215
for k, v in self.conn_info.items()
247216
if not (
248-
k in ["ssl_input", "host_input"]
217+
k in ["ssl_input"]
249218
or k == "ssl"
250219
and self.conn_info["ssl_input"] is None
251220
)
@@ -352,7 +321,7 @@ def query(
352321
if not reconnect:
353322
raise
354323
logger.warning("Reconnecting to MySQL server.")
355-
connect_host_hook(self)
324+
self.connect()
356325
if self._in_transaction:
357326
self.cancel_transaction()
358327
raise errors.LostConnectionError(

datajoint/errors.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,12 @@
55
import os
66

77

8-
# --- Unverified Plugin Check ---
9-
class PluginWarning(Exception):
10-
pass
11-
12-
138
# --- Top Level ---
149
class DataJointError(Exception):
1510
"""
1611
Base class for errors specific to DataJoint internal operation.
1712
"""
1813

19-
def __init__(self, *args):
20-
from .plugin import connection_plugins, type_plugins
21-
22-
self.__cause__ = (
23-
PluginWarning("Unverified DataJoint plugin detected.")
24-
if any(
25-
[
26-
any([not plugins[k]["verified"] for k in plugins])
27-
for plugins in [connection_plugins, type_plugins]
28-
if plugins
29-
]
30-
)
31-
else None
32-
)
33-
3414
def suggest(self, *args):
3515
"""
3616
regenerate the exception with additional arguments

datajoint/plugin.py

Lines changed: 0 additions & 46 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,14 @@ dependencies = [
1818
"pydot",
1919
"minio>=7.0.0",
2020
"matplotlib",
21-
"otumat",
2221
"faker",
23-
"cryptography",
2422
"urllib3",
2523
"setuptools",
2624
]
2725
requires-python = ">=3.9,<4.0"
2826
authors = [
2927
{name = "Dimitri Yatsenko", email = "[email protected]"},
30-
{name = "Thinh Nguen", email = "[email protected]"}
28+
{name = "Thinh Nguen", email = "[email protected]"},
3129
{name = "Raphael Guzman"},
3230
{name = "Edgar Walker"},
3331
{name = "DataJoint Contributors", email = "[email protected]"},

tests/test_plugin.py

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)