[Pythonmac-SIG] Building plugins with py2app
Ronald Oussoren
ronaldoussoren at mac.com
Sun Oct 15 22:07:20 CEST 2006
On Oct 15, 2006, at 8:23 PM, Dethe Elza wrote:
> On 15-Oct-06, at 9:26 AM, Ronald Oussoren wrote:
>
>> I've done a clean install of python, py2app, PyObjC and related
>> packages and can now reproduce your problem.
>
> Thanks so much!
>
>> I hope I've also fixed the problem in revision 47 of py2app. It
>> turns out the app stub and bundle stub use a slightly different
>> way to setup the python environment, which means the right python
>> path must be set in the Info.plist for plugins but not for
>> applications.
>
> That did it, it's working beautifully now.
Ok, nice to hear that.
>
>> Setting up the right environment for plugins is also very hard, if
>> not impossible to do completely correct: cpython just isn't
>> designed for having several completely seperate interpreters in
>> one application (and no, Py_NewInterpreter/Py_EndInterpreter don't
>> count). Different plugin bundles with py2app will share part of
>> the environment, such as having a shared sys.path.
>
> So does that mean that I shouldn't run two Python plugins in the
> same program, or that I need to be careful that they have the same
> dependencies, or that the first contains all the dependencies of
> subsequent plugins, or what? I'm just trying to understand here.
If you have two python plugins for the same program they should at
the very least use the same version of python, using different
versions of python may or may not work.
I'd have to study the plugin main code to be absolutely sure, but
AFAIK if plugins A and B both depend on package C they should depend
on the same version of C because at runtime they will both use the
version that's included in whichever of the plugins was loaded first.
If you can arrange for one of the plugins to be loaded first it would
be useful to have that plugin include the Python framework and large
extensions (like PyObjC). That way other plugins can stay very small
and you don't get confusion on what gets loaded.
Ronald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3562 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20061015/6d67d70b/attachment.bin
More information about the Pythonmac-SIG
mailing list