On Mar 4, 2:21 am, Giovanni Bajo <[EMAIL PROTECTED]> wrote: > On Mon, 2008-03-03 at 11:59 -0800, [EMAIL PROTECTED] wrote: > > > If I understand you correctly, this "egg entry point" feature probably > > > relies on the .egg metadata information which is lost when packaging > > > with PyInstaller. > > > Exactly, the metadata is key here. So there is a need to keep the egg > > metadata in PyInstaller packaged distributions. > > The simple solution here is to embed the zipped .egg directory (.egg > file) as DATA in PyInstaller, and then, once it's been decompressed in > the temporary directory, put it into the PYTHONPATH. > > Otherwise, we can attempt something more radical. Let's see: normally, > where and when is the egg metadata parsed?
Once pkg_resources is imported, it creates a WorkingSet which scans all entries in the module search path for eggs. For each egg, a Distribution is created. Distributions expose egg metadata such as their entry points, exactly how the metadata are accessed I wasn't able to figure out yet from reading the source. I would think that the Right approach, if the eggs are embedded in the executable, is to write a custom PEP 302 importer (like zipimport.zipimporter) and a corresponding function that is able to scan the executable for eggs . The former is registered by adding it to sys.path_hooks, the latter using pkg_resources.register_finder. The finder is responsible for creating pkg_resources.Distribution instances. This reflects how pkg_resources itself scans directories and zips. Arve --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "PyInstaller" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/PyInstaller?hl=en -~----------~----~----~----~------~----~------~--~---
