setup_requires directive allows specification of requirements to run setup. These dependencies can include plugins for distribute itself (such as pytest-runner which adds the 'ptr' command) or supply file-finder functionality such as hgtools does.
Because this directive adds functionality early in the process, necessarily must run early in the execution of setup(). Thus, it must be run before parameters to easy_install, install, or develop options (which might supply parameters for a custom index, --index-url or similar).
As a result, it's not possible to pass options on the command line to direct setup_requires to be resolved from anything but the default index. Furthermore, if the default cheeseshop is not reachable or the setup_requires package isn't available on the default cheeseshop, a setup_requires directive will prevent setup from running any commands.
There are techniques in which setup_requires can resolve dependencies from another cheeseshop:
- Install distutils.cfg in the environment-wide library and indicate the index there. This will affect all packages installed into that environment, including setup_requires.
- Use a local setup.cfg and declare the index_url there. This will affect only the installation of the local project, but it could cause mutation of a SCM-managed file, mutating the working copy. It's even possible to create/configure such a file with the setopt command:
python2.7 -c "import setuptools; setuptools.setup()" setopt -c easy_install -o index-url -s http://mycheese.example.com
There may be other techniques to work around this limitation. If you can think of one, please list it here. I don't believe, however, there is any workaround that can be applied to the command line in question (i.e. while invoking setup.py install).
It would be nice if there was a way to pass parameters (on the command-line) to the easy_install command before setup_requires is invoked.