Commit 06c7fabf authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Xavier Thompson

Add setup-eggs option in zc.recipe.egg:custom.

parent b159bebf
...@@ -371,10 +371,13 @@ class Installer: ...@@ -371,10 +371,13 @@ class Installer:
tmp = tempfile.mkdtemp(dir=dest) tmp = tempfile.mkdtemp(dir=dest)
try: try:
path = setuptools_pythonpath path_list = [setuptools_pythonpath]
extra_path = os.environ.get('PYTHONEXTRAPATH')
if extra_path:
path_list += extra_path.split(os.pathsep)
args = [sys.executable, '-c', args = [sys.executable, '-c',
'import sys; sys.path[0:0] = [%r]; ' % path + ( 'import sys; sys.path[0:0] = %r; ' % path_list + (
_easy_install_cmd if self._allow_picked_versions else _easy_install_cmd if self._allow_picked_versions else
_easy_install_cmd_no_install_setup_requires), _easy_install_cmd_no_install_setup_requires),
'-mZUNxd', tmp] '-mZUNxd', tmp]
...@@ -387,8 +390,8 @@ class Installer: ...@@ -387,8 +390,8 @@ class Installer:
args.append(spec) args.append(spec)
if level <= logging.DEBUG: if level <= logging.DEBUG:
logger.debug('Running easy_install:\n"%s"\npath=%s\n', logger.debug('Running easy_install:\n"%s"\npath_list=%s\n',
'" "'.join(args), path) '" "'.join(args), path_list)
sys.stdout.flush() # We want any pending output first sys.stdout.flush() # We want any pending output first
......
...@@ -83,6 +83,23 @@ class Custom(Base): ...@@ -83,6 +83,23 @@ 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
self._set_environment() self._set_environment()
try: try:
return zc.buildout.easy_install.build( return zc.buildout.easy_install.build(
......
...@@ -20,6 +20,10 @@ rpath ...@@ -20,6 +20,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