[Distutils] Buildout question

Scott Robertson srobertson at codeit.com
Mon Mar 12 17:40:36 CET 2007


Thanks Jim,
I stumbled upon that myself this  weekend wasn't sure if it was appropriate.

 One thing I noticed, is that if you use the "install" keyword on the
command line i.e.
$ buildout install some-section

Dependent sections don't get built (is that intentional?)

This patch seems to do the trick, though I'm not sure if it causes any
unindented side effects.

--- buildout.py.orig    2007-03-12 09:38:09.000000000 -0700
+++ buildout.py 2007-03-12 09:38:19.000000000 -0700
@@ -213,8 +213,8 @@

         # load and initialize recipes
         [self[part]['recipe'] for part in install_parts]
-        if not install_args:
-           install_parts = self._parts
+
+       install_parts = self._parts

         if self._log_level <= logging.DEBUG:
             sections = list(self)



On 3/11/07, Jim Fulton <jim at zope.com> wrote:
>
> On Mar 9, 2007, at 5:17 PM, Scott Robertson wrote:
>
> > Is there a way to create a dummy part/recipe that depends on another
> > part without having to refer to one of the options of other part?
>
> No, but you could hide the reference in the recipe.
>
> > Similar to make's concept of a phony target I suppose.
> >
> > I'm looking to make a buildout script that looks something like this:
> >
> > [buildout]
> > parts = all
> >
> > [all]
> > recipe=depends
> > parts = linux win32 mac
> >
> > [linux]
> > recipe=depends
> > parts=common-part linux-specific-part
> >
> > [win32]
> > recipe=depends
> > parts=common-part win32-specific-part-1 win32-specific-part-2
> >
> > [mac]
> > recipe=depends
> > parts=common-part mac-specific-part
> >
> > ... real part specifications would follow ...
> >
> >
> >
> > So as you can see, I'm trying to make a buildout script that will
> > build three different variations of the same project for the three
> > major platforms  Windows, Mac and Linux from the same build machine.
> >
> > Depending on the platform I'm building for I may build  parts in my
> > buildout file. Ideally from the command line I'd like to do something
> > like this.
> >
> > $ buildout install linux
> >
> > or
> >
> > $ buildout install mac
> > or
> >
> > $ buildout install win32
> >
> > or
> > $ buildout install all
> >
> >
> > Is this possible to do in recipe or is there some other mechanism I
> > could use to do this dependency? The refering to a variable of another
> > part sort of works for this, but I think it would be easier to read
> > (and less typing) if I could epxlicitly declare that a given part
> > depends on another.
>
> You don't have to refer to a variable. Refering to a section is enough.
> For example:
>
>    class Depends:
>
>        def __init__(self, buildout, name, options):
>            for part in options['parts']:
>                buildout[part]
>
>        def install(self):
>            pass
>
>        update = install
>
> Jim
>
> --
> Jim Fulton                      mailto:jim at zope.com             Python Powered!
> CTO                             (540) 361-1714                  http://www.python.org
> Zope Corporation        http://www.zope.com             http://www.zope.org
>
>
>
>


More information about the Distutils-SIG mailing list