Commit 6e754e0c authored by Julien Muchembled's avatar Julien Muchembled

Drop 'dependencies' option

It is redundant with the fact that slapos.buildout already rebuilds
if any dependency is modified. slapos.buildout does not yet understand
the new => syntax from upstream buildout but meanwhile a dummy option
can be set to any options of required parts.
parent 539e1112
......@@ -174,16 +174,6 @@ Supported options
If any item doesn't exist, the recipe shows a warning message. The
default value is empty.
``dependencies``
List all the depended parts:
dependencies = part1 part2 ...
All the dependent parts will be installed before this part, besides
the changes in any dependent parts will trigger to reinstall
current part.
``environment-section``
Name of a section that provides environment variables that will be used to
......@@ -912,76 +902,6 @@ replaced with the recipe final prefix.
package: Executing pre-install
installing package at /sample_buildout/parts/package -lib
Extra part dependencies
=======================
The recipe will treat all the parts list in the option
``dependencies`` as dependent parts. zc.buildout will install all the
dependent parts before install this part. For example,
>>> write('buildout.cfg',
... """
... [buildout]
... newest = false
... parts = package
...
... [package]
... recipe = slapos.recipe.cmmi
... dependencies = package-2
... url = file://%s/package-0.0.0.tar.gz
...
... [package-2]
... recipe = slapos.recipe.cmmi
... url = file://%s/package-0.0.0.tar.gz
... """ % (src, src))
Here "package-2" will be installed first, because it's a denpend part
of "package":
>>> print(system(buildout))
Uninstalling package.
Installing package-2.
configure --prefix=/sample_buildout/parts/package-2
building package
installing package
Installing package.
configure --prefix=/sample_buildout/parts/package
building package
installing package
Now let's add a new option for "package-2",
>>> write('buildout.cfg',
... """
... [buildout]
... newest = false
... parts = package
...
... [package]
... recipe = slapos.recipe.cmmi
... dependencies = package-2
... url = file://%s/package-0.0.0.tar.gz
...
... [package-2]
... recipe = slapos.recipe.cmmi
... url = file://%s/package-0.0.0.tar.gz
... configure-command = ./configure
... """ % (src, src))
Look, "package" is reinstalled either:
>>> print(system(buildout))
Uninstalling package.
Uninstalling package-2.
Installing package-2.
configure
building package
installing package
Installing package.
configure --prefix=/sample_buildout/parts/package
building package
installing package
Install shared package
======================
......
......@@ -84,25 +84,6 @@ class Recipe(object):
options['path'] = options.get('path', '').strip()
options['promises'] = options.get('promises', '')
# Check dependencies, all the dependent parts will be installed first. It
# seems once part is referenced, for example, self.buildout[part], it will
# be appended as an install part.
# dpendent_parts = options.get('dependencies', '').split()
# assert isinstance(buildout, zc.buildout.buildout.Buildout)
# buildout._compute_part_signatures(
# [part for part in dpendent_parts if part not in buildout._parts])
# Calculate md5sum of all the options for each dependent part, and save it
# as option "dependencies". So if any dependent part changes, zc.buildout
# will reinstall the part because this option is changed.
dependencies = []
for part in options.get('dependencies', '').split():
m = md5()
for v in self.buildout[part].values():
m.update(v.encode('utf-8'))
dependencies.append(m.hexdigest())
options['dependencies'] = ' '.join(dependencies)
if options['url'] and options['path']:
raise zc.buildout.UserError('You must use either "url" or "path", not both!')
if not (options['url'] or options['path']):
......
  • Ah that's why test now fail !

    File "/srv/slapgrid/slappart7/srv/testnode/cmw/inst/test0-0/parts/slapos.recipe.cmmi/slapos/recipe/cmmi/README.rst", line 936, in README.rst
    Failed example:
        print(system(buildout)) #doctest:+ELLIPSIS
    Expected:
        Uninstalling package.
        Uninstalling package-2.
        Installing package.
        configure --prefix=/sample_buildout/parts/package
        building package
        installing package
    Got:
        Uninstalling package.
        Installing package.
        configure --prefix=/sample_buildout/parts/package
        building package
        installing package
        <BLANKLINE>
  • I repaired directly on master ( 3d5cb514 ), I don't think we need to make a new release, 0.14 was released with broken tests, but problem is only in the tests.

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