Commit 7d2064f3 authored by Jim Fulton's avatar Jim Fulton

Reuse egg recipe for egg management.

parent a12ff7a0
...@@ -6,7 +6,6 @@ for a project. ...@@ -6,7 +6,6 @@ for a project.
The test-runner recipe has 2 options: The test-runner recipe has 2 options:
eggs eggs
The eggs option specified a list of eggs to test given as one ore The eggs option specified a list of eggs to test given as one ore
more setuptools requirement strings. Each string must be given on more setuptools requirement strings. Each string must be given on
......
...@@ -19,6 +19,7 @@ $Id$ ...@@ -19,6 +19,7 @@ $Id$
import os, sys import os, sys
import pkg_resources import pkg_resources
import zc.buildout.easy_install import zc.buildout.easy_install
import zc.recipe.egg
class TestRunner: class TestRunner:
...@@ -29,22 +30,13 @@ class TestRunner: ...@@ -29,22 +30,13 @@ class TestRunner:
options['script'] = os.path.join(buildout['buildout']['bin-directory'], options['script'] = os.path.join(buildout['buildout']['bin-directory'],
options.get('script', self.name), options.get('script', self.name),
) )
options['_e'] = buildout['buildout']['eggs-directory'] self.egg = zc.recipe.egg.Egg(buildout, name, options)
options['_d'] = buildout['buildout']['develop-eggs-directory']
python = options.get('python', buildout['buildout']['python'])
options['executable'] = buildout[python]['executable']
def install(self): def install(self):
options = self.options options = self.options
requirements = [r.strip() requirements, ws = self.egg.working_set(('zope.testing', ))
for r in options['eggs'].split('\n')
if r.strip()]
ws = zc.buildout.easy_install.working_set(
requirements+['zope.testing'],
executable = options['executable'],
path=[options['_d'], options['_e']]
)
path = [dist.location for dist in ws] path = [dist.location for dist in ws]
project_names = [ project_names = [
pkg_resources.Requirement.parse(r).project_name pkg_resources.Requirement.parse(r).project_name
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
import os, re, shutil, sys, tempfile import os, re, shutil, sys, tempfile
import pkg_resources import pkg_resources
import zc.buildout.testing import zc.buildout.testing
import zc.recipe.egg
import unittest import unittest
import zope.testing import zope.testing
...@@ -30,6 +31,9 @@ def setUp(test): ...@@ -30,6 +31,9 @@ def setUp(test):
open(os.path.join(test.globs['sample_buildout'], open(os.path.join(test.globs['sample_buildout'],
'eggs', 'zc.recipe.testrunner.egg-link'), 'eggs', 'zc.recipe.testrunner.egg-link'),
'w').write(dirname(__file__, 4)) 'w').write(dirname(__file__, 4))
open(os.path.join(test.globs['sample_buildout'],
'eggs', 'zc.recipe.egg.egg-link'),
'w').write(dirname(zc.recipe.egg.__file__, 4))
# XXX assumes that zope.testing egg is a directory # XXX assumes that zope.testing egg is a directory
open(os.path.join(test.globs['sample_buildout'], open(os.path.join(test.globs['sample_buildout'],
......
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