[Pythonmac-SIG] Question about py2app packages and includes options

Michael McCracken michael.mccracken at gmail.com
Wed Jul 18 18:56:51 CEST 2012


On Wed, Jul 18, 2012 at 11:14 AM, Chris Barker <chris.barker at noaa.gov> wrote:
> On Tue, Jul 17, 2012 at 3:49 PM, Michael McCracken
> <michael.mccracken at gmail.com> wrote:
>
>> That makes sense - but as you mention, it seems like there's some
>> missing functionality.
>
> I think so, yes, but it can get the job done.
>
>> However, it's no fun if you have a lot of subpackages to add that way.
>
> nope -- but for the most part they are picked up by regular imports,
> anyway. You only need to do this if there are some dynamic importing
> in your code -- and in that case, it's likely you'll want the whole
> package anyway.

In my (probably unusual) situation, it's not dynamic imports: I have
these helper apps that I'm including in the main app bundle. I wanted
to have their Frameworks and lib directories just be symlinks to the
top level, which then had to have the sum of all the modules.

The modules the sub-apps use are picked up and put in the zip just
fine when they're built separately, but I need to put those modules in
the toplevel .zip. I was looking for a nice way to do that from the
options, but that's the specific thing that's missing.

That said, the code to just directly merge the zips and lib-dynload
directories was pretty straightforward and seems to be working well.

If anyone else ever has a similar need, I'd be happy to share it.

-mike

>
> --
>
> Christopher Barker, Ph.D.
> Oceanographer
>
> Emergency Response Division
> NOAA/NOS/OR&R            (206) 526-6959   voice
> 7600 Sand Point Way NE   (206) 526-6329   fax
> Seattle, WA  98115       (206) 526-6317   main reception
>
> Chris.Barker at noaa.gov


More information about the Pythonmac-SIG mailing list