Commit 075b8282 authored by Rafael Monnerat's avatar Rafael Monnerat

zc.recipe.egg: Fixup! Support setup-eggs in :develop.

This change fixes bug introduced in https://lab.nexedi.cn/nexedi/slapos.buildout/commit/aba00feb5cc694be6da433d936e29c94f9ae0416 for develop.

As _install_setup_eggs is part of Base class, some code
from Custom.__init__ had to be moved to Base.__init__ as those were
required by _install_setup_eggs implementation as self.link, options['_e'],
self.newest and so on.

Without this change zc.recipe.egg:develop fail to process.
parent c8146d49
...@@ -29,6 +29,8 @@ class Base: ...@@ -29,6 +29,8 @@ class Base:
self.name, self.options = name, options self.name, self.options = name, options
options['_d'] = buildout['buildout']['develop-eggs-directory'] options['_d'] = buildout['buildout']['develop-eggs-directory']
options['_e'] = buildout['buildout']['eggs-directory']
environment_section = options.get('environment') environment_section = options.get('environment')
if environment_section: if environment_section:
...@@ -41,6 +43,24 @@ class Base: ...@@ -41,6 +43,24 @@ class Base:
self.build_ext = build_ext(buildout, options) self.build_ext = build_ext(buildout, options)
links = options.get('find-links',
buildout['buildout'].get('find-links'))
if links:
links = links.split()
options['find-links'] = '\n'.join(links)
else:
links = ()
self.links = links
index = options.get('index', buildout['buildout'].get('index'))
if index is not None:
options['index'] = index
self.index = index
self.newest = buildout['buildout'].get('newest') == 'true'
def install(self): def install(self):
self._set_environment() self._set_environment()
try: try:
...@@ -119,27 +139,9 @@ class Custom(Base): ...@@ -119,27 +139,9 @@ class Custom(Base):
def __init__(self, buildout, name, options): def __init__(self, buildout, name, options):
Base.__init__(self, buildout, name, options) Base.__init__(self, buildout, name, options)
links = options.get('find-links',
buildout['buildout'].get('find-links'))
if links:
links = links.split()
options['find-links'] = '\n'.join(links)
else:
links = ()
self.links = links
index = options.get('index', buildout['buildout'].get('index'))
if index is not None:
options['index'] = index
self.index = index
options['_e'] = buildout['buildout']['eggs-directory']
if buildout['buildout'].get('offline') == 'true': if buildout['buildout'].get('offline') == 'true':
self._install = lambda: () self._install = lambda: ()
self.newest = buildout['buildout'].get('newest') == 'true'
def _install(self): def _install(self):
options = self.options options = self.options
distribution = options.get('egg') distribution = options.get('egg')
......
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