How can I ask setup.py to list dependencies?
You can get distutils
to read setup.py
and return you the dependencies. The command distutils.core.run_setup
allows you to run setup.py
in a controlled environment:
import distutils.core
setup = distutils.core.run_setup("setup.py")
print(setup.install_requires)
The Python variable setup
has a set of properties which allow you to poke setup.py
python setup.py egg_info
will write a package_name.egg-info/requires.txt
file which contains the dependencies you want.