Commit aba00feb authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

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

parent 11c4874f
...@@ -44,6 +44,7 @@ class Base: ...@@ -44,6 +44,7 @@ class Base:
def install(self): def install(self):
self._set_environment() self._set_environment()
try: try:
self._install_setup_eggs()
return self._install() return self._install()
finally: finally:
self._restore_environment() self._restore_environment()
...@@ -71,6 +72,24 @@ class Base: ...@@ -71,6 +72,24 @@ class Base:
except KeyError: except KeyError:
pass pass
def _install_setup_eggs(self):
options = self.options
setup_eggs = [
r.strip()
for r in options.get('setup-eggs', '').split('\n')
if r.strip()]
if setup_eggs:
ws = zc.buildout.easy_install.install(
setup_eggs, options['_e'],
links=self.links,
index=self.index,
executable=sys.executable,
path=[options['_d'], options['_e']],
newest=self.newest,
)
extra_path = os.pathsep.join(ws.entries)
os.environ['PYTHONEXTRAPATH'] = extra_path
def _get_patch_dict(self, options, distribution): def _get_patch_dict(self, options, distribution):
patch_dict = {} patch_dict = {}
global_patch_binary = options.get('patch-binary', 'patch') global_patch_binary = options.get('patch-binary', 'patch')
...@@ -135,22 +154,6 @@ class Custom(Base): ...@@ -135,22 +154,6 @@ class Custom(Base):
distribution = options.get('egg', options.get('eggs', self.name) distribution = options.get('egg', options.get('eggs', self.name)
).strip() ).strip()
setup_eggs = [
r.strip()
for r in options.get('setup-eggs', '').split('\n')
if r.strip()]
if setup_eggs:
ws = zc.buildout.easy_install.install(
setup_eggs, options['_e'],
links=self.links,
index=self.index,
executable=sys.executable,
path=[options['_d'], options['_e']],
newest=self.newest,
)
extra_path = os.pathsep.join(ws.entries)
self.environment['PYTHONEXTRAPATH'] = os.environ['PYTHONEXTRAPATH'] = extra_path
patch_dict = self._get_patch_dict(options, distribution) patch_dict = self._get_patch_dict(options, distribution)
return zc.buildout.easy_install.build( return zc.buildout.easy_install.build(
distribution, options['_d'], self.build_ext, distribution, options['_d'], self.build_ext,
......
...@@ -472,6 +472,10 @@ rpath ...@@ -472,6 +472,10 @@ rpath
A new-line separated list of directories to search for dynamic libraries A new-line separated list of directories to search for dynamic libraries
at run time. at run time.
setup-eggs
A new-line separated list of eggs that need to be installed
beforehand. It is useful to meet the `setup_requires` requirement.
define define
A comma-separated list of names of C preprocessor variables to A comma-separated list of names of C preprocessor variables to
define. define.
......
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