Search code examples
pythonbuildout

Buildout and zc.recipe.egg - specifying egg download URL directly?


zc.recipe.egg allows you to install any egg and its script with buildout.

However, zc.recipe.egg relies on find-links and index behavior, inherit from setuptools I guess. It would like to take an egg server / HTML for scanning.

What if I just want to point zc.recipe.egg to a egg direct download URL how would I do that? Looks like putting it to find-links is no go.


Solution

  • Putting the direct egg link in find-links works just fine, but you must remember to also pin the version of the egg.

    What happens is that the link you provide for the egg is taken into consideration as one option. If buildout finds a newer version of the egg elsewhere, it'll ignore the directly linked version still.

    Example, no version pin:

    [buildout]
    parts = i18ndude
    find-links = http://pypi.python.org/packages/source/i/i18ndude/i18ndude-3.1.3.zip
    
    [i18ndude]
    recipe = zc.recipe.egg
    eggs = i18ndude
    
    $ bin/buildout -N
    Installing i18ndude.
    Getting distribution for 'i18ndude'.
    Got i18ndude 3.2.2.
    Generated script '/private/tmp/test/bin/i18ndude'.
    $ grep i18ndude- bin/i18ndude
        '/Users/mj/Development/.buildout/eggs/i18ndude-3.2.2-py2.6.egg',
    

    With a version pin:

    [buildout]
    parts = i18ndude
    find-links = http://pypi.python.org/packages/source/i/i18ndude/i18ndude-3.1.3.zip
    versions = versions
    
    [versions]
    i18ndude = 3.1.3
    
    [i18ndude]
    recipe = zc.recipe.egg
    eggs = i18ndude
    
    $ bin/buildout -N
    Updating i18ndude.
    Getting distribution for 'i18ndude'.
    Got i18ndude 3.1.3.
    Generated script '/private/tmp/test/bin/i18ndude'.
    $ grep i18ndude- bin/i18ndude
        '/Users/mj/Development/.buildout/eggs/i18ndude-3.1.3-py2.6.egg',