[Distutils] setup.py --install-requires?

Andrew Straw strawman at astraw.com
Wed Apr 8 22:35:23 CEST 2009


Sridhar Ratnakumar wrote:
> Is it possible to get the value of install_requires for an arbitrary
> package without having to parse setup.py?
> 
> I see that --name, --version, --description, --provides, and so on are
> available as an argument to setup.py, but --install-requires is missing.
> Why?
> 
> For example, zc.catalog declares these dependencies in its setup.py
> 
>       install_requires=['ZODB3',
>                         'pytz',
>                         'setuptools',
>                         'zope.catalog',
>                         'zope.container',
>                         'zope.component',
>                         'zope.i18nmessageid',
>                         'zope.index>=3.5.1',
>                         'zope.interface',
>                         'zope.publisher',
>                         'zope.schema',
>                         'zope.security',
>                         ],
> 
> Is it possible to reliably get this list in a custom Python code without
> having to parse setup.py?

stdeb does it like this:

install_requires = \
  open(os.path.join(egg_info_dirname,'requires.txt'),'rU').read()



More information about the Distutils-SIG mailing list