MCPcopy Create free account
hub / github.com/AutoPackAI/autopack / find_module

Function find_module

autopack/utils.py:68–80  ·  view source on GitHub ↗
(pack_data: PackResponse)

Source from the content-addressed store, hash-verified

66
67
68def find_module(pack_data: PackResponse) -> ModuleType:
69 autopack_dir = find_or_create_autopack_dir()
70 package_path = pack_data.package_path
71 pack_module_path = os.path.join(autopack_dir, extract_unique_directory_name(pack_data.repo_url))
72
73 sys.path.insert(0, autopack_dir)
74 sys.path.insert(0, pack_module_path)
75
76 try:
77 return importlib.import_module(package_path)
78 finally:
79 sys.path.remove(autopack_dir)
80 sys.path.remove(pack_module_path)
81
82
83def fetch_pack_object(pack_data: PackResponse) -> type["Pack"]:

Callers 1

fetch_pack_objectFunction · 0.85

Calls 2

Tested by

no test coverage detected