[Distutils] setup.py --install-requires?
P.J. Eby
pje at telecommunity.com
Thu Apr 9 07:01:12 CEST 2009
At 04:48 PM 4/8/2009 -0700, Sridhar Ratnakumar wrote:
>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'
Whoops... that should be ['egg_info', '-e', tmpdir]
More information about the Distutils-SIG
mailing list