Bundle a Python app as a single file to support add-ons or extensions?
Posted
by Brandon Craig Rhodes
on Stack Overflow
See other posts from Stack Overflow
or by Brandon Craig Rhodes
Published on 2010-05-20T19:04:51Z
Indexed on
2010/05/20
19:30 UTC
Read the original article
Hit count: 413
There are several utilities — all with different procedures, limitations, and target operating systems — for getting a Python package and all of its dependencies and turning them into a single binary program that is easy to ship to customers:
- http://wiki.python.org/moin/Freeze
- http://www.pyinstaller.org/
- http://www.py2exe.org/
- http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html
My situation goes one step further: third-party developers will be wanting to write plug-ins, extensions, or add-ons for my application. It is, of course, a daunting question how users on platforms like Windows would most easily install plugins or addons in such a way that my app can easily discover that they have been installed. But beyond that basic question is another: how can a third-party developer bundle their extension with whatever libraries the extension itself needs (which might be binary modules, like lxml) in such a way that the plugin's dependencies become available for import at the same time that the plugin becomes available.
How can this be approached? Will my application need its own plug-in area on disk and its own plug-in registry to make this tractable? Or are there general mechanisms, that I could avoid writing myself, that would allow an app that is distributed as a single executable to look around and find plugins that are also installed as single files?
© Stack Overflow or respective owner