[Distutils] Egg depency order

Phillip J. Eby pje at telecommunity.com
Mon Jan 14 15:45:29 CET 2008


At 12:40 PM 1/14/2008 +0200, Iwan Vosloo wrote:
>Hi there,
>
>I need to get a list of eggs in 'dependency' order: a list with eggs
>(Distribution objects?) which is sorted so that earlier entries will
>never depend on entries later in the list. [1]
>
>I spotted the _dep_map attribute on Distribution objects and it seems to
>have something like that already.
>
>Exactly what is in _dep_map? Could I use it to compute what I need?

No.  Use the .requires() method of a distribution instead, to get its 
immediate requirements, and then you'll need to do your own sort.

Please see http://peak.telecommunity.com/DevCenter/PkgResources for 
the full pkg_resources API.  There's no need for you to mess with 
private attributes for this stuff.


>[1] In fact, this is an intermediary result - I want to compute all the
>entry points of a tree of dependencies in such a way that the entry
>points of eggs deeper in the tree will always be earlier in the list
>than entry points for those shallower in the tree.

Why?



More information about the Distutils-SIG mailing list