Module instrospection seems to break EXE build with pyinstaller
markusthegeek opened this issue · 0 comments
markusthegeek commented
I successfully built a one file executable on Windows using Python 3.12 an pyinstaller, however I am getting an error that the value "file" is not valid for progress type. I think the same error happens for source type "mongo" as well.
Is it possible that the way these classes are found via introspection here is too complex for pyinstaller?
Would be great to be able to package both the Meilisearch executable and your great sync tool along with a C++ based end user app that uses MongoDB :-D
def _discover(module: ModuleType, t: Type):
ret = {}
for m in pkgutil.iter_modules(module.__path__):
mod = importlib.import_module(f"{module.__name__}.{m.name}")
for _, member in inspect.getmembers(mod, inspect.isclass):
if issubclass(member, t) and member is not t:
ret[member.type] = member
return ret