This doesn’t seem to work:
[buildout]
extends = buildout.cfg
eggs -= python-ldap
eggs += psycopg2
The behaviour always seems to be as though the eggs += psycopg2 line was not present. It doesn’t matter which order the two lines are in.
Is this a bug? Is there a way to achieve this result?
Unfortunately,
zc.buildoutup to version 1.5.2 doesn’t support this use-case. Either the addition or the subtraction will succeed.What happens internally is this:
+=, take the inherited value, add things, and store it as the new value.-=, take the inherited value, remove things, and store it as the new value.After these updates the inherited section is copied, updated with the new values and this is used as the final result.
The ordering is defined by the usual python mapping semantics, thus undefined; either the addition or the subtraction runs last. Because both operations take their input from the inherited section, modify it, then store it as the new value, the operation that runs last overwrites the result of the operation that ran before.
I’ve committed a fix for this; I don’t have rights to release a new version of
buildoutto pypi though, I’ll have to poke those who do.Edit:
zc.buildoutversion 1.6 contains this fix.