meilisync icon indicating copy to clipboard operation
meilisync copied to clipboard

Module instrospection seems to break EXE build with pyinstaller

Open markusthegeek opened this issue 1 year ago • 0 comments

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

markusthegeek avatar Dec 03 '23 02:12 markusthegeek