Skip to content

Commit

Permalink
add python version dependency in finding plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
cloud-rocket committed Sep 29, 2023
1 parent 7eef5c3 commit 3bf984b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/data_agent/connection_manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import sys
from importlib.metadata import entry_points

from .exceptions import (
Expand Down Expand Up @@ -94,7 +95,10 @@ def reset(self):

@staticmethod
def list_plugins():
return entry_points().get("data_agent.connectors", [])
if sys.version_info[:3] < (3, 10):
return entry_points().get("data_agent.connectors", [])

return entry_points(group="data_agent.connectors")

@staticmethod
def list_supported_connectors():
Expand All @@ -103,7 +107,7 @@ def list_supported_connectors():
"category": entry.load().CATEGORY,
"connection_fields": entry.load().list_connection_fields(),
}
for entry in entry_points().get("data_agent.connectors", [])
for entry in ConnectionManager.list_plugins()
}

def target_info(self, target_host, conn_type):
Expand Down

0 comments on commit 3bf984b

Please sign in to comment.