Commit 9a625153 authored by Xavier Thompson's avatar Xavier Thompson

[opti] Compute default zc.buildout version lazily

parent caec24fc
...@@ -473,16 +473,17 @@ class Buildout(DictMixin): ...@@ -473,16 +473,17 @@ class Buildout(DictMixin):
else: else:
versions = {} versions = {}
versions.update( 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 ( for (k, v) in (
# Prevent downgrading due to prefer-final: # Prevent downgrading due to prefer-final:
('zc.buildout', ('zc.buildout',
'>='+pkg_resources.working_set.find( lambda: '>='+pkg_resources.working_set.find(
pkg_resources.Requirement.parse('zc.buildout') pkg_resources.Requirement.parse('zc.buildout')
# Skip local part because ">=x.y.z+abc" is invalid # Skip local part because ">=x.y.z+abc" is invalid
).parsed_version.public), ).parsed_version.public),
# Use 2, even though not final # Use 2, even though not final
('zc.recipe.egg', '>=2.0.6'), ('zc.recipe.egg', lambda: '>=2.0.6'),
) )
if k not in versions 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