[Distutils] How to get list of package requirements from PyPI without downloading egg?

Phillip J. Eby pje at telecommunity.com
Thu Oct 26 07:51:39 CEST 2006


At 12:39 AM 10/26/2006 -0400, Tim Cera wrote:
>Hello,
>
>I want the list of package requirements, which I hoped would be real
>simple, but have not been able to find a good solution.
>
>I could download the egg and look in the EGG_INFO directory, but is
>there any way to have setuptools develop the list for me?

Use the pkg_resources module, specifically the requires() method of 
Distribution objects:

http://peak.telecommunity.com/DevCenter/PkgResources#distribution-methods

Here are some ways to obtain Distribution objects:

http://peak.telecommunity.com/DevCenter/PkgResources#getting-or-creating-distributions


>  And
>hopefully not have to download the egg.

No, sorry, you have to have the egg to extract its requirements.


>If the above idea doesn't go anywhere - is it possible that the package
>requirements could be added to CheeseShop's XMLRPC?

Requirements can be Python version and platform-specific, so I'm afraid 
this can't be reasonably captured in a Cheeseshop entry at the present time.



More information about the Distutils-SIG mailing list