views:

95

answers:

2

I have a project called Foo/ that has buildout.cfg and setup.py. Now there is another project called Bar/ .. which too has buildout.cfg and setup.py. Since Bar/ depends on various Python modules, it has install_requires=['lxml', 'SQLAlchemy'] in its setup.py. Foo/ depends on Bar/.

But Bar/ does not have a release yet. How do I include Bar/ in Foo's buildout so that I can import Bar's modules, lxml and SQLAlchemy?

Assume that Bar/ is using mercurial as its revision control system.

My attempt: Buildout mercurial recipe does not do much. It only clones the repository, but does not automatically get the eggs for install_requires in Bar/setup.py and add Bar/ itself to sys.path.

Actual example: Here's what my buildout.cfg looks like (Bar == mercurialrecipe package):

[buildout]
parts = ... pyrtm ...
develop = . parts/pyrtm
eggs = pyrtm

[pyrtm]
recipe = mercurialrecipe
repository = http://bitbucket.org/srid/pyrtm

...

This does not work because sys.path does not contain the path to locally cloned mercurialrecipe (in parts/mr), and the dependencies (from parts/mr/setup.py) are not installed.

A: 

If you can check out/clone the repository, then you can develop the python module as usual:

[buildout]
...
develop = src/Bar
eggs = Bar
Lennart Regebro
Does not work for me. I've updated the question with parts of my buildout.cfg if that helps.
Sridhar Ratnakumar
If I list the `Bar` egg (`mercurialrecipe` in my example above) under the corresponding part, then buildout downloads it from PyPI instead of picking up the local copy.
Sridhar Ratnakumar
Hm... The develop thingy is supposed to fix that. Weird. I'm missing some finer detail here, I'll have to try it out.
Lennart Regebro
A: 

You're using mercurial recipe to make a mercurial checkout of the mercurial recipe that you want to use as a development egg.... There's a huge circular dependency in there.

Buildout needs the mercurial recipe to run the "mr" part. So it grabs the recipe from pypi. It doesn't yet know that the recipe will actually download the recipe.

Reinout van Rees
I used `mercurialrecipe` only as an example. The problem is universal and occurs with other packages as well. Anyways, to avoid this confusion I have modified the example code above.
Sridhar Ratnakumar