[Pythonmac-SIG] Zope py2app, some progress

Bob Ippolito bob at redivi.com
Thu Feb 10 00:35:28 CET 2005


On Feb 3, 2005, at 7:58 PM, Richard Jones wrote:

> On Fri, 4 Feb 2005 01:34 am, Bob Ippolito wrote:
>> No, py2app just doesn't give you a regular Python interpreter.. so,
>> that's a problem I guess.  I'm not sure what to suggest.
>
> Yep, looks like it's the killer for the py2app'ed Zope.
>
> I'm going to investigate another approach of using os.system() to 
> control
> Zope, but that's not nearly as nice as it doesn't let me at the zdaemon
> control code directly (I'll have to parse shell command output 
> instead) and
> bundle a second Python interpreter with the app.

The current svn trunk of py2app is probably suitable for this.  It now:
- Strips by default.  -S and --strip are still there for compatibility, 
but they are a no-op (does anyone care if I remove this compatibility?)
- Scans the bundle for any Mach-O file and rewrites it
- Now you don't have to care about making py2app aware of every 
extension if you setup the sys.path property.. but you will still need 
to make sure everything used from the stdlib ends up in there because 
it special cases this and makes a "minimal" Python.framework, so it's 
still a good idea to do this.
- Adds a Python interpreter to the bundle to where sys.executable is 
(only supported for framework builds right now)

In order to run this sub-interpreter, you will probably need to be 
careful about setting up sys.path via PYTHONPATH, PYTHONHOME, etc.  I 
have yet to develop a full example to test the functionality, but will 
probably have one soon.

If you want to make sure the right libraries/extensions get loaded, I 
suggest running the app with the DYLD_PRINT_LIBRARIES environment 
variable set to make sure it doesn't pull anything out of 
/Library/Frameworks/Python.framework

-bob



More information about the Pythonmac-SIG mailing list