[Distutils] [buildout[ How do I use stuff specified in the distutils.command entry_point?

Reinout van Rees reinout at vanrees.org
Tue Sep 8 21:36:20 CEST 2009

On 2009-09-08, Chris Withers <chris at simplistix.co.uk> wrote:
> Hi All,
> Sphinx, among others, provides command in this entry point.
> With this buildout:
> [buildout]
> parts = sphinx
> [sphinx]
> recipe = zc.recipe.egg
> eggs = sphinx
> And based on the entry points listed here:
> http://bitbucket.org/birkenfeld/sphinx/src/447109cf9b01/setup.py#cl-182
> I'd expect to be able to do:
> $ bin/buildout setup setup.py build_sphinx
> But I get:
> Running setup script 'setup.py'.
> usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
>     or: setup.py --help [cmd1 cmd2 ...]
>     or: setup.py --help-commands
>     or: setup.py cmd --help
> error: invalid command 'build_sphinx'
> Any ideas?

Yes: "bin/buildout setup setup.py something" tells buildout to run the
"something" command with the setup.py in the current directory. And that won't
be sphinx' setup.py.

Secondly: such an console_scripts entry point only tells setuptools (and
buildout) to install that script in the bin directory.  It is not an extra
setup.py command (like "sdist" and "build").  For that, you need a different
entry point.

When I just take your example buildout and run it, I get the expected result

$> bin/buildout
Installing sphinx.
Getting distribution for 'sphinx'.
Got Sphinx 0.6.3.
Generated script '/private/tmp/bbb/bin/sphinx-build'.
Generated script '/private/tmp/bbb/bin/sphinx-quickstart'.
Generated script '/private/tmp/bbb/bin/sphinx-autogen'.

So buildout installs the three defined console_scripts just fine in the bin/


Reinout van Rees - reinout at vanrees.org - http://reinout.vanrees.org
Software developer at http://www.thehealthagency.com
"Military engineers build missiles. Civil engineers build targets"

More information about the Distutils-SIG mailing list