Python's Buildout configuration file allows us to avoid repetition of values by allowing a special syntax known as variable substitution which is of the form ${SECTION:OPTION}
This is an example which allows us to avoid repeating the word experiment:
[context]
name = experiment
[db]
server = ${context:name}
Is it possible to use substitution for the option itself?
For example:
[soures]
${context:name} = https://git.com/${context:name}.git
No, variable expansion in keys is not supported; the feature is actually named value substitions, to make it clear the syntax only applies to values:
The options syntax also explicitly excludes the characters needed to make substitutions possible:
with an exception noted for the short-hand
<part-dependencies>syntax.So, in the end, when variable substitutions are applied in buildout, the code looks for the
${part of the syntax in the values only: