Question

Buildout seems to have always just worked™ in the past, but I can't seem to get it to download my dependencies this go-around. Here's my buildout.cfg:

[buildout]
parts = python_section
develop = .
eggs = buildoutstarter
versions = versions

[versions] 

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

Here's my setup.py:

#!/usr/bin/env python

from setuptools import setup, find_packages

setup(
    name = "buildoutstarter",
    version = "0.1.0",
    license = "LGPL",
    packages = find_packages('src'),
    package_dir = { '': 'src'},
    install_requires = ['setuptools',
        'jinja2',
    ],
)

Unfortunately, running bin/buildout doesn't seem to download Jinja at all. In fact, running find . -iname "*jinja*" doesn't yield anything, so it's apparent that Buildout isn't doing anything with the package. Why isn't it downloading the package?

Was it helpful?

Solution

Buildout will use packages already installed in your python site-packages unless you tell it not to:

include-site-packages = false

include-site-packages is set to true by default.

You can also whitelist what packages are allowed to be satisfied from your site-packages:

include-site-packages = true
allowed-eggs-from-site-packages = jinja2,mako

Which would only allow the jinja2 and mako packages to be taken from your site-packages but nothing else.

allowed-eggs-from-site-packages supports globs and is set to * by default.

OTHER TIPS

Buildout is actually a bit 'smarter' than I had originally thought. Since the dependency 'jinja2 == 2.6' was already satisfied on my machine, it simply created a link to that package, which is why it didn't download it. Interesting.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top