Commit 17beb7b3 authored by Xavier Thompson's avatar Xavier Thompson

[opti] Compute default zc.buildout version lazily

parent c78f0ef9
......@@ -474,16 +474,17 @@ class Buildout(DictMixin):
else:
versions = {}
versions.update(
dict((k, SectionKey(v, 'DEFAULT_VALUE'))
dict((k, SectionKey(v(), 'DEFAULT_VALUE'))
# Use lambdas to compute values only if needed
for (k, v) in (
# Prevent downgrading due to prefer-final:
('zc.buildout',
'>='+pkg_resources.working_set.find(
lambda: '>='+pkg_resources.working_set.find(
pkg_resources.Requirement.parse('zc.buildout')
# Skip local part because ">=x.y.z+abc" is invalid
).parsed_version.public),
# Use 2, even though not final
('zc.recipe.egg', '>=2.0.6'),
('zc.recipe.egg', lambda: '>=2.0.6'),
)
if k not in versions
))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment