[Distutils] py2app and eggs part deux

Bob Ippolito bob at redivi.com
Wed Jul 13 06:42:12 CEST 2005


On Jul 12, 2005, at 6:28 PM, Phillip J. Eby wrote:

> At 05:29 PM 7/12/2005 -1000, Bob Ippolito wrote:
>
>> Well, just do the second suggestion then.  "Install" the eggs
>> somewhere, unzipped, and make sure it's on sys.path during setup.py.
>> Maybe you could crank the ez_setup wheels (or whatever module is
>> appropriate, I haven't looked at eggs yet) at the top of your
>> setup.py and automate this.
>>
>
> Well, if it just has to be on sys.path during setup.py, then it  
> should be working now, shouldn't it?  I mean, if he installed them  
> to Python's site-packages.  In the alternative, he could create a  
> wrapper command that calls require("project==version") to find all  
> the eggs and put them on sys.path.

Like modulefinder, modulegraph doesn't know anything about fancy PEP  
302 stuff yet.

> So, I guess my suggestion to Kevin is to try installing to a  
> directory on sys.path, using the new --always-unzip option to force  
> the packages to be unzipped, and then try hacking py2app to do a  
> require() before looking for dependencies (consulting the  
> setuptools "test" command for an example).

I'm not sure you'd really want to hack py2app anyway, just the  
setup.py before setup() is called.

> I suspect this means that the packages will get merged into one  
> another with no distinction at runtime, but whatever works, works.

Yeah, I'm not sure why you would possibly care about this at runtime  
for an application that's "frozen", anyway.

> One interesting thing that eggs do, however, in the problem of  
> module-finding is that they potentially reduce the question to one  
> of just identifying what portions of the standard library each egg  
> uses, which in some ways is a significantly easier problem because  
> import tricks (e.g. dynamic imports, exec's, etc.) involving the  
> standard library occur far less often.  It might be worth adding  
> something modulegraph-ish to setuptools to support this, although  
> it's not at the top of my list right now.

Modulegraph should already know about all of the tricks in the stdlib  
(at least in 2.3, not sure if I updated it for 2.4) including the  
modules that are imported by the core behind your back (warnings,  
etc.)..  It doesn't contain anything py2app specific, it might as  
well be used as-is.

http://svn.red-bean.com/bob/py2app/trunk/src/
(modulegraph depends on altgraph, the other stuff you can ignore)

-bob



More information about the Distutils-SIG mailing list