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