On 4/27/06, Jonathan LaCour <[EMAIL PROTECTED]> wrote:
>
> Kevin Dangoor wrote:
> > I've done it (Zesty News). If you look on the py2exe wiki, there's a
> > page that describes the basic process. py2exe (and py2app) don't do
> > eggs yet, so my process generally involves expanding out the eggs,
> > then pruning the modules in the eggs from the .zip file created by
> > py2exe, finally dropping the eggs in place next to the .exe file.
>
> I looked at the page and tried using some of the snippets of code,
> but the first one has a variable called "eggdir" that doesn't exist,
> and is using some modules (os, sys) that aren't being imported in the
> script.  I put step one and two's code into a file called
> "buildinit.py" and step five's code into a file called
> "buildfinish.py".  I assume the process is basically "python
> buildinit.py && python setup.py py2exe && python buildfinish.py" ??
>
> Also, I am confused about the mystical step three.  You say:
>
>     "add all of the files in the eggs to the data_files, so that the
>      eggs are installed along side the main exe"
>
> ... which eggs?  The ones that we expanded into "eggdir"?  The ones
> in site-packages?  Both?
>
> Sorry for being so dense!

That recipe is not very well fleshed out. My problem was that chunks
of that script were fairly Zesty specific.

I believe you are correct that eggdir is just a place you expand eggs to.

import pkg_resources
eggs = pkg_resources.require("YourPackage")

from setuptools.archive_util import unpack_archive

for egg in eggs:
    if os.path.isdir(egg.location):
        sys.path.insert(0, egg.location)
        continue
    unpack_archive(egg.location, eggdir)

As long as your package has the install_requires set, eggs should be a
nice list of the distributions. I can't guarantee that egg.location is
the right thing to check at present, because that was an old piece of
code I just looked at.

Kevin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to