Skip to content

Commit

Permalink
Moved the gathering of include-dependencies from the __init__ to the …
Browse files Browse the repository at this point in the history
…update method to prevent installing dependencies before other buildout parts could do their job.
  • Loading branch information
janjaapdriessen committed Feb 24, 2010
1 parent 45a406e commit d6e422d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ CHANGES
0.13 (unreleased)
=================

- Nothing changed yet.

- Moved the gathering of include-dependencies from the __init__ to the update
method to prevent installing dependencies before other buildout parts could
do their job.

0.12.1 (2009-12-15)
===================
Expand Down
14 changes: 7 additions & 7 deletions src/z3c/recipe/compattest/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def __init__(self, buildout, name, options):
self.options.get('include-dependencies', ''), [])
self.exclude = string2list(self.options.get('exclude', ''), [])
self.extra_paths = self.options.get('extra-paths', '')
self.wanted_packages = self._wanted_packages()

self.script = self.options.get('script', self.name)

Expand All @@ -44,14 +43,15 @@ def install(self):
return self.update()

def update(self):
wanted_packages = self._wanted_packages()
installed = []
installed.extend(self._install_testrunners())
installed.extend(self._install_run_script())
installed.extend(self._install_testrunners(wanted_packages))
installed.extend(self._install_run_script(wanted_packages))
return installed

def _install_testrunners(self):
def _install_testrunners(self, wanted_packages):
installed = []
for package in self.wanted_packages:
for package in wanted_packages:
ws = self._working_set(package)
package_ = ws.find(pkg_resources.Requirement.parse(package))
extras = '[' + ','.join(package_.extras) + ']'
Expand All @@ -66,10 +66,10 @@ def _install_testrunners(self):
installed.extend(recipe.install())
return installed

def _install_run_script(self):
def _install_run_script(self, wanted_packages):
bindir = self.buildout['buildout']['bin-directory']
runners = ['%s-%s' % (self.name, package) for package
in self.wanted_packages]
in wanted_packages]
runners = [repr(os.path.join(bindir, runner)) for runner in runners]

return zc.buildout.easy_install.scripts(
Expand Down

0 comments on commit d6e422d

Please sign in to comment.