Commit db715ef3 authored by Jim Fulton's avatar Jim Fulton

Bugs Fixed

----------

- https://bugs.launchpad.net/products/zc.buildout/+bug/71246

Buildout extensions installed as eggs couldn't be loaded in offline
  mode.
parent fab9bf66
...@@ -28,6 +28,15 @@ Feature Changes ...@@ -28,6 +28,15 @@ Feature Changes
- Configuration files can now be loaded from URLs. - Configuration files can now be loaded from URLs.
Bugs Fixed
----------
- https://bugs.launchpad.net/products/zc.buildout/+bug/71246
Buildout extensions installed as eggs couldn't be loaded in offline
mode.
1.0.0b16 (2006-12-07) 1.0.0b16 (2006-12-07)
===================== =====================
......
...@@ -562,17 +562,18 @@ class Buildout(UserDict.DictMixin): ...@@ -562,17 +562,18 @@ class Buildout(UserDict.DictMixin):
def _load_extensions(self): def _load_extensions(self):
specs = self['buildout'].get('extensions', '').split() specs = self['buildout'].get('extensions', '').split()
if specs: if specs:
path = [self['buildout']['develop-eggs-directory']]
if self['buildout'].get('offline') == 'true': if self['buildout'].get('offline') == 'true':
dest = None dest = None
path.append(self['buildout']['eggs-directory'])
else: else:
dest = self['buildout']['eggs-directory'] dest = self['buildout']['eggs-directory']
if not os.path.exists(dest): if not os.path.exists(dest):
self._logger.info('Creating directory %s', dest) self._logger.info('Creating directory %s', dest)
os.mkdir(dest) os.mkdir(dest)
zc.buildout.easy_install.install( zc.buildout.easy_install.install(
specs, dest, specs, dest, path=path,
path=[self['buildout']['develop-eggs-directory']],
working_set=pkg_resources.working_set, working_set=pkg_resources.working_set,
) )
for ep in pkg_resources.iter_entry_points('zc.buildout.extension'): for ep in pkg_resources.iter_entry_points('zc.buildout.extension'):
......
...@@ -826,6 +826,44 @@ Uninstall recipes need to be called when a part is removed too: ...@@ -826,6 +826,44 @@ Uninstall recipes need to be called when a part is removed too:
""" """
def extensions_installed_as_eggs_work_in_offline_mode():
'''
>>> mkdir('demo')
>>> write('demo', 'demo.py',
... """
... def ext(buildout):
... print 'ext', list(buildout)
... """)
>>> write('demo', 'setup.py',
... """
... from setuptools import setup
...
... setup(
... name = "demo",
... py_modules=['demo'],
... entry_points = {'zc.buildout.extension': ['ext = demo:ext']},
... )
... """)
>>> bdist_egg(join(sample_buildout, "demo"), sys.executable,
... join(sample_buildout, "eggs"))
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... extensions = demo
... parts =
... offline = true
... """)
>>> print system(join(sample_buildout, 'bin', 'buildout')),
ext ['buildout']
'''
###################################################################### ######################################################################
def create_sample_eggs(test, executable=sys.executable): def create_sample_eggs(test, executable=sys.executable):
......
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