[Pythonmac-SIG] [py2app] packaging an egg using pkg_resources

Ronald Oussoren ronaldoussoren at mac.com
Thu Oct 27 08:02:16 CEST 2011


On 26 Oct, 2011, at 20:46, Chris.Barker wrote:

> On 10/23/11 10:52 PM, Ronald Oussoren wrote:
>>>> 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 wasn't clear -- I agree that copying the egg into the bundle is the best solution for py2app itself.
> 
> I was arguing that it would be better to not use setuptools features in that way at all -- but if they're used, it's nice for py2app to support them.
> 
> 
>>> 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.
> 
> I guess what I think causes difficulties is data files required by a third-party package, rather than the one my app uses -- I don't have any issue with data files for my app -- it's the ones in third party packages that you then need to install properly with py2app or py2exe -- that's a pain.

That's one thing that setuptools tries to solve: the egg should contain all data and pkg_resources provides an API to get at the data without having to assume that they are at a fixed location in the filesystem. In theory this means py2app can stuff all code into the site-packages.zip file while storing resources as files without breaking application code. That would likely break existing code though.

Distutils2/packaging has a simular (but different) solution to the same problem.

Ronald

> 
> -CHB
> 
> 
> 
> -- 
> 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
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG at python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig
> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4788 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20111027/28c378cd/attachment.bin>


More information about the Pythonmac-SIG mailing list