[Pythonmac-SIG] py2app: how to force packages into application bundle?

Joe Losco joelosco at frontiernet.net
Mon Sep 15 17:36:45 CEST 2008


On Sep 15, 2008, at 10:36 AM, weddingmusic at partybombe.de wrote:
>
> setup.py looks like this:
> [code]
> from setuptools import setup
>
> APP = ['myApp.py']
> DATA_FILES = []
> OPTIONS = {'argv_emulation': True}
>
> setup(
>    app=APP,
>    data_files=DATA_FILES,
>    options={'py2app': OPTIONS},
>    setup_requires=['py2app'],
> )
> [/code]
>

I had an app that I needed to include other modules.  I think you need  
to add some lines to your options area of your setup.py.
You have the argv_emulation but not site_packages which allows your  
Pythonpath to be explored or the specific packages that you wish to  
include specifically.

My Setup.py file is included below for reference.   I made mine a kind  
of default that I include in my packages that I only really need to  
modify a couple of variable for my builds.
Hope this helps some.

Joe Losco



#!/usr/bin/env python
"""
setup.py - script for building MyApplication

Usage:
     % python setup.py py2app
"""
from distutils.core import setup
import py2app
from plistlib import Plist
import os

name = 'CalendarSync'
version = '1.0.0'
Icon = name+".icns"

# Build the .app file
setup(
     app=[ name + '.py' ],
     options=dict(
         py2app=dict(
             iconfile=Icon,
             packages=['wx','appscript'],
             site_packages=True,
             resources=['resources/COPYING',Icon],
             plist=dict(
                 CFBundleName               = name,
                 CFBundleShortVersionString = version,     # must be  
in X.X.X format
                 CFBundleGetInfoString      = name+" "+ version,
                 CFBundleExecutable         = name,
             ),
         ),
     ),

)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20080915/672387c3/attachment.htm>


More information about the Pythonmac-SIG mailing list