Closed Mandera closed 2 years ago
https://docs.python.org/3/library/importlib.html#importlib.abc.Loader.create_module
Existing importers just to study
from _distutils_hack import DistutilsMetaFinder from pkg_resources.extern import VendorImporter from setuptools.extern import VendorImporter from setuptools._vendor.importlib_metadata import MetadataPathFinder
Minimal new Importer structure
class Importer: def find_spec(self, fullname, path=None, target=None): return importlib.util.spec_from_loader(fullname, self) def create_module(self, spec): pass def exec_module(self, module): pass
Worked smoothly! Feels a bit faster as well: d108fb30abddb61d9b79a7c677c3daf12fb15b80
https://docs.python.org/3/library/importlib.html#importlib.abc.Loader.create_module
Existing importers just to study
Minimal new Importer structure