Search code examples
pythonipythonbuildout

Generating an IPython script in a zc.buildout


I use IPython all the time here on my machine instead of the default Python interpreter because it has a lot more features and generally feels more powerful. I'd like to use it in my zc.buildout project as an intepreter in the bin directory like the generated Python interpreter generated created by this section in buildout.cfg:

[python]
recipe = zc.recipe.egg
interpreter = python
eggs = ${buildout:eggs}

This generates a script in bin/python which is a Python interpreter with access to all of my project dependencies.

I wanted to do the same with IPython and with a quick Google gave me the following Buildout recipe:

[ipython]
recipe = zc.recipe.egg
eggs = ipython
script = ipython

However, this doesn't generate an IPython interpreter in bin, it seems to not really do anything.

How can I generate a IPython interpreter for my buildout?


Solution

  • This should work fine:

    [ipython_part]
    recipe = zc.recipe.egg:scripts
    eggs = ${buildout:eggs}
           ipython
    scripts = ipython
    

    Don't forget to add the part to buildout:

    [buildout]
    parts = something something_else ipython_part
    

    Other scripts available in IPython 0.13: iplogger, iptest, ipcluster, pycolor, ipcontroller, irunner, ipengine.