[Distutils] Setuptools: build_requires?

Phillip J. Eby pje at telecommunity.com
Wed Aug 13 22:51:38 CEST 2008


At 10:31 PM 8/13/2008 +0200, Jeroen Ruigrok van der Werven wrote:
>So I am curious, why doesn't setuptools provide a build_requires 
>directive similar to install_requires, but for python setup.py 
>build? Right now a particular Python module will fail if you import 
>said dependency somewhere in your code. Centralizing such a 
>dependency in setup.py seems, to me, very logical. So what gives? -- 
>Jeroen Ruigrok van der Werven

 From 
http://peak.telecommunity.com/DevCenter/setuptools#new-and-changed-setup-keywords 
:

"""setup_requires

A string or list of strings specifying what other distributions need 
to be present in order for the setup script to run. setuptools will 
attempt to obtain these (even going so far as to download them using 
EasyInstall) before processing the rest of the setup script or 
commands. This argument is needed if you are using distutils 
extensions as part of your build process; for example, extensions 
that process setup() arguments and turn them into EGG-INFO metadata files.

(Note: projects listed in setup_requires will NOT be automatically 
installed on the system where the setup script is being run. They are 
simply downloaded to the setup directory if they're not locally 
available already. If you want them to be installed, as well as being 
available when the setup script is run, you should add them to 
install_requires and setup_requires.)"""

(Note, by the way, that this doesn't allow you to import those 
dependencies at the top level of your setup script; the imports have 
to take place in command classes at the moment.)



More information about the Distutils-SIG mailing list