The arguments originally being passed into sphinx.apidoc specified '.' as the path to index. Unfortunately this includes the setup.py module. Sphinx dies while trying to process the setup.rst likely because the setup.py module calls setuptools.setup() when imported causing some sort of recursion. The final result is something like:
2013-12-08 21:08:12.088 | reading sources... [ 80%] api/setup
2013-12-08 21:08:12.100 | /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'setup_requires'
2013-12-08 21:08:12.101 | warnings.warn(msg)
2013-12-08 21:08:12.102 | /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'pbr'
2013-12-08 21:08:12.102 | warnings.warn(msg)
2013-12-08 21:08:12.103 | usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
2013-12-08 21:08:12.103 | or: setup.py --help [cmd1 cmd2 ...]
2013-12-08 21:08:12.104 | or: setup.py --help-commands
2013-12-08 21:08:12.104 | or: setup.py cmd --help
2013-12-08 21:08:12.104 |
2013-12-08 21:08:12.105 | error: invalid command 'build_sphinx'
2013-12-08 21:08:12.622 | ERROR: InvocationError: '/home/jenkins/workspace/gate-keystone-docs/.tox/venv/bin/python setup.py build_sphinx'
Adding Keystone to make sure we update our code to use this when committed and remove the temporary extension.