jorenham / mainpy

Simplify your project's main entrypoint definition with @main
https://pypi.org/project/mainpy/
MIT License
7 stars 2 forks source link

Added support for running externally defined functions #1

Closed wolph closed 1 year ago

wolph commented 1 year ago

Libraries such as typer define app in a different file so we cannot normally use mainpy.main(app) anymore. With this patch we read the current call stack to see if we're still being called from the __main__ module

wolph commented 1 year ago

I've re-merged the pyproject.toml. Apparently git f'ed up again :P