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

Ronald Oussoren ronaldoussoren at mac.com
Thu Oct 20 11:35:00 CEST 2011


On 20 Oct, 2011, at 10:58, carbncl wrote:

> Hi,
> 
> First of all, not being experienced with python, my apologies if this question answer was obvious, but I couldn't find a clear answer / solution to this.
> 
> I'm currently trying to package a pyGtk application as an OSX one.
> This application is distributed as an egg and use pkg_resources facilities to get things like app version and glade resources.
> Having pkg_resources errors, from what I understand and found searching and reading this mailing list, I came to the following conclusions:
> 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. Either way you have to ensure that the resource files
get copied into the application bundle.

The "proper" solution is to teach py2app how to copy eggs with their metadata and resources into the 
application bundle. That's on my todo list, but I don't know when I'll get around to actually implementing this.

Ronald

> 
> Vincent.
> _______________________________________________
> 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 --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20111020/a9ccaa14/attachment.html>
-------------- 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/20111020/a9ccaa14/attachment.bin>


More information about the Pythonmac-SIG mailing list