[Distutils] [buildout] ${} substitutions don't happen in buildout:extends?

Jim Fulton jim at zope.com
Thu May 6 16:55:11 CEST 2010


On Thu, May 6, 2010 at 5:12 AM, Chris Withers <chris at simplistix.co.uk> wrote:
> Hi All,
>
> Here's the scenario; we have per-project buildouts, but where and how people
> lay out their checkouts and how they access svn (svn:// versus http://
> versus https:// externally).
>
> Buildout lends itself to this flexibility by having the per-project
> buildouts use templated values, with those values being specified in
> ~/.buildout/default.cfg
>
> ...except, this doesn't seem to work for buildout:extends.
>
> For example, here's a project buildout:
>
> [buildout]
> extends = ${buildout:base_location}/versions/repoze.bfg-1.2-versions.cfg
> ...
>
> And here's what's in ~/.buildout/default.cfg:
>
> [buildout]
> base_location = /Users/chris/LocalSVN/base
>
> ...but, the normal ${} substitution doesn't appear to happen in the extends
> line, so I get the following error:
>
> IOError: [Errno 2] No such file or directory:
> '/Users/chris.withers/LocalSVN/demoapp/${buildout:base_location}/versions/repoze.bfg-1.2-versions.cfg'
>
> What am I doing wrong?

Nothing. There are certtain stages of processing where variable
substitution isn't done.
This is, in part because the variable database hasn't been established yet.

I think the situation needs to be improved. At least, I think variable
substitutions
could reflect the database as it exists at the time of a variables use.  This
would allow extends to use variables defined on the command line,
in default.cfg and in files already read.  Of course, the restrictions
that remain should be clearly documented.

> How can I achieve my aims with buildout 1.4.3 or later?

I expect this will work correctly in a later version of buildout. :)

Jim

-- 
Jim Fulton


More information about the Distutils-SIG mailing list