[Distutils] setup.py --install-requires?
Sridhar Ratnakumar
sridharr at activestate.com
Thu Apr 9 01:48:49 CEST 2009
On 08/04/09 02:53 PM, P.J. Eby wrote:
> Something like this should do the trick:
>
> import tempfile, os.path
> from setuptools.sandbox import run_setup
>
> def get_requires(setup_dir, empty_tmpdir):
> tmpdir = tempfile.mkdtemp(prefix="egginfotmp-")
> run_setup(os.path.join(setup_dir,'setup.py'), ['-e', tmpdir])
> for dist in pkg_resources.find_distributions(tmpdir, True):
> return dist.requires()
> else:
> raise RuntimeError("egg_info didn't work")
That doesn't look like very reliable. It failed with both zc.catalog[1]
and pip[2].
[1] error: option -e not recognized
[2] IOError: No such file or directory: 'pip-0.3.1/docs/index.txt'
More information about the Distutils-SIG
mailing list