(pack_data: PackResponse)
| 66 | |
| 67 | |
| 68 | def 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 | |
| 83 | def fetch_pack_object(pack_data: PackResponse) -> type["Pack"]: |
no test coverage detected