Hello.

I've written a Buildout recipe which relies on a function defined in a
package whose name is set in the recipe's options. That package must
have already been installed.

According to the documentation, I should use
zc.buildout.easy_install:install() like this:
    install(["mydistribution"], None)

But if I use None, I get an exception because Buildout tries to use
.startswith() with None. Then, if instead of None, I use
buildout['buildout']['directory'], it tries to install the distribution
pulling all its dependencies (ignoring the fact I set a download cache
in ~/.buildout/default.cfg).

I just want to make a package available in sys.path. How should I do
that from a Buildout recipe?

Note I really just want to add it sys.path, not get the actual
function/module, because it's going to be used by a function called from
my recipe, not by my recipe.

The following code illustrates how the recipe will look like:

====
class MyRecipe(object):
    def __init__(self, buildout, name, options):
        self.the_package = options['package']

    def install(self):
        add_to_sys_path(self.the_package)
        do_something_useful(self.the_package)
        return ()
====

I'm using zc.buildout 1.4.3.

Thanks in advance.

-- 
Gustavo Narea.
Software Developer.
2degrees, Ltd. <http://www.2degreesnetwork.com/>.

_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to