[Distutils] Buildout question
Jim Fulton
jim at zope.com
Sun Mar 11 21:16:33 CET 2007
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