How do I add a develop dependency?

After working in your develop package for a few days, the time has come to integrate it to your deployment instance. So, following the steps in How do I add an egg dependency?, you add the new dependency in your '~/myenv/myinstance/setup.py':

    setup(name='myinstance'
          ...
          install_requires = ['setuptools',
                              ...
                              'mypackage',
                             ],
          ...

then you run buildout and... get an error message!. buildout invocation of easy_install can't find mypackage, which is only logical, since mypackage is a development package which has not been registered anywhere. You have to tell buildout that it shouldn't try to fetch mypackage, that it is already in the hard disk on certain location. So you edit ~/myenv/myinstance/buildout.cfg:

        [buildout]
        develop = .
                  ../mypackage

Now, if you run buildout everything works nice. Again, you'll have to register the package at ~/myenv/myinstance/src/myinstance/configure.zcml:

    <configure xmlns="http://namespaces.zope.org/zope"
      ...
      <include package="mypackage" />
      ...
    </configure>

If you are curious, you can list myinstance/develop-eggs/ on which buildout has created an egg-link file for each develop package you've declared with the path to the package source folder. Those paths end at your myinstance/bin/python script sys.path.



( 97 subscribers )