On 20 Oct, 2011, at 17:38, Chris Barker wrote:

> On 10/20/2011 2:35 AM, Ronald Oussoren wrote:
>>>  * py2app is not designed to use eggs
>> 
>> That's corrrect. Py2app currently does not copy egg metadata into the
>> application bundle.
>> 
>>>  * pkg_resources requires a distribution format like eggs to have the
>>>    required metadata to introspect a package.
>> 
>> That's correct as well.
>> 
>>> 
>>> Does this assumptions are true? > Does that means I have to purge code
>>> from pkg_resources calls?
>>> Any good suggestion / recommended implementation is welcome.
>> 
>> The easiest solutions are to either remove pkg_resources calls, or add
>> custom pkg_resources.py file that
>> loads the resource data without using setuptools metadata.
> 
> actually, even easier is to copy the full eggs into your app bundle by hand 
> (by hand I mean code in your setup.py) -- a bit ugly, but it works.
> 
>> The "proper" solution is to teach py2app how to copy eggs with their
>> metadata and resources into the
>> application bundle.
> 
> That would be nice, but I don't know that it's really the "best" solution.

Eggs exist and py2app should support them, otherwise people have to resort to 
ugly workarounds like copying files manually.  Adding an option for copying a 
set of eggs into the application bundle would be fairly easy.

> 
> I've dealt with this for an app that was heavily dependent on setuptools 
> features like pkg_resources, and I think setuptools is really pretty ugly, at 
> least when you want to use things like py2app and friends.
> 
> The assumption that you're packages are fully installed as part of a nice big 
> python install is really built in, so the only solution is to copy huge 
> chunks of stuff, much of which you don't need, into your app bundle -- 
> whether py2app does this automatically, or you do it in your scripts, it's 
> still a lot of extra stuff.

That can be a problem, especially with older codebases that haven't been split 
into a number of smallish packages.

> 
> Personally, I like setuptools for install time stuff, but not so much for run 
> time stuff -- if you can avoid run time calls to setuptolls, I would.
> 
> AS for resources, personally I like to use python files for data -- and then 
> "import" to get it - this makes for nice, clean integeration with py2app, etc.

I use python files for resources on Windows to get single-file executables with 
py2exe, but prefer to use real data files on OSX for easier maintenance.  

Ronald

> 
> -Chris
> 
> -- 
> 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.bar...@noaa.gov
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig
> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG

Reply via email to