[Distutils] Buildout: Including another Python project via mercurial?

Sridhar Ratnakumar sridharr at activestate.com
Fri Jan 29 02:47:51 CET 2010


On 1/28/2010 2:57 PM, Jonathan Ballet wrote:
> Hello,
>
> Le Thu, 28 Jan 2010 11:32:33 -0800, Sridhar Ratnakumar
> <sridharr at activestate.com>  a écrit :
>
>> >  The above buildout.cfg does none of the above. How do I make it work as
>> >  intended?
> For this particular usage, I would either:
>
> * Clone the repository by myself, and develop it using Buildout's develop
>    option. This can be summarized like that::
>
>      $ hg clonehttp://bitbucket.org/srid/pyrtm  pyrtm-repository
>      $ cat buildout.cfg
>      [buildout]
>      develop = pyrtm-repository
>      parts = part-that-need-pyrtm
>
>      [part-that-need-pyrtm]
>      recipe = zc.recipe.egg
>      eggs = pyrtm

Yes, this works (but not 100% flawlessly with mercurialrecipe).

> * Use mr.developer [1] to automate this. I didn't find it very useful, though,
>    but this is closer to what you like to do using mercurialrecipe, despite
>    mr.developer looks more active and I know several developers which are using
>    it. It also has a comprehensive documentation, which mercurialrecipe doesn't
>    have!

This too works. mr.developer 1.9 is buggy and I had to pin version 1.7. 
But I prefer the first option which sounds simpler to me.

> Speaking for myself, I'm using the first option several times a day. The
> "schemes" extension, which is part of Mercurial>  1.4.1, is a bless: I created
> a shortcut which points to our internal repository, and so, I don't have to
> enter the full URL (scheme + domain name + directories) of the component, only
> "sact://foo.bar" ("sact://" is my custom scheme).

But doesn't manually cloning your dependent repositories beat the idea 
of build automation?

>> >  Note that `pyrtm' actually does not have any dependencies and I used it
>> >  as an example only (In actuality, I want to rely on an internal package
>> >  that has several installation requirements).
>> >
>> >  Lennart originally suggested the "develop =" syntax which, as shown
>> >  above, does not work. Any ideas?
> I don't know how mercurialrecipe works, so I can't help you on this. Maybe the
> output of Buildout may help us? (also, have a look at the output using multiple
> -v and buildout:log-level=debug option)

mercurialreciple only does "hg clone". It does not automatically make it 
a develop egg. When I tried your first option with mercurialrecipe, I 
had to run bin/buildout twice to make it work as I expected:

1/ First run of bin/buildout: will use `pyrtm' egg from PyPI and will 
for the first time, do a checkout of `pyrtm' from bitbucket to 
pyrtm-repository

2/ Second run of bin/buildout: will use the local `pyrtm' checkout.

So one must remember to run bin/buildout twice, which is less than ideal 
.. especially if someone forgets to do so, thus ending up with the PyPI 
egg of pyrtm.

-srid


More information about the Distutils-SIG mailing list