Commit 2eba00c7 authored by jim's avatar jim

Changed the logging format to exclude the logger name for the

zc.buildout logger.  This reduces noise in the output.  This change
was so far reaching, I decided to go ahead and clean up lots of log
messages, adding some missing periods and adding quotes around
requirement strings and file paths.

in easy_install.py, added logging to show why distributions are added
in verbose mode and removed recusive code to show requirement chains
when errors occurred.


git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@76022 62d5b8a3-27da-0310-9561-8e5933582275
parent 919be1e3
############################################################################ ##############################################################################
# #
# Copyright (c) 2005 Zope Corporation and Contributors. # Copyright (c) 2005 Zope Corporation and Contributors.
# All Rights Reserved. # All Rights Reserved.
...@@ -61,7 +61,7 @@ _buildout_default_options = { ...@@ -61,7 +61,7 @@ _buildout_default_options = {
'python': 'buildout', 'python': 'buildout',
'executable': sys.executable, 'executable': sys.executable,
'log-level': 'INFO', 'log-level': 'INFO',
'log-format': '%(name)s: %(message)s', 'log-format': '',
} }
class Buildout(UserDict.DictMixin): class Buildout(UserDict.DictMixin):
...@@ -69,7 +69,7 @@ class Buildout(UserDict.DictMixin): ...@@ -69,7 +69,7 @@ class Buildout(UserDict.DictMixin):
def __init__(self, config_file, cloptions, def __init__(self, config_file, cloptions,
user_defaults=True, windows_restart=False, command=None): user_defaults=True, windows_restart=False, command=None):
__doing__ = 'Initializing' __doing__ = 'Initializing.'
self.__windows_restart = windows_restart self.__windows_restart = windows_restart
...@@ -81,7 +81,7 @@ class Buildout(UserDict.DictMixin): ...@@ -81,7 +81,7 @@ class Buildout(UserDict.DictMixin):
base = os.path.dirname(config_file) base = os.path.dirname(config_file)
if not os.path.exists(config_file): if not os.path.exists(config_file):
if command == 'init': if command == 'init':
print 'Creating', config_file print 'Creating %r.' % config_file
open(config_file, 'w').write('[buildout]\nparts = \n') open(config_file, 'w').write('[buildout]\nparts = \n')
else: else:
raise zc.buildout.UserError( raise zc.buildout.UserError(
...@@ -185,7 +185,7 @@ class Buildout(UserDict.DictMixin): ...@@ -185,7 +185,7 @@ class Buildout(UserDict.DictMixin):
return os.path.join(self._buildout_dir, *names) return os.path.join(self._buildout_dir, *names)
def bootstrap(self, args): def bootstrap(self, args):
__doing__ = 'Bootstraping' __doing__ = 'Bootstraping.'
self._setup_directories() self._setup_directories()
...@@ -219,7 +219,7 @@ class Buildout(UserDict.DictMixin): ...@@ -219,7 +219,7 @@ class Buildout(UserDict.DictMixin):
init = bootstrap init = bootstrap
def install(self, install_args): def install(self, install_args):
__doing__ = 'Installing' __doing__ = 'Installing.'
self._load_extensions() self._load_extensions()
self._setup_directories() self._setup_directories()
...@@ -268,7 +268,7 @@ class Buildout(UserDict.DictMixin): ...@@ -268,7 +268,7 @@ class Buildout(UserDict.DictMixin):
if not install_args: if not install_args:
install_parts = self._parts install_parts = self._parts
if self._log_level <= logging.DEBUG: if self._log_level < logging.DEBUG:
sections = list(self) sections = list(self)
sections.sort() sections.sort()
print print
...@@ -301,18 +301,19 @@ class Buildout(UserDict.DictMixin): ...@@ -301,18 +301,19 @@ class Buildout(UserDict.DictMixin):
continue continue
# output debugging info # output debugging info
if self._logger.getEffectiveLevel() < logging.DEBUG:
for k in old_options: for k in old_options:
if k not in new_options: if k not in new_options:
self._logger.debug("Part: %s, dropped option %s", self._logger.debug("Part %s, dropped option %s.",
part, k) part, k)
elif old_options[k] != new_options[k]: elif old_options[k] != new_options[k]:
self._logger.debug( self._logger.debug(
"Part: %s, option %s, %r != %r", "Part %s, option %s changed:\n%r != %r",
part, k, new_options[k], old_options[k], part, k, new_options[k], old_options[k],
) )
for k in new_options: for k in new_options:
if k not in old_options: if k not in old_options:
self._logger.debug("Part: %s, new option %s", self._logger.debug("Part %s, new option %s.",
part, k) part, k)
elif not uninstall_missing: elif not uninstall_missing:
...@@ -334,7 +335,7 @@ class Buildout(UserDict.DictMixin): ...@@ -334,7 +335,7 @@ class Buildout(UserDict.DictMixin):
recipe = self[part].recipe recipe = self[part].recipe
if part in installed_parts: # update if part in installed_parts: # update
need_to_save_installed = False need_to_save_installed = False
__doing__ = 'Updating %s', part __doing__ = 'Updating %s.', part
self._logger.info(*__doing__) self._logger.info(*__doing__)
old_options = installed_part_options[part] old_options = installed_part_options[part]
old_installed_files = old_options['__buildout_installed__'] old_installed_files = old_options['__buildout_installed__']
...@@ -377,7 +378,7 @@ class Buildout(UserDict.DictMixin): ...@@ -377,7 +378,7 @@ class Buildout(UserDict.DictMixin):
else: # install else: # install
need_to_save_installed = True need_to_save_installed = True
__doing__ = 'Installing %s', part __doing__ = 'Installing %s.', part
self._logger.info(*__doing__) self._logger.info(*__doing__)
installed_files = self[part]._call(recipe.install) installed_files = self[part]._call(recipe.install)
if installed_files is None: if installed_files is None:
...@@ -425,7 +426,7 @@ class Buildout(UserDict.DictMixin): ...@@ -425,7 +426,7 @@ class Buildout(UserDict.DictMixin):
def _uninstall_part(self, part, installed_part_options): def _uninstall_part(self, part, installed_part_options):
# ununstall part # ununstall part
__doing__ = 'Uninstalling %s', part __doing__ = 'Uninstalling %s.', part
self._logger.info(*__doing__) self._logger.info(*__doing__)
# run uinstall recipe # run uinstall recipe
...@@ -433,7 +434,7 @@ class Buildout(UserDict.DictMixin): ...@@ -433,7 +434,7 @@ class Buildout(UserDict.DictMixin):
try: try:
uninstaller = _install_and_load( uninstaller = _install_and_load(
recipe, 'zc.buildout.uninstall', entry, self) recipe, 'zc.buildout.uninstall', entry, self)
self._logger.info('Running uninstall recipe') self._logger.info('Running uninstall recipe.')
uninstaller(part, installed_part_options[part]) uninstaller(part, installed_part_options[part])
except (ImportError, pkg_resources.DistributionNotFound), v: except (ImportError, pkg_resources.DistributionNotFound), v:
pass pass
...@@ -450,7 +451,7 @@ class Buildout(UserDict.DictMixin): ...@@ -450,7 +451,7 @@ class Buildout(UserDict.DictMixin):
for name in ('bin', 'parts', 'eggs', 'develop-eggs'): for name in ('bin', 'parts', 'eggs', 'develop-eggs'):
d = self['buildout'][name+'-directory'] d = self['buildout'][name+'-directory']
if not os.path.exists(d): if not os.path.exists(d):
self._logger.info('Creating directory %s', d) self._logger.info('Creating directory %r.', d)
os.mkdir(d) os.mkdir(d)
def _develop(self): def _develop(self):
...@@ -471,8 +472,8 @@ class Buildout(UserDict.DictMixin): ...@@ -471,8 +472,8 @@ class Buildout(UserDict.DictMixin):
try: try:
for setup in develop.split(): for setup in develop.split():
setup = self._buildout_path(setup) setup = self._buildout_path(setup)
self._logger.info("Develop: %s", setup) self._logger.info("Develop: %r", setup)
__doing__ = 'Processing develop directory %s', setup __doing__ = 'Processing develop directory %r.', setup
zc.buildout.easy_install.develop(setup, dest) zc.buildout.easy_install.develop(setup, dest)
except: except:
# if we had an error, we need to roll back changes, by # if we had an error, we need to roll back changes, by
...@@ -503,7 +504,7 @@ class Buildout(UserDict.DictMixin): ...@@ -503,7 +504,7 @@ class Buildout(UserDict.DictMixin):
if not (os.path.isfile(os.path.join(dest, f)) if not (os.path.isfile(os.path.join(dest, f))
and f.endswith('.egg-link')): and f.endswith('.egg-link')):
self._logger.warning( self._logger.warning(
"Unexpected entry, %s, in develop-eggs directory", f) "Unexpected entry, %r, in develop-eggs directory.", f)
def _compute_part_signatures(self, parts): def _compute_part_signatures(self, parts):
# Compute recipe signature and add to options # Compute recipe signature and add to options
...@@ -580,10 +581,21 @@ class Buildout(UserDict.DictMixin): ...@@ -580,10 +581,21 @@ class Buildout(UserDict.DictMixin):
def _setup_logging(self): def _setup_logging(self):
root_logger = logging.getLogger() root_logger = logging.getLogger()
self._logger = logging.getLogger('zc.buildout')
handler = logging.StreamHandler(sys.stdout) handler = logging.StreamHandler(sys.stdout)
handler.setFormatter(logging.Formatter(self['buildout']['log-format'])) log_format = self['buildout']['log-format']
if not log_format:
# No format specified. Use different formatter for buildout
# and other modules, showing logger name except for buildout
log_format = '%(name)s: %(message)s'
buildout_handler = logging.StreamHandler(sys.stdout)
buildout_handler.setFormatter(logging.Formatter('%(message)s'))
self._logger.propagate = False
self._logger.addHandler(buildout_handler)
handler.setFormatter(logging.Formatter(log_format))
root_logger.addHandler(handler) root_logger.addHandler(handler)
self._logger = logging.getLogger('buildout')
level = self['buildout']['log-level'] level = self['buildout']['log-level']
if level in ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'): if level in ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'):
level = getattr(logging, level) level = getattr(logging, level)
...@@ -605,7 +617,7 @@ class Buildout(UserDict.DictMixin): ...@@ -605,7 +617,7 @@ class Buildout(UserDict.DictMixin):
def _maybe_upgrade(self): def _maybe_upgrade(self):
# See if buildout or setuptools need to be upgraded. # See if buildout or setuptools need to be upgraded.
# If they do, do the upgrade and restart the buildout process. # If they do, do the upgrade and restart the buildout process.
__doing__ = 'Checking for upgrades' __doing__ = 'Checking for upgrades.'
if not self.newest: if not self.newest:
return return
...@@ -630,7 +642,7 @@ class Buildout(UserDict.DictMixin): ...@@ -630,7 +642,7 @@ class Buildout(UserDict.DictMixin):
if not upgraded: if not upgraded:
return return
__doing__ = 'Upgrading' __doing__ = 'Upgrading.'
should_run = realpath( should_run = realpath(
os.path.join(os.path.abspath(self['buildout']['bin-directory']), os.path.join(os.path.abspath(self['buildout']['bin-directory']),
...@@ -640,10 +652,10 @@ class Buildout(UserDict.DictMixin): ...@@ -640,10 +652,10 @@ class Buildout(UserDict.DictMixin):
should_run += '-script.py' should_run += '-script.py'
if (realpath(os.path.abspath(sys.argv[0])) != should_run): if (realpath(os.path.abspath(sys.argv[0])) != should_run):
self._logger.debug("Running %r", realpath(sys.argv[0])) self._logger.debug("Running %r.", realpath(sys.argv[0]))
self._logger.debug("Local buildout is %r", should_run) self._logger.debug("Local buildout is %r.", should_run)
self._logger.warn("Not upgrading because not running a local " self._logger.warn("Not upgrading because not running a local "
"buildout command") "buildout command.")
return return
if sys.platform == 'win32' and not self.__windows_restart: if sys.platform == 'win32' and not self.__windows_restart:
...@@ -678,7 +690,7 @@ class Buildout(UserDict.DictMixin): ...@@ -678,7 +690,7 @@ class Buildout(UserDict.DictMixin):
sys.exit(os.spawnv(os.P_WAIT, sys.executable, args)) sys.exit(os.spawnv(os.P_WAIT, sys.executable, args))
def _load_extensions(self): def _load_extensions(self):
__doing__ = 'Loading extensions' __doing__ = 'Loading extensions.'
specs = self['buildout'].get('extensions', '').split() specs = self['buildout'].get('extensions', '').split()
if specs: if specs:
path = [self['buildout']['develop-eggs-directory']] path = [self['buildout']['develop-eggs-directory']]
...@@ -688,7 +700,7 @@ class Buildout(UserDict.DictMixin): ...@@ -688,7 +700,7 @@ class Buildout(UserDict.DictMixin):
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 %r.', dest)
os.mkdir(dest) os.mkdir(dest)
zc.buildout.easy_install.install( zc.buildout.easy_install.install(
...@@ -703,7 +715,7 @@ class Buildout(UserDict.DictMixin): ...@@ -703,7 +715,7 @@ class Buildout(UserDict.DictMixin):
if os.path.isdir(setup): if os.path.isdir(setup):
setup = os.path.join(setup, 'setup.py') setup = os.path.join(setup, 'setup.py')
self._logger.info("Running setup script %s", setup) self._logger.info("Running setup script %r.", setup)
setup = os.path.abspath(setup) setup = os.path.abspath(setup)
fd, tsetup = tempfile.mkstemp() fd, tsetup = tempfile.mkstemp()
...@@ -724,7 +736,7 @@ class Buildout(UserDict.DictMixin): ...@@ -724,7 +736,7 @@ class Buildout(UserDict.DictMixin):
runsetup = setup # backward compat. runsetup = setup # backward compat.
def __getitem__(self, section): def __getitem__(self, section):
__doing__ = 'Getting section %s', section __doing__ = 'Getting section %s.', section
try: try:
return self._data[section] return self._data[section]
except KeyError: except KeyError:
...@@ -754,13 +766,13 @@ class Buildout(UserDict.DictMixin): ...@@ -754,13 +766,13 @@ class Buildout(UserDict.DictMixin):
def _install_and_load(spec, group, entry, buildout): def _install_and_load(spec, group, entry, buildout):
__doing__ = 'Loading recipe %s', spec __doing__ = 'Loading recipe %r.', spec
try: try:
req = pkg_resources.Requirement.parse(spec) req = pkg_resources.Requirement.parse(spec)
buildout_options = buildout['buildout'] buildout_options = buildout['buildout']
if pkg_resources.working_set.find(req) is None: if pkg_resources.working_set.find(req) is None:
__doing__ = 'Installing recipe %s', spec __doing__ = 'Installing recipe %s.', spec
if buildout.offline: if buildout.offline:
dest = None dest = None
path = [buildout_options['develop-eggs-directory'], path = [buildout_options['develop-eggs-directory'],
...@@ -779,7 +791,7 @@ def _install_and_load(spec, group, entry, buildout): ...@@ -779,7 +791,7 @@ def _install_and_load(spec, group, entry, buildout):
newest=buildout.newest, newest=buildout.newest,
) )
__doing__ = 'Loading %s recipe entry %s:%s', group, spec, entry __doing__ = 'Loading %s recipe entry %s:%s.', group, spec, entry
return pkg_resources.load_entry_point( return pkg_resources.load_entry_point(
req.project_name, group, entry) req.project_name, group, entry)
...@@ -801,7 +813,7 @@ class Options(UserDict.DictMixin): ...@@ -801,7 +813,7 @@ class Options(UserDict.DictMixin):
def _initialize(self): def _initialize(self):
name = self.name name = self.name
__doing__ = 'Initializing section %s', name __doing__ = 'Initializing section %s.', name
# force substitutions # force substitutions
for k, v in self._raw.items(): for k, v in self._raw.items():
...@@ -819,12 +831,12 @@ class Options(UserDict.DictMixin): ...@@ -819,12 +831,12 @@ class Options(UserDict.DictMixin):
buildout = self.buildout buildout = self.buildout
recipe_class = _install_and_load(reqs, 'zc.buildout', entry, buildout) recipe_class = _install_and_load(reqs, 'zc.buildout', entry, buildout)
__doing__ = 'Initializing part %s', name __doing__ = 'Initializing part %s.', name
self.recipe = recipe_class(buildout, name, self) self.recipe = recipe_class(buildout, name, self)
buildout._parts.append(name) buildout._parts.append(name)
def _dosub(self, option, v): def _dosub(self, option, v):
__doing__ = 'Getting option %s:%s', self.name, option __doing__ = 'Getting option %s:%s.', self.name, option
seen = [(self.name, option)] seen = [(self.name, option)]
v = '$$'.join([self._sub(s, seen) for s in v.split('$$')]) v = '$$'.join([self._sub(s, seen) for s in v.split('$$')])
self._cooked[option] = v self._cooked[option] = v
...@@ -841,7 +853,7 @@ class Options(UserDict.DictMixin): ...@@ -841,7 +853,7 @@ class Options(UserDict.DictMixin):
if v is None: if v is None:
return default return default
__doing__ = 'Getting option %s:%s', self.name, option __doing__ = 'Getting option %s:%s.', self.name, option
if '${' in v: if '${' in v:
key = self.name, option key = self.name, option
...@@ -947,7 +959,7 @@ class Options(UserDict.DictMixin): ...@@ -947,7 +959,7 @@ class Options(UserDict.DictMixin):
elif os.path.isfile(p): elif os.path.isfile(p):
os.remove(p) os.remove(p)
else: else:
self._buildout._logger.warn("Couldn't clean up %s", p) self._buildout._logger.warn("Couldn't clean up %r.", p)
raise raise
finally: finally:
self._created = None self._created = None
...@@ -1137,7 +1149,7 @@ def _check_for_unused_options_in_section(buildout, section): ...@@ -1137,7 +1149,7 @@ def _check_for_unused_options_in_section(buildout, section):
options = buildout[section] options = buildout[section]
unused = [option for option in options._raw if option not in options._data] unused = [option for option in options._raw if option not in options._data]
if unused: if unused:
buildout._logger.warn("Unused options for %s: %s" buildout._logger.warn("Unused options for %s: %s."
% (section, ' '.join(map(repr, unused))) % (section, ' '.join(map(repr, unused)))
) )
......
...@@ -285,8 +285,8 @@ buildout: ...@@ -285,8 +285,8 @@ buildout:
>>> os.chdir(sample_buildout) >>> os.chdir(sample_buildout)
>>> buildout = os.path.join(sample_buildout, 'bin', 'buildout') >>> buildout = os.path.join(sample_buildout, 'bin', 'buildout')
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Installing data-dir Installing data-dir.
data-dir: Creating directory mystuff data-dir: Creating directory mystuff
We see that the recipe created the directory, as expected: We see that the recipe created the directory, as expected:
...@@ -334,9 +334,9 @@ we'll see that the directory gets removed and recreated: ...@@ -334,9 +334,9 @@ we'll see that the directory gets removed and recreated:
... """) ... """)
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling data-dir Uninstalling data-dir.
buildout: Installing data-dir Installing data-dir.
data-dir: Creating directory mydata data-dir: Creating directory mydata
>>> ls(sample_buildout) >>> ls(sample_buildout)
...@@ -354,9 +354,9 @@ the part will be reinstalled: ...@@ -354,9 +354,9 @@ the part will be reinstalled:
>>> rmdir(sample_buildout, 'mydata') >>> rmdir(sample_buildout, 'mydata')
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling data-dir Uninstalling data-dir.
buildout: Installing data-dir Installing data-dir.
data-dir: Creating directory mydata data-dir: Creating directory mydata
Error reporting Error reporting
...@@ -385,12 +385,12 @@ non-existant directory to create the directory in: ...@@ -385,12 +385,12 @@ non-existant directory to create the directory in:
We'll get a user error, not a traceback. We'll get a user error, not a traceback.
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
data-dir: Cannot create /xxx/mydata. /xxx is not a directory. data-dir: Cannot create /xxx/mydata. /xxx is not a directory.
While: While:
Installing Installing.
Getting section data-dir Getting section data-dir.
Initializing part data-dir Initializing part data-dir.
Error: Invalid Path Error: Invalid Path
...@@ -450,13 +450,13 @@ leave previously created paths in place: ...@@ -450,13 +450,13 @@ leave previously created paths in place:
... """) ... """)
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling data-dir Uninstalling data-dir.
buildout: Installing data-dir Installing data-dir.
data-dir: Creating directory foo data-dir: Creating directory foo
data-dir: Creating directory bin data-dir: Creating directory bin
While: While:
Installing data-dir Installing data-dir.
<BLANKLINE> <BLANKLINE>
An internal error occured due to a bug in either zc.buildout or in a An internal error occured due to a bug in either zc.buildout or in a
recipe being used: recipe being used:
...@@ -484,11 +484,11 @@ If we fix the typo: ...@@ -484,11 +484,11 @@ If we fix the typo:
... """) ... """)
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Installing data-dir Installing data-dir.
data-dir: Creating directory foo data-dir: Creating directory foo
While: While:
Installing data-dir Installing data-dir.
<BLANKLINE> <BLANKLINE>
An internal error occured due to a bug in either zc.buildout or in a An internal error occured due to a bug in either zc.buildout or in a
recipe being used: recipe being used:
...@@ -560,12 +560,12 @@ And put back the typo: ...@@ -560,12 +560,12 @@ And put back the typo:
When we rerun the buildout: When we rerun the buildout:
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Installing data-dir Installing data-dir.
data-dir: Creating directory foo data-dir: Creating directory foo
data-dir: Creating directory bin data-dir: Creating directory bin
While: While:
Installing data-dir Installing data-dir.
<BLANKLINE> <BLANKLINE>
An internal error occured due to a bug in either zc.buildout or in a An internal error occured due to a bug in either zc.buildout or in a
recipe being used: recipe being used:
...@@ -636,12 +636,12 @@ If we rerun the buildout, again, we'll get the error and no ...@@ -636,12 +636,12 @@ If we rerun the buildout, again, we'll get the error and no
directiories will be created: directiories will be created:
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Installing data-dir Installing data-dir.
data-dir: Creating directory foo data-dir: Creating directory foo
data-dir: Creating directory bin data-dir: Creating directory bin
While: While:
Installing data-dir Installing data-dir.
<BLANKLINE> <BLANKLINE>
An internal error occured due to a bug in either zc.buildout or in a An internal error occured due to a bug in either zc.buildout or in a
recipe being used: recipe being used:
...@@ -666,8 +666,8 @@ Now, we'll fix the typo again and we'll get the directories we expect: ...@@ -666,8 +666,8 @@ Now, we'll fix the typo again and we'll get the directories we expect:
... """) ... """)
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Installing data-dir Installing data-dir.
data-dir: Creating directory foo data-dir: Creating directory foo
data-dir: Creating directory bins data-dir: Creating directory bins
...@@ -782,11 +782,11 @@ Now, if we run the buildout, we'll see the options with the values ...@@ -782,11 +782,11 @@ Now, if we run the buildout, we'll see the options with the values
substituted. substituted.
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling data-dir Uninstalling data-dir.
buildout: Installing data-dir Installing data-dir.
data-dir: Creating directory mydata data-dir: Creating directory mydata
buildout: Installing debug Installing debug.
File 1 /sample-buildout/mydata/file File 1 /sample-buildout/mydata/file
File 2 /sample-buildout/mydata/file/log File 2 /sample-buildout/mydata/file/log
recipe recipes:debug recipe recipes:debug
...@@ -801,9 +801,9 @@ recipe, so it assumed it could and reinstalled mydata. If we rerun ...@@ -801,9 +801,9 @@ recipe, so it assumed it could and reinstalled mydata. If we rerun
the buildout: the buildout:
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Updating data-dir Updating data-dir.
buildout: Updating debug Updating debug.
File 1 /sample-buildout/mydata/file File 1 /sample-buildout/mydata/file
File 2 /sample-buildout/mydata/file/log File 2 /sample-buildout/mydata/file/log
recipe recipes:debug recipe recipes:debug
...@@ -847,9 +847,9 @@ example, we can leave data-dir out of the parts list: ...@@ -847,9 +847,9 @@ example, we can leave data-dir out of the parts list:
It will still be treated as a part: It will still be treated as a part:
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Updating data-dir Updating data-dir.
buildout: Updating debug Updating debug.
File 1 /sample-buildout/mydata/file File 1 /sample-buildout/mydata/file
File 2 /sample-buildout/mydata/file/log File 2 /sample-buildout/mydata/file/log
recipe recipes:debug recipe recipes:debug
...@@ -885,9 +885,9 @@ the data-dir part after the debug part, it will be included before: ...@@ -885,9 +885,9 @@ the data-dir part after the debug part, it will be included before:
It will still be treated as a part: It will still be treated as a part:
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Updating data-dir Updating data-dir.
buildout: Updating debug Updating debug.
File 1 /sample-buildout/mydata/file File 1 /sample-buildout/mydata/file
File 2 /sample-buildout/mydata/file/log File 2 /sample-buildout/mydata/file/log
recipe recipes:debug recipe recipes:debug
...@@ -932,10 +932,10 @@ To see how this works, we use an example: ...@@ -932,10 +932,10 @@ To see how this works, we use an example:
... """) ... """)
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling debug Uninstalling debug.
buildout: Uninstalling data-dir Uninstalling data-dir.
buildout: Installing debug Installing debug.
op buildout op buildout
recipe recipes:debug recipe recipes:debug
...@@ -1004,9 +1004,9 @@ Here is a more elaborate example. ...@@ -1004,9 +1004,9 @@ Here is a more elaborate example.
... """) ... """)
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling debug Uninstalling debug.
buildout: Installing debug Installing debug.
name base name base
op buildout op buildout
op1 b1 1 op1 b1 1
...@@ -1066,9 +1066,9 @@ we'll set up a web server with some configuration files. ...@@ -1066,9 +1066,9 @@ we'll set up a web server with some configuration files.
>>> print system(buildout+ ' -c client.cfg'), >>> print system(buildout+ ' -c client.cfg'),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling debug Uninstalling debug.
buildout: Installing debug Installing debug.
name base name base
op1 r1 1 op1 r1 1
op2 r2 2 op2 r2 2
...@@ -1098,7 +1098,7 @@ buildout. ...@@ -1098,7 +1098,7 @@ buildout.
>>> print system(buildout + ' -c ' + server_url + '/remote.cfg'), >>> print system(buildout + ' -c ' + server_url + '/remote.cfg'),
While: While:
Initializing Initializing.
Error: Missing option: buildout:directory Error: Missing option: buildout:directory
Normally, the buildout directory defaults to directory Normally, the buildout directory defaults to directory
...@@ -1110,9 +1110,9 @@ normally be defined on the command line: ...@@ -1110,9 +1110,9 @@ normally be defined on the command line:
... + ' -c ' + server_url + '/remote.cfg' ... + ' -c ' + server_url + '/remote.cfg'
... + ' buildout:directory=' + sample_buildout ... + ' buildout:directory=' + sample_buildout
... ), ... ),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling debug Uninstalling debug.
buildout: Installing debug Installing debug.
name remote name remote
op1 r1 1 op1 r1 1
op2 r2 2 op2 r2 2
...@@ -1138,9 +1138,9 @@ delimiter.) ...@@ -1138,9 +1138,9 @@ delimiter.)
>>> os.environ['HOME'] = home >>> os.environ['HOME'] = home
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling debug Uninstalling debug.
buildout: Installing debug Installing debug.
name base name base
op buildout op buildout
op1 b1 1 op1 b1 1
...@@ -1155,9 +1155,9 @@ A buildout command-line argument, -U, can be used to suppress reading ...@@ -1155,9 +1155,9 @@ A buildout command-line argument, -U, can be used to suppress reading
user defaults: user defaults:
>>> print system(buildout + ' -U'), >>> print system(buildout + ' -U'),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling debug Uninstalling debug.
buildout: Installing debug Installing debug.
name base name base
op buildout op buildout
op1 b1 1 op1 b1 1
...@@ -1274,9 +1274,9 @@ Here's how these recipes could be used in a buildout: ...@@ -1274,9 +1274,9 @@ Here's how these recipes could be used in a buildout:
When the buildout is run the service will be installed When the buildout is run the service will be installed
>>> print system(buildout) >>> print system(buildout)
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling debug Uninstalling debug.
buildout: Installing service Installing service.
chkconfig --add /path/to/script chkconfig --add /path/to/script
<BLANKLINE> <BLANKLINE>
...@@ -1284,8 +1284,8 @@ The service has been installed. If the buildout is run again with no ...@@ -1284,8 +1284,8 @@ The service has been installed. If the buildout is run again with no
changes, the serivce shouldn't be changed. changes, the serivce shouldn't be changed.
>>> print system(buildout) >>> print system(buildout)
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Updating service Updating service.
<BLANKLINE> <BLANKLINE>
Now we change the service part to trigger uninstallation and Now we change the service part to trigger uninstallation and
...@@ -1303,11 +1303,11 @@ re-installation. ...@@ -1303,11 +1303,11 @@ re-installation.
... """) ... """)
>>> print system(buildout) >>> print system(buildout)
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling service Uninstalling service.
buildout: Running uninstall recipe Running uninstall recipe.
chkconfig --del /path/to/script chkconfig --del /path/to/script
buildout: Installing service Installing service.
chkconfig --add /path/to/a/different/script chkconfig --add /path/to/a/different/script
<BLANKLINE> <BLANKLINE>
...@@ -1324,11 +1324,11 @@ Now we remove the service part, and add another part. ...@@ -1324,11 +1324,11 @@ Now we remove the service part, and add another part.
... """) ... """)
>>> print system(buildout) >>> print system(buildout)
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling service Uninstalling service.
buildout: Running uninstall recipe Running uninstall recipe.
chkconfig --del /path/to/a/different/script chkconfig --del /path/to/a/different/script
buildout: Installing debug Installing debug.
recipe recipes:debug recipe recipes:debug
<BLANKLINE> <BLANKLINE>
...@@ -1391,11 +1391,11 @@ Now we can use it with a mkdir part. ...@@ -1391,11 +1391,11 @@ Now we can use it with a mkdir part.
Run the buildout to install the part. Run the buildout to install the part.
>>> print system(buildout) >>> print system(buildout)
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling debug Uninstalling debug.
buildout: Installing dir Installing dir.
dir: Creating directory my_directory dir: Creating directory my_directory
buildout: Installing debug Installing debug.
recipe recipes:debug recipe recipes:debug
<BLANKLINE> <BLANKLINE>
...@@ -1415,11 +1415,11 @@ When the buildout is run the part is removed, and the uninstall recipe ...@@ -1415,11 +1415,11 @@ When the buildout is run the part is removed, and the uninstall recipe
is run before the directory is deleted. is run before the directory is deleted.
>>> print system(buildout) >>> print system(buildout)
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling dir Uninstalling dir.
buildout: Running uninstall recipe Running uninstall recipe.
backing up directory /sample-buildout/my_directory of size 0 backing up directory /sample-buildout/my_directory of size 0
buildout: Updating debug Updating debug.
recipe recipes:debug recipe recipes:debug
<BLANKLINE> <BLANKLINE>
...@@ -1515,8 +1515,8 @@ Note that we used the installed buildout option to specify an ...@@ -1515,8 +1515,8 @@ Note that we used the installed buildout option to specify an
alternate file to store information about installed parts. alternate file to store information about installed parts.
>>> print system(buildout+' -c other.cfg debug:op1=foo -v'), >>> print system(buildout+' -c other.cfg debug:op1=foo -v'),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Installing debug Installing debug.
name other name other
op1 foo op1 foo
recipe recipes:debug recipe recipes:debug
...@@ -1528,8 +1528,8 @@ WARNING. ...@@ -1528,8 +1528,8 @@ WARNING.
Options can also be combined in the usual Unix way, as in: Options can also be combined in the usual Unix way, as in:
>>> print system(buildout+' -vcother.cfg debug:op1=foo'), >>> print system(buildout+' -vcother.cfg debug:op1=foo'),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Updating debug Updating debug.
name other name other
op1 foo op1 foo
recipe recipes:debug recipe recipes:debug
...@@ -1569,15 +1569,15 @@ the buildout in the usual way: ...@@ -1569,15 +1569,15 @@ the buildout in the usual way:
... """) ... """)
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling debug Uninstalling debug.
buildout: Installing debug Installing debug.
recipe recipes:debug recipe recipes:debug
buildout: Installing d1 Installing d1.
d1: Creating directory d1 d1: Creating directory d1
buildout: Installing d2 Installing d2.
d2: Creating directory d2 d2: Creating directory d2
buildout: Installing d3 Installing d3.
d3: Creating directory d3 d3: Creating directory d3
>>> ls(sample_buildout) >>> ls(sample_buildout)
...@@ -1651,11 +1651,11 @@ Now we'll update our configuration file: ...@@ -1651,11 +1651,11 @@ Now we'll update our configuration file:
and run the buildout specifying just d3 and d4: and run the buildout specifying just d3 and d4:
>>> print system(buildout+' install d3 d4'), >>> print system(buildout+' install d3 d4'),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling d3 Uninstalling d3.
buildout: Installing d3 Installing d3.
d3: Creating directory data3 d3: Creating directory data3
buildout: Installing d4 Installing d4.
d4: Creating directory data2-extra d4: Creating directory data2-extra
>>> ls(sample_buildout) >>> ls(sample_buildout)
...@@ -1720,17 +1720,17 @@ directories are still there. ...@@ -1720,17 +1720,17 @@ directories are still there.
Now, if we run the buildout without the install command: Now, if we run the buildout without the install command:
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling d2 Uninstalling d2.
buildout: Uninstalling d1 Uninstalling d1.
buildout: Uninstalling debug Uninstalling debug.
buildout: Installing debug Installing debug.
recipe recipes:debug recipe recipes:debug
x 1 x 1
buildout: Installing d2 Installing d2.
d2: Creating directory data2 d2: Creating directory data2
buildout: Updating d3 Updating d3.
buildout: Updating d4 Updating d4.
We see the output of the debug recipe and that data2 was created. We We see the output of the debug recipe and that data2 was created. We
also see that d1 and d2 have gone away: also see that d1 and d2 have gone away:
...@@ -1776,15 +1776,15 @@ provide alternate locations, and even names for these directories. ...@@ -1776,15 +1776,15 @@ provide alternate locations, and even names for these directories.
... )) ... ))
>>> print system(buildout), >>> print system(buildout),
buildout: Creating directory /sample-alt/scripts Creating directory '/sample-alt/scripts'.
buildout: Creating directory /sample-alt/work Creating directory '/sample-alt/work'.
buildout: Creating directory /sample-alt/basket Creating directory '/sample-alt/basket'.
buildout: Creating directory /sample-alt/developbasket Creating directory '/sample-alt/developbasket'.
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling d4 Uninstalling d4.
buildout: Uninstalling d3 Uninstalling d3.
buildout: Uninstalling d2 Uninstalling d2.
buildout: Uninstalling debug Uninstalling debug.
>>> ls(alt) >>> ls(alt)
d basket d basket
...@@ -1812,11 +1812,11 @@ You can also specify an alternate buildout directory: ...@@ -1812,11 +1812,11 @@ You can also specify an alternate buildout directory:
... )) ... ))
>>> print system(buildout), >>> print system(buildout),
buildout: Creating directory /sample-alt/bin Creating directory '/sample-alt/bin'.
buildout: Creating directory /sample-alt/parts Creating directory '/sample-alt/parts'.
buildout: Creating directory /sample-alt/eggs Creating directory '/sample-alt/eggs'.
buildout: Creating directory /sample-alt/develop-eggs Creating directory '/sample-alt/develop-eggs'.
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
>>> ls(alt) >>> ls(alt)
- .installed.cfg - .installed.cfg
...@@ -1864,7 +1864,7 @@ configuration file. Because the verbosity is subtracted from the log ...@@ -1864,7 +1864,7 @@ configuration file. Because the verbosity is subtracted from the log
level, we get a final log level of 20, which is the INFO level. level, we get a final log level of 20, which is the INFO level.
>>> print system(buildout), >>> print system(buildout),
INFO Develop: /sample-buildout/recipes INFO Develop: '/sample-buildout/recipes'
Predefined buildout options Predefined buildout options
--------------------------- ---------------------------
...@@ -1881,12 +1881,11 @@ database is shown. ...@@ -1881,12 +1881,11 @@ database is shown.
... parts = ... parts =
... """) ... """)
>>> print system(buildout+' -v'), >>> print system(buildout+' -vv'),
zc.buildout.easy_install: Installing ['zc.buildout', 'setuptools'] Installing 'zc.buildout', 'setuptools'.
zc.buildout.easy_install: We have a develop egg for zc.buildout We have a develop egg: zc.buildout 1.0.0.
zc.buildout.easy_install: We have the best distribution that satisfies We have the best distribution that satisfies 'setuptools'.
setuptools Picked: setuptools = 0.6
zc.buildout.easy_install.picked: setuptools = 0.6
<BLANKLINE> <BLANKLINE>
Configuration data: Configuration data:
[buildout] [buildout]
...@@ -1896,14 +1895,14 @@ database is shown. ...@@ -1896,14 +1895,14 @@ database is shown.
eggs-directory = /sample-buildout/eggs eggs-directory = /sample-buildout/eggs
executable = /usr/local/bin/python2.3 executable = /usr/local/bin/python2.3
installed = /sample-buildout/.installed.cfg installed = /sample-buildout/.installed.cfg
log-format = %(name)s: %(message)s log-format =
log-level = INFO log-level = INFO
newest = true newest = true
offline = false offline = false
parts = parts =
parts-directory = /sample-buildout/parts parts-directory = /sample-buildout/parts
python = buildout python = buildout
verbosity = 10 verbosity = 20
<BLANKLINE> <BLANKLINE>
All of these options can be overridden by configuration files or by All of these options can be overridden by configuration files or by
...@@ -1980,12 +1979,12 @@ local buildout scripts. ...@@ -1980,12 +1979,12 @@ local buildout scripts.
>>> print system(buildout >>> print system(buildout
... +' -c'+os.path.join(sample_bootstrapped, 'setup.cfg') ... +' -c'+os.path.join(sample_bootstrapped, 'setup.cfg')
... +' init'), ... +' init'),
Creating /sample-bootstrapped/setup.cfg Creating '/sample-bootstrapped/setup.cfg'.
buildout: Creating directory /sample-bootstrapped/bin Creating directory '/sample-bootstrapped/bin'.
buildout: Creating directory /sample-bootstrapped/parts Creating directory '/sample-bootstrapped/parts'.
buildout: Creating directory /sample-bootstrapped/eggs Creating directory '/sample-bootstrapped/eggs'.
buildout: Creating directory /sample-bootstrapped/develop-eggs Creating directory '/sample-bootstrapped/develop-eggs'.
zc.buildout.easy_install: Generated script /sample-bootstrapped/bin/buildout. Generated script '/sample-bootstrapped/bin/buildout'.
Note that a basic setup.cfg was created for us. Note that a basic setup.cfg was created for us.
...@@ -2022,7 +2021,7 @@ if there isn't a configuration file: ...@@ -2022,7 +2021,7 @@ if there isn't a configuration file:
... +' -c'+os.path.join(sample_bootstrapped2, 'setup.cfg') ... +' -c'+os.path.join(sample_bootstrapped2, 'setup.cfg')
... +' bootstrap'), ... +' bootstrap'),
While: While:
Initializing Initializing.
Error: Couldn't open /sample-bootstrapped2/setup.cfg Error: Couldn't open /sample-bootstrapped2/setup.cfg
>>> write(sample_bootstrapped2, 'setup.cfg', >>> write(sample_bootstrapped2, 'setup.cfg',
...@@ -2034,12 +2033,11 @@ if there isn't a configuration file: ...@@ -2034,12 +2033,11 @@ if there isn't a configuration file:
>>> print system(buildout >>> print system(buildout
... +' -c'+os.path.join(sample_bootstrapped2, 'setup.cfg') ... +' -c'+os.path.join(sample_bootstrapped2, 'setup.cfg')
... +' bootstrap'), ... +' bootstrap'),
buildout: Creating directory /sample-bootstrapped2/bin Creating directory '/sample-bootstrapped2/bin'.
buildout: Creating directory /sample-bootstrapped2/parts Creating directory '/sample-bootstrapped2/parts'.
buildout: Creating directory /sample-bootstrapped2/eggs Creating directory '/sample-bootstrapped2/eggs'.
buildout: Creating directory /sample-bootstrapped2/develop-eggs Creating directory '/sample-bootstrapped2/develop-eggs'.
zc.buildout.easy_install: Generated script /sample-bootstrapped2/bin/buildout. Generated script '/sample-bootstrapped2/bin/buildout'.
Newest and Offline Modes Newest and Offline Modes
...@@ -2080,8 +2078,8 @@ or on the command line: ...@@ -2080,8 +2078,8 @@ or on the command line:
... """) ... """)
>>> print system(buildout+' buildout:installed=inst.cfg'), >>> print system(buildout+' buildout:installed=inst.cfg'),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Installing debug Installing debug.
recipe recipes:debug recipe recipes:debug
>>> ls(sample_buildout) >>> ls(sample_buildout)
...@@ -2101,8 +2099,8 @@ buildout installed opttion: ...@@ -2101,8 +2099,8 @@ buildout installed opttion:
>>> os.remove('inst.cfg') >>> os.remove('inst.cfg')
>>> print system(buildout+' buildout:installed='), >>> print system(buildout+' buildout:installed='),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Installing debug Installing debug.
recipe recipes:debug recipe recipes:debug
>>> ls(sample_buildout) >>> ls(sample_buildout)
...@@ -2188,7 +2186,7 @@ egg to be built: ...@@ -2188,7 +2186,7 @@ egg to be built:
>>> os.chdir(sample_bootstrapped) >>> os.chdir(sample_bootstrapped)
>>> print system(os.path.join(sample_bootstrapped, 'bin', 'buildout')), >>> print system(os.path.join(sample_bootstrapped, 'bin', 'buildout')),
buildout: Develop: /sample-bootstrapped/demo Develop: '/sample-bootstrapped/demo'
Now we can add the extensions option. We were a bit tricly and ran Now we can add the extensions option. We were a bit tricly and ran
the buildout once with the demo develop egg defined but without the the buildout once with the demo develop egg defined but without the
...@@ -2209,7 +2207,7 @@ We see that our extension is loaded and executed: ...@@ -2209,7 +2207,7 @@ We see that our extension is loaded and executed:
>>> print system(os.path.join(sample_bootstrapped, 'bin', 'buildout')), >>> print system(os.path.join(sample_bootstrapped, 'bin', 'buildout')),
ext ['buildout'] ext ['buildout']
buildout: Develop: /sample-bootstrapped/demo Develop: '/sample-bootstrapped/demo'
......
...@@ -57,10 +57,10 @@ And create a buildout that uses it: ...@@ -57,10 +57,10 @@ And create a buildout that uses it:
If we run the buildout, we'll get an error: If we run the buildout, we'll get an error:
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Installing data-dir Installing data-dir.
While: While:
Installing data-dir Installing data-dir.
Error: Missing option: data-dir:directory Error: Missing option: data-dir:directory
...@@ -72,10 +72,10 @@ supply some input: ...@@ -72,10 +72,10 @@ supply some input:
... p self.options.keys() ... p self.options.keys()
... q ... q
... """), ... """),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Installing data-dir Installing data-dir.
While: While:
Installing data-dir Installing data-dir.
Traceback (most recent call last): Traceback (most recent call last):
File "/zc/buildout/buildout.py", line 1294, in main File "/zc/buildout/buildout.py", line 1294, in main
getattr(buildout, command)(args) getattr(buildout, command)(args)
......
...@@ -59,12 +59,12 @@ server as usual: ...@@ -59,12 +59,12 @@ server as usual:
GET 200 / GET 200 /
GET 200 /demo-0.2-py2.4.egg GET 200 /demo-0.2-py2.4.egg
GET 200 /demoneeded-1.1.zip GET 200 /demoneeded-1.1.zip
buildout: Installing eggs Installing eggs.
zc.buildout.easy_install: Getting new distribution for demo==0.2 Getting distribution for 'demo==0.2'.
zc.buildout.easy_install: Got demo 0.2 Got demo 0.2.
zc.buildout.easy_install: Getting new distribution for demoneeded Getting distribution for 'demoneeded'.
zc.buildout.easy_install: Got demoneeded 1.1 Got demoneeded 1.1.
zc.buildout.easy_install: Generated script /sample-buildout/bin/demo. Generated script '/sample-buildout/bin/demo'.
We'll also get the download cache populated. The buildout doesn't put We'll also get the download cache populated. The buildout doesn't put
files in the cache directly. It creates an intermediate directory, files in the cache directly. It creates an intermediate directory,
...@@ -87,12 +87,11 @@ If we remove the installed eggs from eggs directory and re-run the buildout: ...@@ -87,12 +87,11 @@ If we remove the installed eggs from eggs directory and re-run the buildout:
>>> print system(buildout), >>> print system(buildout),
GET 200 / GET 200 /
buildout: Updating eggs Updating eggs.
zc.buildout.easy_install: Getting new distribution for demo==0.2 Getting distribution for 'demo==0.2'.
zc.buildout.easy_install: Got demo 0.2 Got demo 0.2.
zc.buildout.easy_install: Getting new distribution for demoneeded Getting distribution for 'demoneeded'.
zc.buildout.easy_install: Got demoneeded 1.1 Got demoneeded 1.1.
zc.buildout.easy_install: Generated script /sample-buildout/bin/demo.
We see that the distributions aren't downloaded, because they're We see that the distributions aren't downloaded, because they're
downloaded from the cache. downloaded from the cache.
...@@ -130,10 +129,10 @@ install-from-cache option set to true: ...@@ -130,10 +129,10 @@ install-from-cache option set to true:
... ''' % globals()) ... ''' % globals())
>>> print system(buildout), >>> print system(buildout),
buildout: Uninstalling eggs Uninstalling eggs.
buildout: Installing eggs Installing eggs.
zc.buildout.easy_install: Getting new distribution for demo Getting distribution for 'demo'.
zc.buildout.easy_install: Got demo 0.2 Got demo 0.2.
zc.buildout.easy_install: Getting new distribution for demoneeded Getting distribution for 'demoneeded'.
zc.buildout.easy_install: Got demoneeded 1.1 Got demoneeded 1.1.
zc.buildout.easy_install: Generated script /sample-buildout/bin/demo. Generated script '/sample-buildout/bin/demo'.
...@@ -37,7 +37,6 @@ except AttributeError: ...@@ -37,7 +37,6 @@ except AttributeError:
default_index_url = os.environ.get('buildout-testing-index-url') default_index_url = os.environ.get('buildout-testing-index-url')
logger = logging.getLogger('zc.buildout.easy_install') logger = logging.getLogger('zc.buildout.easy_install')
picked = logging.getLogger('zc.buildout.easy_install.picked')
url_match = re.compile('[a-z0-9+.-]+://').match url_match = re.compile('[a-z0-9+.-]+://').match
...@@ -161,8 +160,8 @@ class Installer: ...@@ -161,8 +160,8 @@ class Installer:
def _satisfied(self, req, source=None): def _satisfied(self, req, source=None):
dists = [dist for dist in self._env[req.project_name] if dist in req] dists = [dist for dist in self._env[req.project_name] if dist in req]
if not dists: if not dists:
logger.debug('We have no distributions for %s that satisfies %s.', logger.debug('We have no distributions for %s that satisfies %r.',
req.project_name, req) req.project_name, str(req))
return None, self._obtain(req, source) return None, self._obtain(req, source)
# Note that dists are sorted from best to worst, as promised by # Note that dists are sorted from best to worst, as promised by
...@@ -170,7 +169,7 @@ class Installer: ...@@ -170,7 +169,7 @@ class Installer:
for dist in dists: for dist in dists:
if (dist.precedence == pkg_resources.DEVELOP_DIST): if (dist.precedence == pkg_resources.DEVELOP_DIST):
logger.debug('We have a develop egg for %s', req) logger.debug('We have a develop egg: %s', dist)
return dist, None return dist, None
if not self._newest: if not self._newest:
...@@ -210,8 +209,8 @@ class Installer: ...@@ -210,8 +209,8 @@ class Installer:
# Check if we have the upper limit # Check if we have the upper limit
if maxv is not None and best_we_have.version == maxv: if maxv is not None and best_we_have.version == maxv:
logger.debug('We have the best distribution that satisfies\n%s', logger.debug('We have the best distribution that satisfies %r.',
req) str(req))
return best_we_have, None return best_we_have, None
# We have some installed distros. There might, theoretically, be # We have some installed distros. There might, theoretically, be
...@@ -229,16 +228,17 @@ class Installer: ...@@ -229,16 +228,17 @@ class Installer:
# That's a bit odd. There aren't any distros available. # That's a bit odd. There aren't any distros available.
# We should use the best one we have that meets the requirement. # We should use the best one we have that meets the requirement.
logger.debug( logger.debug(
'There are no distros available that meet %s. Using our best.', 'There are no distros available that meet %r.\n'
req) 'Using our best, %s.',
str(req), best_available)
return best_we_have, None return best_we_have, None
else: else:
# Let's find out if we already have the best available: # Let's find out if we already have the best available:
if best_we_have.parsed_version >= best_available.parsed_version: if best_we_have.parsed_version >= best_available.parsed_version:
# Yup. Use it. # Yup. Use it.
logger.debug( logger.debug(
'We have the best distribution that satisfies\n%s', 'We have the best distribution that satisfies %r.',
req) str(req))
return best_we_have, None return best_we_have, None
return None, best_available return None, best_available
...@@ -381,7 +381,7 @@ class Installer: ...@@ -381,7 +381,7 @@ class Installer:
def _get_dist(self, requirement, ws, always_unzip): def _get_dist(self, requirement, ws, always_unzip):
__doing__ = 'Getting distribution for %s', requirement __doing__ = 'Getting distribution for %r.', str(requirement)
# Maybe an existing dist is already the best dist that satisfies the # Maybe an existing dist is already the best dist that satisfies the
# requirement # requirement
...@@ -389,7 +389,7 @@ class Installer: ...@@ -389,7 +389,7 @@ class Installer:
if dist is None: if dist is None:
if self._dest is not None: if self._dest is not None:
logger.info("Getting new distribution for %s", requirement) logger.info(*__doing__)
# Retrieve the dist: # Retrieve the dist:
if avail is None: if avail is None:
...@@ -463,7 +463,7 @@ class Installer: ...@@ -463,7 +463,7 @@ class Installer:
self._env.scan([self._dest]) self._env.scan([self._dest])
dist = self._env.best_match(requirement, ws) dist = self._env.best_match(requirement, ws)
logger.info("Got %s", dist) logger.info("Got %s.", dist)
else: else:
dists = [dist] dists = [dist]
...@@ -490,7 +490,8 @@ class Installer: ...@@ -490,7 +490,8 @@ class Installer:
and and
requirement.specs[0][0] == '==') requirement.specs[0][0] == '==')
): ):
picked.debug('%s = %s', dist.project_name, dist.version) logger.debug('Picked: %s = %s',
dist.project_name, dist.version)
return dists return dists
...@@ -503,7 +504,7 @@ class Installer: ...@@ -503,7 +504,7 @@ class Installer:
# We have a namespace package but no requirement for setuptools # We have a namespace package but no requirement for setuptools
if dist.precedence == pkg_resources.DEVELOP_DIST: if dist.precedence == pkg_resources.DEVELOP_DIST:
logger.warn( logger.warn(
"Develop distribution for %s\n" "Develop distribution: %s\n"
"uses namespace packages but the distribution " "uses namespace packages but the distribution "
"does not require setuptools.", "does not require setuptools.",
dist) dist)
...@@ -520,7 +521,7 @@ class Installer: ...@@ -520,7 +521,7 @@ class Installer:
if version: if version:
if version not in requirement: if version not in requirement:
logger.error("The version, %s, is not consistent with the " logger.error("The version, %s, is not consistent with the "
"requirement, %s", version, requirement) "requirement, %r.", version, str(requirement))
raise IncompatibleVersionError("Bad version", version) raise IncompatibleVersionError("Bad version", version)
requirement = pkg_resources.Requirement.parse( requirement = pkg_resources.Requirement.parse(
...@@ -530,7 +531,7 @@ class Installer: ...@@ -530,7 +531,7 @@ class Installer:
def install(self, specs, working_set=None): def install(self, specs, working_set=None):
logger.debug('Installing %r', specs) logger.debug('Installing %s.', repr(specs)[1:-1])
path = self._path path = self._path
dest = self._dest dest = self._dest
...@@ -567,9 +568,14 @@ class Installer: ...@@ -567,9 +568,14 @@ class Installer:
[requirement] = err [requirement] = err
requirement = self._constrain(requirement) requirement = self._constrain(requirement)
if dest: if dest:
logger.debug('Getting required %s', requirement) logger.debug('Getting required %r', str(requirement))
else:
logger.debug('Adding required %r', str(requirement))
_log_requirement(ws, requirement)
for dist in self._get_dist(requirement, ws, self._always_unzip for dist in self._get_dist(requirement, ws, self._always_unzip
): ):
ws.add(dist) ws.add(dist)
self._maybe_add_setuptools(ws, dist) self._maybe_add_setuptools(ws, dist)
except pkg_resources.VersionConflict, err: except pkg_resources.VersionConflict, err:
...@@ -590,8 +596,8 @@ class Installer: ...@@ -590,8 +596,8 @@ class Installer:
# Retrieve the dist: # Retrieve the dist:
if avail is None: if avail is None:
raise zc.buildout.UserError( raise zc.buildout.UserError(
"Couldn't find a source distribution for %s." "Couldn't find a source distribution for %r."
% requirement) % str(requirement))
logger.debug('Building %r', spec) logger.debug('Building %r', spec)
...@@ -760,7 +766,8 @@ def develop(setup, dest, ...@@ -760,7 +766,8 @@ def develop(setup, dest,
del args[1] del args[1]
else: else:
args[1] == '-v' args[1] == '-v'
logger.debug("in: %s\n%r", directory, args) if logger.getEffectiveLevel < logging.DEBUG:
logger.debug("in: %r\n%s", directory, ' '.join(args))
assert os.spawnl(os.P_WAIT, executable, executable, *args) == 0 assert os.spawnl(os.P_WAIT, executable, executable, *args) == 0
...@@ -833,27 +840,34 @@ def _script(module_name, attrs, path, dest, executable, arguments, ...@@ -833,27 +840,34 @@ def _script(module_name, attrs, path, dest, executable, arguments,
generated = [] generated = []
script = dest script = dest
if sys.platform == 'win32': if sys.platform == 'win32':
# generate exe file and give the script a magic name:
open(dest+'.exe', 'wb').write(
pkg_resources.resource_string('setuptools', 'cli.exe')
)
generated.append(dest+'.exe')
dest += '-script.py' dest += '-script.py'
contents = script_template % dict(
open(dest, 'w').write(script_template % dict(
python = executable, python = executable,
path = path, path = path,
module_name = module_name, module_name = module_name,
attrs = attrs, attrs = attrs,
arguments = arguments, arguments = arguments,
initialization = initialization, initialization = initialization,
)) )
changed = not (os.path.exists(dest) and open(dest).read() == contents)
if sys.platform == 'win32':
# generate exe file and give the script a magic name:
open(dest+'.exe', 'wb').write(
pkg_resources.resource_string('setuptools', 'cli.exe')
)
generated.append(dest+'.exe')
if changed:
open(dest, 'w').write(contents)
logger.info("Generated script %r.", script)
try: try:
os.chmod(dest, 0755) os.chmod(dest, 0755)
except (AttributeError, os.error): except (AttributeError, os.error):
pass pass
generated.append(dest) generated.append(dest)
logger.info("Generated script %s.", script)
return generated return generated
script_template = '''\ script_template = '''\
...@@ -874,24 +888,31 @@ if __name__ == '__main__': ...@@ -874,24 +888,31 @@ if __name__ == '__main__':
def _pyscript(path, dest, executable): def _pyscript(path, dest, executable):
generated = [] generated = []
script = dest script = dest
if sys.platform == 'win32':
dest += '-script.py'
contents = py_script_template % dict(
python = executable,
path = path,
)
changed = not (os.path.exists(dest) and open(dest).read() == contents)
if sys.platform == 'win32': if sys.platform == 'win32':
# generate exe file and give the script a magic name: # generate exe file and give the script a magic name:
open(dest+'.exe', 'wb').write( open(dest+'.exe', 'wb').write(
pkg_resources.resource_string('setuptools', 'cli.exe') pkg_resources.resource_string('setuptools', 'cli.exe')
) )
generated.append(dest+'.exe') generated.append(dest+'.exe')
dest += '-script.py'
open(dest, 'w').write(py_script_template % dict( if changed:
python = executable, open(dest, 'w').write(contents)
path = path,
))
try: try:
os.chmod(dest,0755) os.chmod(dest,0755)
except (AttributeError, os.error): except (AttributeError, os.error):
pass pass
logger.info("Generated interpreter %r.", script)
generated.append(dest) generated.append(dest)
logger.info("Generated interpreter %s.", script)
return generated return generated
py_script_template = '''\ py_script_template = '''\
...@@ -937,6 +958,8 @@ execfile(%(setup)r) ...@@ -937,6 +958,8 @@ execfile(%(setup)r)
class VersionConflict(zc.buildout.UserError): class VersionConflict(zc.buildout.UserError):
def __init__(self, err, ws): def __init__(self, err, ws):
ws = list(ws)
ws.sort()
self.err, self.ws = err, ws self.err, self.ws = err, ws
def __str__(self): def __str__(self):
...@@ -946,35 +969,26 @@ class VersionConflict(zc.buildout.UserError): ...@@ -946,35 +969,26 @@ class VersionConflict(zc.buildout.UserError):
] ]
for dist in self.ws: for dist in self.ws:
if req in dist.requires(): if req in dist.requires():
result.append("but %s requires %s." % (dist, req)) result.append("but %s requires %r." % (dist, str(req)))
_needed(self.ws, dist, result.append, [dist])
return '\n'.join(result) return '\n'.join(result)
class MissingDistribution(zc.buildout.UserError): class MissingDistribution(zc.buildout.UserError):
def __init__(self, req, ws): def __init__(self, req, ws):
ws = list(ws)
ws.sort()
self.data = req, ws self.data = req, ws
def __str__(self): def __str__(self):
req, ws = self.data req, ws = self.data
result = ["Couldn't find a distribution for %s." % req] return "Couldn't find a distribution for %r." % str(req)
for dist in ws:
if req in dist.requires():
result.append("%s is required by %s." % (req, dist))
_needed(ws, dist, result.append, [dist])
return '\n'.join(result)
def _needed(ws, needed_dist, write, seen): def _log_requirement(ws, req):
ws = list(ws)
ws.sort()
for dist in ws: for dist in ws:
if dist in seen: if req in dist.requires():
continue logger.debug(" required by %s." % dist)
for req in dist.requires():
if needed_dist in req:
write("%s is required by %s." % (needed_dist, dist))
seen.append(dist)
_needed(ws, dist, write, seen)
seen.pop()
def _fix_file_links(links): def _fix_file_links(links):
for link in links: for link in links:
...@@ -983,3 +997,6 @@ def _fix_file_links(links): ...@@ -983,3 +997,6 @@ def _fix_file_links(links):
# work around excessive restriction in setuptools: # work around excessive restriction in setuptools:
link += '/' link += '/'
yield link yield link
...@@ -228,9 +228,9 @@ we'll get an error: ...@@ -228,9 +228,9 @@ we'll get an error:
>>> print handler >>> print handler
zc.buildout.easy_install DEBUG zc.buildout.easy_install DEBUG
Installing ['demo >0.2'] Installing 'demo >0.2'.
zc.buildout.easy_install ERROR zc.buildout.easy_install ERROR
The version, 0.2, is not consistent with the requirement, demo>0.2 The version, 0.2, is not consistent with the requirement, 'demo>0.2'.
>>> handler.clear() >>> handler.clear()
...@@ -243,19 +243,19 @@ reporting that a version was picked automatically: ...@@ -243,19 +243,19 @@ reporting that a version was picked automatically:
>>> print handler >>> print handler
zc.buildout.easy_install DEBUG zc.buildout.easy_install DEBUG
Installing ['demo'] Installing 'demo'.
zc.buildout.easy_install DEBUG zc.buildout.easy_install DEBUG
We have the best distribution that satisfies We have the best distribution that satisfies 'demo'.
demo
zc.buildout.easy_install.picked DEBUG
demo = 0.3
zc.buildout.easy_install DEBUG zc.buildout.easy_install DEBUG
Getting required demoneeded Picked: demo = 0.3
zc.buildout.easy_install DEBUG zc.buildout.easy_install DEBUG
We have the best distribution that satisfies Getting required 'demoneeded'
demoneeded zc.buildout.easy_install DEBUG
zc.buildout.easy_install.picked DEBUG required by demo 0.3.
demoneeded = 1.1 zc.buildout.easy_install DEBUG
We have the best distribution that satisfies 'demoneeded'.
zc.buildout.easy_install DEBUG
Picked: demoneeded = 1.1
>>> handler.uninstall() >>> handler.uninstall()
>>> logging.getLogger('zc.buildout.easy_install').propagate = True >>> logging.getLogger('zc.buildout.easy_install').propagate = True
......
...@@ -40,7 +40,7 @@ To see how this works, we'll create two versions of a recipe egg: ...@@ -40,7 +40,7 @@ To see how this works, we'll create two versions of a recipe egg:
>>> write('recipe', 'README', '') >>> write('recipe', 'README', '')
>>> print system(buildout+' setup recipe bdist_egg'), # doctest: +ELLIPSIS >>> print system(buildout+' setup recipe bdist_egg'), # doctest: +ELLIPSIS
buildout: Running setup script recipe/setup.py Running setup script 'recipe/setup.py'.
... ...
>>> rmdir('recipe', 'build') >>> rmdir('recipe', 'build')
...@@ -65,7 +65,7 @@ To see how this works, we'll create two versions of a recipe egg: ...@@ -65,7 +65,7 @@ To see how this works, we'll create two versions of a recipe egg:
>>> print system(buildout+' setup recipe bdist_egg'), # doctest: +ELLIPSIS >>> print system(buildout+' setup recipe bdist_egg'), # doctest: +ELLIPSIS
buildout: Running setup script recipe/setup.py Running setup script 'recipe/setup.py'.
... ...
and we'll configure a buildout to use it: and we'll configure a buildout to use it:
...@@ -83,9 +83,9 @@ and we'll configure a buildout to use it: ...@@ -83,9 +83,9 @@ and we'll configure a buildout to use it:
If we run the buildout, it will use version 2: If we run the buildout, it will use version 2:
>>> print system(buildout), >>> print system(buildout),
zc.buildout.easy_install: Getting new distribution for spam Getting distribution for 'spam'.
zc.buildout.easy_install: Got spam 2 Got spam 2.
buildout: Installing foo Installing foo.
recipe v2 recipe v2
We can specify a versions section that lists our recipe and name it in We can specify a versions section that lists our recipe and name it in
...@@ -113,10 +113,10 @@ as in the versions option. ...@@ -113,10 +113,10 @@ as in the versions option.
Now, if we run the buildout, we'll use version 1 of the spam recipe: Now, if we run the buildout, we'll use version 1 of the spam recipe:
>>> print system(buildout), >>> print system(buildout),
zc.buildout.easy_install: Getting new distribution for spam==1 Getting distribution for 'spam==1'.
zc.buildout.easy_install: Got spam 1 Got spam 1.
buildout: Uninstalling foo Uninstalling foo.
buildout: Installing foo Installing foo.
recipe v1 recipe v1
Running the buildout in verbose mode will help us get information Running the buildout in verbose mode will help us get information
...@@ -124,18 +124,15 @@ about versions used. If we run the buildout in verbose mode without ...@@ -124,18 +124,15 @@ about versions used. If we run the buildout in verbose mode without
specifying a versions section: specifying a versions section:
>>> print system(buildout+' buildout:versions= -v'), # doctest: +ELLIPSIS >>> print system(buildout+' buildout:versions= -v'), # doctest: +ELLIPSIS
zc.buildout.easy_install: Installing ['zc.buildout', 'setuptools'] Installing 'zc.buildout', 'setuptools'.
zc.buildout.easy_install: We have a develop egg for zc.buildout We have a develop egg: zc.buildout 1.0.0.
zc.buildout.easy_install: We have the best distribution that satisfies We have the best distribution that satisfies 'setuptools'.
setuptools Picked: setuptools = 0.6
zc.buildout.easy_install.picked: setuptools = 0.6 Installing 'spam'.
zc.buildout.easy_install: Installing ['spam'] We have the best distribution that satisfies 'spam'.
zc.buildout.easy_install: We have the best distribution that satisfies Picked: spam = 2.
spam Uninstalling foo.
zc.buildout.easy_install.picked: spam = 2 Installing foo.
...
buildout: Uninstalling foo
buildout: Installing foo
recipe v2 recipe v2
We'll get output that includes lines that tell us what versions We'll get output that includes lines that tell us what versions
...@@ -149,17 +146,14 @@ that we can fix them in a versions section. ...@@ -149,17 +146,14 @@ that we can fix them in a versions section.
If we run the buildout with the versions section: If we run the buildout with the versions section:
>>> print system(buildout+' -v'), # doctest: +ELLIPSIS >>> print system(buildout+' -v'), # doctest: +ELLIPSIS
zc.buildout.easy_install: Installing ['zc.buildout', 'setuptools'] Installing 'zc.buildout', 'setuptools'.
zc.buildout.easy_install: We have a develop egg for zc.buildout We have a develop egg: zc.buildout 1.0.0.
zc.buildout.easy_install: We have the best distribution that satisfies We have the best distribution that satisfies 'setuptools'.
setuptools Picked: setuptools = 0.6
zc.buildout.easy_install.picked: setuptools = 0.6 Installing 'spam'.
zc.buildout.easy_install: Installing ['spam'] We have the best distribution that satisfies 'spam==1'.
zc.buildout.easy_install: We have the best distribution that satisfies Uninstalling foo.
spam==1 Installing foo.
...
buildout: Uninstalling foo
buildout: Installing foo
recipe v1 recipe v1
We won't get output for the spam distribution, which we didn't pick, We won't get output for the spam distribution, which we didn't pick,
......
...@@ -33,7 +33,7 @@ To illustrate this, we'll create a package in a sample buildout: ...@@ -33,7 +33,7 @@ To illustrate this, we'll create a package in a sample buildout:
We can use the buildout command to generate the hello egg: We can use the buildout command to generate the hello egg:
>>> print system(buildout +' setup hello -q bdist_egg'), >>> print system(buildout +' setup hello -q bdist_egg'),
buildout: Running setup script hello/setup.py Running setup script 'hello/setup.py'.
zip_safe flag not set; analyzing archive contents... zip_safe flag not set; analyzing archive contents...
The hello directory now has a hello egg in it's dist directory: The hello directory now has a hello egg in it's dist directory:
......
...@@ -45,7 +45,7 @@ We should be able to deal with setup scripts that aren't setuptools based. ...@@ -45,7 +45,7 @@ We should be able to deal with setup scripts that aren't setuptools based.
... ''') ... ''')
>>> print system(join('bin', 'buildout')), >>> print system(join('bin', 'buildout')),
buildout: Develop: /sample-buildout/foo Develop: '/sample-buildout/foo'
>>> ls('develop-eggs') >>> ls('develop-eggs')
- foo.egg-link - foo.egg-link
...@@ -72,8 +72,8 @@ We should be able to deal with setup scripts that aren't setuptools based. ...@@ -72,8 +72,8 @@ We should be able to deal with setup scripts that aren't setuptools based.
... ''') ... ''')
>>> print system(join('bin', 'buildout')+' -vv'), # doctest: +ELLIPSIS >>> print system(join('bin', 'buildout')+' -vv'), # doctest: +ELLIPSIS
zc.buildout... Installing...
buildout: Develop: /sample-buildout/foo Develop: '/sample-buildout/foo'
... ...
Installed /sample-buildout/foo Installed /sample-buildout/foo
... ...
...@@ -119,13 +119,13 @@ It is an error to create a variable-reference cycle: ...@@ -119,13 +119,13 @@ It is an error to create a variable-reference cycle:
>>> print system(os.path.join(sample_buildout, 'bin', 'buildout')), >>> print system(os.path.join(sample_buildout, 'bin', 'buildout')),
... # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS ... # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
While: While:
Initializing Initializing.
Getting section buildout Getting section buildout.
Initializing section buildout Initializing section buildout.
Getting option buildout:y Getting option buildout:y.
Getting option buildout:z Getting option buildout:z.
Getting option buildout:x Getting option buildout:x.
Getting option buildout:y Getting option buildout:y.
Error: Circular reference in substitutions. Error: Circular reference in substitutions.
It is an error to use funny characters in variable refereces: It is an error to use funny characters in variable refereces:
...@@ -140,10 +140,10 @@ It is an error to use funny characters in variable refereces: ...@@ -140,10 +140,10 @@ It is an error to use funny characters in variable refereces:
>>> print system(os.path.join(sample_buildout, 'bin', 'buildout')), >>> print system(os.path.join(sample_buildout, 'bin', 'buildout')),
While: While:
Initializing Initializing.
Getting section buildout Getting section buildout.
Initializing section buildout Initializing section buildout.
Getting option buildout:x Getting option buildout:x.
Error: The section name in substitution, ${bui$ldout:y}, Error: The section name in substitution, ${bui$ldout:y},
has invalid characters. has invalid characters.
...@@ -157,10 +157,10 @@ It is an error to use funny characters in variable refereces: ...@@ -157,10 +157,10 @@ It is an error to use funny characters in variable refereces:
>>> print system(os.path.join(sample_buildout, 'bin', 'buildout')), >>> print system(os.path.join(sample_buildout, 'bin', 'buildout')),
While: While:
Initializing Initializing.
Getting section buildout Getting section buildout.
Initializing section buildout Initializing section buildout.
Getting option buildout:x Getting option buildout:x.
Error: The option name in substitution, ${buildout:y{z}, Error: The option name in substitution, ${buildout:y{z},
has invalid characters. has invalid characters.
...@@ -176,10 +176,10 @@ and too have too many or too few colons: ...@@ -176,10 +176,10 @@ and too have too many or too few colons:
>>> print system(os.path.join(sample_buildout, 'bin', 'buildout')), >>> print system(os.path.join(sample_buildout, 'bin', 'buildout')),
While: While:
Initializing Initializing.
Getting section buildout Getting section buildout.
Initializing section buildout Initializing section buildout.
Getting option buildout:x Getting option buildout:x.
Error: The substitution, ${parts}, Error: The substitution, ${parts},
doesn't contain a colon. doesn't contain a colon.
...@@ -193,10 +193,10 @@ and too have too many or too few colons: ...@@ -193,10 +193,10 @@ and too have too many or too few colons:
>>> print system(os.path.join(sample_buildout, 'bin', 'buildout')), >>> print system(os.path.join(sample_buildout, 'bin', 'buildout')),
While: While:
Initializing Initializing.
Getting section buildout Getting section buildout.
Initializing section buildout Initializing section buildout.
Getting option buildout:x Getting option buildout:x.
Error: The substitution, ${buildout:y:z}, Error: The substitution, ${buildout:y:z},
has too many colons. has too many colons.
...@@ -210,8 +210,8 @@ Al parts have to have a section: ...@@ -210,8 +210,8 @@ Al parts have to have a section:
>>> print system(os.path.join(sample_buildout, 'bin', 'buildout')), >>> print system(os.path.join(sample_buildout, 'bin', 'buildout')),
While: While:
Installing Installing.
Getting section x Getting section x.
Error: The referenced section, 'x', was not defined. Error: The referenced section, 'x', was not defined.
and all parts have to have a specified recipe: and all parts have to have a specified recipe:
...@@ -228,7 +228,7 @@ and all parts have to have a specified recipe: ...@@ -228,7 +228,7 @@ and all parts have to have a specified recipe:
>>> print system(os.path.join(sample_buildout, 'bin', 'buildout')), >>> print system(os.path.join(sample_buildout, 'bin', 'buildout')),
While: While:
Installing Installing.
Error: Missing option: x:recipe Error: Missing option: x:recipe
""" """
...@@ -276,16 +276,16 @@ def show_who_requires_when_there_is_a_conflict(): ...@@ -276,16 +276,16 @@ def show_who_requires_when_there_is_a_conflict():
... ''' % globals()) ... ''' % globals())
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/sampley Develop: '/sample-buildout/sampley'
buildout: Develop: /sample-buildout/samplez Develop: '/sample-buildout/samplez'
buildout: Installing eggs Installing eggs.
zc.buildout.easy_install: Getting new distribution for demoneeded==1.1 Getting distribution for 'demoneeded==1.1'.
zc.buildout.easy_install: Got demoneeded 1.1 Got demoneeded 1.1.
While: While:
Installing eggs Installing eggs.
Error: There is a version conflict. Error: There is a version conflict.
We already have: demoneeded 1.1 We already have: demoneeded 1.1
but sampley 1 requires demoneeded==1.0. but sampley 1 requires 'demoneeded==1.0'.
Here, we see that sampley required an older version of demoneeded. Here, we see that sampley required an older version of demoneeded.
What if we hadn't required sampley ourselves: What if we hadn't required sampley ourselves:
...@@ -306,19 +306,37 @@ def show_who_requires_when_there_is_a_conflict(): ...@@ -306,19 +306,37 @@ def show_who_requires_when_there_is_a_conflict():
... samplez ... samplez
... ''' % globals()) ... ''' % globals())
>>> print system(buildout), If we use the verbose switch, we can see where requirements are comning from:
buildout: Develop: /sample-buildout/sampley
buildout: Develop: /sample-buildout/samplez >>> print system(buildout+' -v'),
buildout: Develop: /sample-buildout/samplea Installing 'zc.buildout', 'setuptools'.
buildout: Develop: /sample-buildout/sampleb We have a develop egg: zc.buildout 1.0.0
buildout: Installing eggs We have the best distribution that satisfies 'setuptools'.
Picked: setuptools = 0.6
Develop: '/sample-buildout/sampley'
Develop: '/sample-buildout/samplez'
Develop: '/sample-buildout/samplea'
Develop: '/sample-buildout/sampleb'
Installing 'zc.recipe.egg'.
We have a develop egg: zc.recipe.egg 1.0.0
Installing eggs.
Installing 'samplea', 'samplez'.
We have a develop egg: samplea 1
We have a develop egg: samplez 1
Getting required 'demoneeded==1.1'
required by samplez 1.
We have the best distribution that satisfies 'demoneeded==1.1'.
Getting required 'sampleb'
required by samplea 1.
We have a develop egg: sampleb 1
Getting required 'sampley'
required by sampleb 1.
We have a develop egg: sampley 1
While: While:
Installing eggs Installing eggs.
Error: There is a version conflict. Error: There is a version conflict.
We already have: demoneeded 1.1 We already have: demoneeded 1.1
but sampley 1 requires demoneeded==1.0. but sampley 1 requires 'demoneeded==1.0'.
sampley 1 is required by sampleb 1.
sampleb 1 is required by samplea 1.
""" """
def show_who_requires_missing_distributions(): def show_who_requires_missing_distributions():
...@@ -345,20 +363,16 @@ def show_who_requires_missing_distributions(): ...@@ -345,20 +363,16 @@ def show_who_requires_missing_distributions():
... ''') ... ''')
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/sampley Develop: '/sample-buildout/sampley'
buildout: Develop: /sample-buildout/samplea Develop: '/sample-buildout/samplea'
buildout: Develop: /sample-buildout/sampleb Develop: '/sample-buildout/sampleb'
buildout: Installing eggs Installing eggs.
Couldn't find index page for 'demoneeded' (maybe misspelled?) Couldn't find index page for 'demoneeded' (maybe misspelled?)
zc.buildout.easy_install: Getting new distribution for demoneeded Getting distribution for 'demoneeded'.
While: While:
Installing eggs Installing eggs.
Getting distribution for demoneeded Getting distribution for 'demoneeded'.
Error: Couldn't find a distribution for demoneeded. Error: Couldn't find a distribution for 'demoneeded'.
demoneeded is required by sampley 1.
sampley 1 is required by sampleb 1.
sampleb 1 is required by samplea 1.
""" """
...@@ -426,15 +440,15 @@ def test_comparing_saved_options_with_funny_characters(): ...@@ -426,15 +440,15 @@ def test_comparing_saved_options_with_funny_characters():
>>> buildout = os.path.join(sample_buildout, 'bin', 'buildout') >>> buildout = os.path.join(sample_buildout, 'bin', 'buildout')
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Installing debug Installing debug.
If we run the buildout again, we shoudn't get a message about If we run the buildout again, we shoudn't get a message about
uninstalling anything because the configuration hasn't changed. uninstalling anything because the configuration hasn't changed.
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Updating debug Updating debug.
""" """
def finding_eggs_as_local_directories(): def finding_eggs_as_local_directories():
...@@ -507,7 +521,7 @@ We'll start by creating a faux 'python' that executable that prints a ...@@ -507,7 +521,7 @@ We'll start by creating a faux 'python' that executable that prints a
... ''') ... ''')
>>> print system(join('bin', 'buildout')), >>> print system(join('bin', 'buildout')),
buildout: Develop: /sample-buildout/demo Develop: '/sample-buildout/demo'
>>> import zc.buildout.easy_install >>> import zc.buildout.easy_install
>>> ws = zc.buildout.easy_install.working_set( >>> ws = zc.buildout.easy_install.working_set(
...@@ -535,8 +549,8 @@ def create_sections_on_command_line(): ...@@ -535,8 +549,8 @@ def create_sections_on_command_line():
... x = ${foo:bar} ... x = ${foo:bar}
... ''') ... ''')
>>> print system(buildout + ' foo:bar=1 -vD'), # doctest: +ELLIPSIS >>> print system(buildout + ' foo:bar=1 -vv'), # doctest: +ELLIPSIS
zc.buildout.easy_install: Installing ['zc.buildout', 'setuptools'] Installing 'zc.buildout', 'setuptools'.
... ...
[foo] [foo]
bar = 1 bar = 1
...@@ -551,11 +565,11 @@ def create_sections_on_command_line(): ...@@ -551,11 +565,11 @@ def create_sections_on_command_line():
## listed in the configuration. ## listed in the configuration.
## >>> print system(join('bin', 'buildout') + ' install foo'), ## >>> print system(join('bin', 'buildout') + ' install foo'),
## buildout: Invalid install parts: foo. ## Invalid install parts: foo.
## Install parts must be listed in the configuration. ## Install parts must be listed in the configuration.
## >>> print system(join('bin', 'buildout') + ' install foo bar'), ## >>> print system(join('bin', 'buildout') + ' install foo bar'),
## buildout: Invalid install parts: foo bar. ## Invalid install parts: foo bar.
## Install parts must be listed in the configuration. ## Install parts must be listed in the configuration.
## """ ## """
...@@ -580,11 +594,7 @@ if os.path.exists(bootstrap_py): ...@@ -580,11 +594,7 @@ if os.path.exists(bootstrap_py):
>>> print system(sys.executable+' '+'bootstrap.py'), # doctest: +ELLIPSIS >>> print system(sys.executable+' '+'bootstrap.py'), # doctest: +ELLIPSIS
Downloading ... Downloading ...
Warning: creating ...buildout.cfg Warning: creating ...buildout.cfg
buildout: Creating directory ...bin ...Generated script /sample/bin/buildout.
buildout: Creating directory ...parts
buildout: Creating directory ...eggs
buildout: Creating directory ...develop-eggs
zc.buildout.easy_install: Generated script /sample/bin/buildout.
>>> ls(sample_buildout) >>> ls(sample_buildout)
d bin d bin
...@@ -644,11 +654,11 @@ bootstrapping. ...@@ -644,11 +654,11 @@ bootstrapping.
>>> os.chdir(d) >>> os.chdir(d)
>>> print system(os.path.join(sample_buildout, 'bin', 'buildout') >>> print system(os.path.join(sample_buildout, 'bin', 'buildout')
... + ' bootstrap'), ... + ' bootstrap'),
buildout: Creating directory /sample-bootstrap/bin Creating directory '/sample-bootstrap/bin'.
buildout: Creating directory /sample-bootstrap/parts Creating directory '/sample-bootstrap/parts'.
buildout: Creating directory /sample-bootstrap/eggs Creating directory '/sample-bootstrap/eggs'.
buildout: Creating directory /sample-bootstrap/develop-eggs Creating directory '/sample-bootstrap/develop-eggs'.
zc.buildout.easy_install: Generated script /sample-bootstrap/bin/buildout. Generated script '/sample-bootstrap/bin/buildout'.
""" """
...@@ -671,14 +681,14 @@ def bug_92891_bootstrap_crashes_with_egg_recipe_in_buildout_section(): ...@@ -671,14 +681,14 @@ def bug_92891_bootstrap_crashes_with_egg_recipe_in_buildout_section():
>>> os.chdir(d) >>> os.chdir(d)
>>> print system(os.path.join(sample_buildout, 'bin', 'buildout') >>> print system(os.path.join(sample_buildout, 'bin', 'buildout')
... + ' bootstrap'), ... + ' bootstrap'),
buildout: Creating directory /sample-bootstrap/bin Creating directory '/sample-bootstrap/bin'.
buildout: Creating directory /sample-bootstrap/parts Creating directory '/sample-bootstrap/parts'.
buildout: Creating directory /sample-bootstrap/eggs Creating directory '/sample-bootstrap/eggs'.
buildout: Creating directory /sample-bootstrap/develop-eggs Creating directory '/sample-bootstrap/develop-eggs'.
zc.buildout.easy_install: Generated script /sample-bootstrap/bin/buildout. Generated script '/sample-bootstrap/bin/buildout'.
>>> print system(os.path.join('bin', 'buildout')), >>> print system(os.path.join('bin', 'buildout')),
buildout: Unused options for buildout: 'scripts' 'eggs' Unused options for buildout: 'scripts' 'eggs'.
""" """
...@@ -702,7 +712,7 @@ Create a develop egg: ...@@ -702,7 +712,7 @@ Create a develop egg:
... """) ... """)
>>> print system(join('bin', 'buildout')), >>> print system(join('bin', 'buildout')),
buildout: Develop: /sample-buildout/foo Develop: '/sample-buildout/foo'
>>> ls('develop-eggs') >>> ls('develop-eggs')
- foox.egg-link - foox.egg-link
...@@ -724,8 +734,8 @@ Create another: ...@@ -724,8 +734,8 @@ Create another:
... """) ... """)
>>> print system(join('bin', 'buildout')), >>> print system(join('bin', 'buildout')),
buildout: Develop: /sample-buildout/foo Develop: '/sample-buildout/foo'
buildout: Develop: /sample-buildout/bar Develop: '/sample-buildout/bar'
>>> ls('develop-eggs') >>> ls('develop-eggs')
- foox.egg-link - foox.egg-link
...@@ -741,7 +751,7 @@ Remove one: ...@@ -741,7 +751,7 @@ Remove one:
... parts = ... parts =
... """) ... """)
>>> print system(join('bin', 'buildout')), >>> print system(join('bin', 'buildout')),
buildout: Develop: /sample-buildout/bar Develop: '/sample-buildout/bar'
It is gone It is gone
...@@ -802,15 +812,15 @@ a devlop egg, we will also generate a warning. ...@@ -802,15 +812,15 @@ a devlop egg, we will also generate a warning.
... """) ... """)
>>> print system(join('bin', 'buildout')), >>> print system(join('bin', 'buildout')),
buildout: Develop: /sample-buildout/foo Develop: '/sample-buildout/foo'
Now, if we generate a working set using the egg link, we will get a warning Now, if we generate a working set using the egg link, we will get a warning
and we will get setuptools included in the working set. and we will get setuptools included in the working set.
>>> import logging, zope.testing.loggingsupport >>> import logging, zope.testing.loggingsupport
>>> handler = zope.testing.loggingsupport.InstalledHandler( >>> handler = zope.testing.loggingsupport.InstalledHandler(
... 'zc.buildout', level=logging.WARNING) ... 'zc.buildout.easy_install', level=logging.WARNING)
>>> logging.getLogger('zc').propagate = False >>> logging.getLogger('zc.buildout.easy_install').propagate = False
>>> [dist.project_name >>> [dist.project_name
... for dist in zc.buildout.easy_install.working_set( ... for dist in zc.buildout.easy_install.working_set(
...@@ -822,7 +832,7 @@ and we will get setuptools included in the working set. ...@@ -822,7 +832,7 @@ and we will get setuptools included in the working set.
>>> print handler >>> print handler
zc.buildout.easy_install WARNING zc.buildout.easy_install WARNING
Develop distribution for foox 0.0.0 Develop distribution: foox 0.0.0
uses namespace packages but the distribution does not require setuptools. uses namespace packages but the distribution does not require setuptools.
>>> handler.clear() >>> handler.clear()
...@@ -873,8 +883,8 @@ namespace package. ...@@ -873,8 +883,8 @@ namespace package.
... """) ... """)
>>> print system(join('bin', 'buildout')), >>> print system(join('bin', 'buildout')),
buildout: Develop: /sample-buildout/foo Develop: '/sample-buildout/foo'
buildout: Develop: /sample-buildout/bar Develop: '/sample-buildout/bar'
>>> [dist.project_name >>> [dist.project_name
... for dist in zc.buildout.easy_install.working_set( ... for dist in zc.buildout.easy_install.working_set(
...@@ -886,11 +896,11 @@ namespace package. ...@@ -886,11 +896,11 @@ namespace package.
>>> print handler, >>> print handler,
zc.buildout.easy_install WARNING zc.buildout.easy_install WARNING
Develop distribution for foox 0.0.0 Develop distribution: foox 0.0.0
uses namespace packages but the distribution does not require setuptools. uses namespace packages but the distribution does not require setuptools.
>>> logging.getLogger('zc').propagate = True >>> logging.getLogger('zc.buildout.easy_install').propagate = True
>>> handler.uninstall() >>> handler.uninstall()
''' '''
...@@ -974,8 +984,8 @@ Uninstall recipes need to be called when a part is removed too: ...@@ -974,8 +984,8 @@ Uninstall recipes need to be called when a part is removed too:
... ''') ... ''')
>>> print system(join('bin', 'buildout')), >>> print system(join('bin', 'buildout')),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Installing demo Installing demo.
installing installing
...@@ -989,11 +999,11 @@ Uninstall recipes need to be called when a part is removed too: ...@@ -989,11 +999,11 @@ Uninstall recipes need to be called when a part is removed too:
... ''') ... ''')
>>> print system(join('bin', 'buildout')), >>> print system(join('bin', 'buildout')),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling demo Uninstalling demo.
buildout: Running uninstall recipe Running uninstall recipe.
uninstalling uninstalling
buildout: Installing demo Installing demo.
installing installing
...@@ -1004,9 +1014,9 @@ Uninstall recipes need to be called when a part is removed too: ...@@ -1004,9 +1014,9 @@ Uninstall recipes need to be called when a part is removed too:
... ''') ... ''')
>>> print system(join('bin', 'buildout')), >>> print system(join('bin', 'buildout')),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling demo Uninstalling demo.
buildout: Running uninstall recipe Running uninstall recipe.
uninstalling uninstalling
""" """
...@@ -1082,21 +1092,21 @@ changes in .svn or CVS directories. ...@@ -1082,21 +1092,21 @@ changes in .svn or CVS directories.
>>> print system(join(sample_buildout, 'bin', 'buildout')), >>> print system(join(sample_buildout, 'bin', 'buildout')),
buildout: Develop: /sample-buildout/recipe Develop: '/sample-buildout/recipe'
buildout: Installing foo Installing foo.
>>> mkdir('recipe', '.svn') >>> mkdir('recipe', '.svn')
>>> mkdir('recipe', 'CVS') >>> mkdir('recipe', 'CVS')
>>> print system(join(sample_buildout, 'bin', 'buildout')), >>> print system(join(sample_buildout, 'bin', 'buildout')),
buildout: Develop: /sample-buildout/recipe Develop: '/sample-buildout/recipe'
buildout: Updating foo Updating foo.
>>> write('recipe', '.svn', 'x', '1') >>> write('recipe', '.svn', 'x', '1')
>>> write('recipe', 'CVS', 'x', '1') >>> write('recipe', 'CVS', 'x', '1')
>>> print system(join(sample_buildout, 'bin', 'buildout')), >>> print system(join(sample_buildout, 'bin', 'buildout')),
buildout: Develop: /sample-buildout/recipe Develop: '/sample-buildout/recipe'
buildout: Updating foo Updating foo.
""" """
...@@ -1139,7 +1149,7 @@ Let's create a recipe egg ...@@ -1139,7 +1149,7 @@ Let's create a recipe egg
>>> write('recipe', 'README', '') >>> write('recipe', 'README', '')
>>> print system(buildout+' setup recipe bdist_egg'), # doctest: +ELLIPSIS >>> print system(buildout+' setup recipe bdist_egg'), # doctest: +ELLIPSIS
buildout: Running setup script recipe/setup.py Running setup script 'recipe/setup.py'.
... ...
>>> rmdir('recipe', 'build') >>> rmdir('recipe', 'build')
...@@ -1157,9 +1167,9 @@ And update our buildout to use it. ...@@ -1157,9 +1167,9 @@ And update our buildout to use it.
... ''' % join('recipe', 'dist')) ... ''' % join('recipe', 'dist'))
>>> print system(buildout), >>> print system(buildout),
zc.buildout.easy_install: Getting new distribution for recipe Getting distribution for 'recipe'.
zc.buildout.easy_install: Got recipe 1 Got recipe 1.
buildout: Installing foo Installing foo.
recipe v1 recipe v1
Now, if we update the recipe egg: Now, if we update the recipe egg:
...@@ -1184,28 +1194,28 @@ Now, if we update the recipe egg: ...@@ -1184,28 +1194,28 @@ Now, if we update the recipe egg:
>>> print system(buildout+' setup recipe bdist_egg'), # doctest: +ELLIPSIS >>> print system(buildout+' setup recipe bdist_egg'), # doctest: +ELLIPSIS
buildout: Running setup script recipe/setup.py Running setup script 'recipe/setup.py'.
... ...
We won't get the update if we specify -N: We won't get the update if we specify -N:
>>> print system(buildout+' -N'), >>> print system(buildout+' -N'),
buildout: Updating foo Updating foo.
recipe v1 recipe v1
or if we use -o: or if we use -o:
>>> print system(buildout+' -o'), >>> print system(buildout+' -o'),
buildout: Updating foo Updating foo.
recipe v1 recipe v1
But we will if we use neither of these: But we will if we use neither of these:
>>> print system(buildout), >>> print system(buildout),
zc.buildout.easy_install: Getting new distribution for recipe Getting distribution for 'recipe'.
zc.buildout.easy_install: Got recipe 2 Got recipe 2.
buildout: Uninstalling foo Uninstalling foo.
buildout: Installing foo Installing foo.
recipe v2 recipe v2
We can also select a particular recipe version: We can also select a particular recipe version:
...@@ -1221,8 +1231,8 @@ We can also select a particular recipe version: ...@@ -1221,8 +1231,8 @@ We can also select a particular recipe version:
... ''' % join('recipe', 'dist')) ... ''' % join('recipe', 'dist'))
>>> print system(buildout), >>> print system(buildout),
buildout: Uninstalling foo Uninstalling foo.
buildout: Installing foo Installing foo.
recipe v1 recipe v1
""" """
...@@ -1270,12 +1280,12 @@ uninstall ...@@ -1270,12 +1280,12 @@ uninstall
... ''') ... ''')
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /tmp/tmpbHOHnU/_TEST_/sample-buildout/recipe Develop: '/tmp/tmpbHOHnU/_TEST_/sample-buildout/recipe'
buildout: Installing foo Installing foo.
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /tmp/tmpbHOHnU/_TEST_/sample-buildout/recipe Develop: '/tmp/tmpbHOHnU/_TEST_/sample-buildout/recipe'
buildout: Updating foo Updating foo.
>>> cat('.installed.cfg') # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE >>> cat('.installed.cfg') # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
[buildout] [buildout]
...@@ -1307,9 +1317,9 @@ def log_when_there_are_not_local_distros(): ...@@ -1307,9 +1317,9 @@ def log_when_there_are_not_local_distros():
>>> print handler # doctest: +ELLIPSIS >>> print handler # doctest: +ELLIPSIS
zc.buildout.easy_install DEBUG zc.buildout.easy_install DEBUG
Installing ['demo==0.2'] Installing 'demo==0.2'.
zc.buildout.easy_install DEBUG zc.buildout.easy_install DEBUG
We have no distributions for demo that satisfies demo==0.2. We have no distributions for demo that satisfies 'demo==0.2'.
... ...
>>> handler.uninstall() >>> handler.uninstall()
...@@ -1352,11 +1362,11 @@ def internal_errors(): ...@@ -1352,11 +1362,11 @@ def internal_errors():
... ''') ... ''')
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
While: While:
Installing Installing.
Getting section data-dir Getting section data-dir.
Initializing part data-dir Initializing part data-dir.
<BLANKLINE> <BLANKLINE>
An internal error occured due to a bug in either zc.buildout or in a An internal error occured due to a bug in either zc.buildout or in a
recipe being used: recipe being used:
...@@ -1376,9 +1386,9 @@ def download_errors(): ...@@ -1376,9 +1386,9 @@ def download_errors():
>>> print system(buildout), # doctest: +ELLIPSIS >>> print system(buildout), # doctest: +ELLIPSIS
While: While:
Installing Installing.
Checking for upgrades Checking for upgrades.
Getting distribution for setuptools Getting distribution for 'setuptools'.
Error: Download error... Error: Download error...
""" """
...@@ -1421,10 +1431,10 @@ def whine_about_unused_options(): ...@@ -1421,10 +1431,10 @@ def whine_about_unused_options():
... """) ... """)
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /tmp/tmpsueWpG/_TEST_/sample-buildout/. Develop: '/tmp/tmpsueWpG/_TEST_/sample-buildout/.'
buildout: Unused options for buildout: 'a' Unused options for buildout: 'a'.
buildout: Installing foo Installing foo.
buildout: Unused options for foo: 'z' Unused options for foo: 'z'.
''' '''
def abnormal_exit(): def abnormal_exit():
...@@ -1489,21 +1499,21 @@ Now let's look at 3 cases: ...@@ -1489,21 +1499,21 @@ Now let's look at 3 cases:
... ''') ... ''')
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Installing p1 Installing p1.
buildout: Installing p2 Installing p2.
buildout: Installing p3 Installing p3.
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Updating p1 Updating p1.
buildout: Updating p2 Updating p2.
buildout: Installing p3 Installing p3.
>>> print system(buildout+' buildout:parts='), >>> print system(buildout+' buildout:parts='),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling p2 Uninstalling p2.
buildout: Uninstalling p1 Uninstalling p1.
2. We exit while updating: 2. We exit while updating:
...@@ -1527,24 +1537,24 @@ Now let's look at 3 cases: ...@@ -1527,24 +1537,24 @@ Now let's look at 3 cases:
... ''') ... ''')
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Installing p1 Installing p1.
buildout: Installing p2 Installing p2.
buildout: Installing p3 Installing p3.
buildout: Installing p4 Installing p4.
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Updating p1 Updating p1.
buildout: Updating p2 Updating p2.
buildout: Updating p3 Updating p3.
>>> print system(buildout+' buildout:parts='), >>> print system(buildout+' buildout:parts='),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling p2 Uninstalling p2.
buildout: Uninstalling p1 Uninstalling p1.
buildout: Uninstalling p4 Uninstalling p4.
buildout: Uninstalling p3 Uninstalling p3.
3. We exit while installing or updating after uninstalling: 3. We exit while installing or updating after uninstalling:
...@@ -1568,11 +1578,11 @@ Now let's look at 3 cases: ...@@ -1568,11 +1578,11 @@ Now let's look at 3 cases:
... ''') ... ''')
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Installing p1 Installing p1.
buildout: Installing p2 Installing p2.
buildout: Installing p3 Installing p3.
buildout: Installing p4 Installing p4.
>>> write('buildout.cfg', >>> write('buildout.cfg',
... ''' ... '''
...@@ -1595,9 +1605,9 @@ Now let's look at 3 cases: ...@@ -1595,9 +1605,9 @@ Now let's look at 3 cases:
... ''') ... ''')
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling p4 Uninstalling p4.
buildout: Updating p1 Updating p1.
>>> write('buildout.cfg', >>> write('buildout.cfg',
... ''' ... '''
...@@ -1619,12 +1629,12 @@ Now let's look at 3 cases: ...@@ -1619,12 +1629,12 @@ Now let's look at 3 cases:
... ''') ... ''')
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/recipes Develop: '/sample-buildout/recipes'
buildout: Uninstalling p1 Uninstalling p1.
buildout: Installing p1 Installing p1.
buildout: Updating p2 Updating p2.
buildout: Updating p3 Updating p3.
buildout: Installing p4 Installing p4.
""" """
...@@ -1652,7 +1662,7 @@ def install_source_dist_with_bad_py(): ...@@ -1652,7 +1662,7 @@ def install_source_dist_with_bad_py():
... ''') ... ''')
>>> print system(buildout+' setup badegg sdist'), # doctest: +ELLIPSIS >>> print system(buildout+' setup badegg sdist'), # doctest: +ELLIPSIS
buildout: Running setup script badegg/setup.py Running setup script 'badegg/setup.py'.
... ...
>>> dist = join('badegg', 'dist') >>> dist = join('badegg', 'dist')
...@@ -1673,18 +1683,18 @@ def install_source_dist_with_bad_py(): ...@@ -1673,18 +1683,18 @@ def install_source_dist_with_bad_py():
... scripts = buildout=bo ... scripts = buildout=bo
... ''' % globals()) ... ''' % globals())
>>> print system('buildout'), >>> print system(buildout),
buildout: Not upgrading because not running a local buildout command Installing eggs.
buildout: Installing eggs Getting distribution for 'badegg'.
zc.buildout.easy_install: Getting new distribution for badegg
File "build/bdist.linux-i686/egg/badegg/scripts/one.py", line 2 File "build/bdist.linux-i686/egg/badegg/scripts/one.py", line 2
return 1 return 1
SyntaxError: 'return' outside function SyntaxError: 'return' outside function
File "/sample-buildout/eggs/badegg-1-py2.4.egg/badegg/scripts/one.py", line 2 File "/sample-buildout/eggs/badegg-1-py2.4.egg/badegg/scripts/one.py", line 2
return 1 return 1
SyntaxError: 'return' outside function SyntaxError: 'return' outside function
zc.buildout.easy_install: Got badegg 1 Got badegg 1.
buildout: Installing bo Installing bo.
Generated script '/sample-buildout/bin/bo'.
>>> ls('eggs') # doctest: +ELLIPSIS >>> ls('eggs') # doctest: +ELLIPSIS
d badegg-1-py2.4.egg d badegg-1-py2.4.egg
...@@ -1738,12 +1748,12 @@ def bug_105081_Specific_egg_versions_are_ignored_when_newer_eggs_are_around(): ...@@ -1738,12 +1748,12 @@ def bug_105081_Specific_egg_versions_are_ignored_when_newer_eggs_are_around():
... ''' % globals()) ... ''' % globals())
>>> print system(buildout), >>> print system(buildout),
buildout: Installing x Installing x.
zc.buildout.easy_install: Getting new distribution for demo Getting distribution for 'demo'.
zc.buildout.easy_install: Got demo 0.3 Got demo 0.3.
zc.buildout.easy_install: Getting new distribution for demoneeded Getting distribution for 'demoneeded'.
zc.buildout.easy_install: Got demoneeded 1.1 Got demoneeded 1.1.
zc.buildout.easy_install: Generated script /sample-buildout/bin/demo. Generated script '/sample-buildout/bin/demo'.
>>> print system(join('bin', 'demo')), >>> print system(join('bin', 'demo')),
3 1 3 1
...@@ -1760,11 +1770,11 @@ def bug_105081_Specific_egg_versions_are_ignored_when_newer_eggs_are_around(): ...@@ -1760,11 +1770,11 @@ def bug_105081_Specific_egg_versions_are_ignored_when_newer_eggs_are_around():
... ''' % globals()) ... ''' % globals())
>>> print system(buildout), >>> print system(buildout),
buildout: Uninstalling x Uninstalling x.
buildout: Installing x Installing x.
zc.buildout.easy_install: Getting new distribution for demo==0.1 Getting distribution for 'demo==0.1'.
zc.buildout.easy_install: Got demo 0.1 Got demo 0.1.
zc.buildout.easy_install: Generated script /sample-buildout/bin/demo. Generated script '/sample-buildout/bin/demo'.
>>> print system(join('bin', 'demo')), >>> print system(join('bin', 'demo')),
1 1 1 1
...@@ -1793,8 +1803,8 @@ if sys.version_info > (2, 4): ...@@ -1793,8 +1803,8 @@ if sys.version_info > (2, 4):
>>> call(buildout) >>> call(buildout)
While: While:
Installing Installing.
Getting section x Getting section x.
Error: The referenced section, 'x', was not defined. Error: The referenced section, 'x', was not defined.
<BLANKLINE> <BLANKLINE>
Exit: True Exit: True
...@@ -1822,12 +1832,12 @@ if sys.version_info > (2, 4): ...@@ -1822,12 +1832,12 @@ if sys.version_info > (2, 4):
... ''') ... ''')
>>> call(buildout) >>> call(buildout)
buildout: Develop: /sample-buildout/. Develop: '/sample-buildout/.'
While: While:
Installing Installing.
Getting section x Getting section x.
Initializing section x Initializing section x.
Loading zc.buildout recipe entry zc.buildout.testexit:default Loading zc.buildout recipe entry zc.buildout.testexit:default.
<BLANKLINE> <BLANKLINE>
An internal error occured due to a bug in either zc.buildout or in a An internal error occured due to a bug in either zc.buildout or in a
recipe being used: recipe being used:
...@@ -1878,13 +1888,13 @@ def bug_59270_recipes_always_start_in_buildout_dir(): ...@@ -1878,13 +1888,13 @@ def bug_59270_recipes_always_start_in_buildout_dir():
>>> os.chdir('bad_start') >>> os.chdir('bad_start')
>>> print system(join(sample_buildout, 'bin', 'buildout') >>> print system(join(sample_buildout, 'bin', 'buildout')
... +' -c '+join(sample_buildout, 'buildout.cfg')), ... +' -c '+join(sample_buildout, 'buildout.cfg')),
buildout: Develop: /tmp/tmpV9ptXUbuildoutSetUp/_TEST_/sample-buildout/. Develop: '/tmp/tmpV9ptXUbuildoutSetUp/_TEST_/sample-buildout/.'
/sample-buildout /sample-buildout
/sample-buildout /sample-buildout
buildout: Installing b1 Installing b1.
/sample-buildout /sample-buildout
/sample-buildout/bad_start /sample-buildout/bad_start
buildout: Installing b2 Installing b2.
/sample-buildout /sample-buildout
/sample-buildout/bad_start /sample-buildout/bad_start
...@@ -1920,13 +1930,106 @@ def bug_75607_buildout_should_not_run_if_it_creates_an_empty_buildout_cfg(): ...@@ -1920,13 +1930,106 @@ def bug_75607_buildout_should_not_run_if_it_creates_an_empty_buildout_cfg():
>>> remove('buildout.cfg') >>> remove('buildout.cfg')
>>> print system(buildout), >>> print system(buildout),
While: While:
Initializing Initializing.
Error: Couldn't open /sample-buildout/buildout.cfg Error: Couldn't open /sample-buildout/buildout.cfg
""" """
def dealing_with_extremely_insane_dependencies():
r"""
There was a problem with analysis of dependencies taking a long
time, in part because the analysis would get repeated every time a
package was encountered in a dependency list. Now, we don't do
the analysis any more:
>>> import os
>>> for i in range(5):
... p = 'pack%s' % i
... deps = [('pack%s' % j) for j in range(5) if j is not i]
... if i == 4:
... deps.append('pack5')
... mkdir(p)
... write(p, 'setup.py',
... 'from setuptools import setup\n'
... 'setup(name=%r, install_requires=%r,\n'
... ' url="u", author="a", author_email="e")\n'
... % (p, deps))
>>> write('buildout.cfg',
... '''
... [buildout]
... develop = pack0 pack1 pack2 pack3 pack4
... parts = pack1
...
... [pack1]
... recipe = zc.recipe.egg:eggs
... eggs = pack0
... ''')
>>> print system(buildout),
Develop: '/sample-buildout/pack0'
Develop: '/sample-buildout/pack1'
Develop: '/sample-buildout/pack2'
Develop: '/sample-buildout/pack3'
Develop: '/sample-buildout/pack4'
Installing pack1.
Couldn't find index page for 'pack5' (maybe misspelled?)
Getting distribution for 'pack5'.
While:
Installing pack1.
Getting distribution for 'pack5'.
Error: Couldn't find a distribution for 'pack5'.
However, if we run in verbose mode, we can see why packages were included:
>>> print system(buildout+' -v'),
Installing 'zc.buildout', 'setuptools'.
We have a develop egg: zc.buildout 1.0.0
We have the best distribution that satisfies 'setuptools'.
Picked: setuptools = 0.6
Develop: '/sample-buildout/pack0'
Develop: '/sample-buildout/pack1'
Develop: '/sample-buildout/pack2'
Develop: '/sample-buildout/pack3'
Develop: '/sample-buildout/pack4'
Installing 'zc.recipe.egg'.
We have a develop egg: zc.recipe.egg 1.0.0
Installing pack1.
Installing 'pack0'.
We have a develop egg: pack0 0.0.0
Getting required 'pack4'
required by pack0 0.0.0.
We have a develop egg: pack4 0.0.0
Getting required 'pack3'
required by pack0 0.0.0.
required by pack4 0.0.0.
We have a develop egg: pack3 0.0.0
Getting required 'pack2'
required by pack0 0.0.0.
required by pack3 0.0.0.
required by pack4 0.0.0.
We have a develop egg: pack2 0.0.0
Getting required 'pack1'
required by pack0 0.0.0.
required by pack2 0.0.0.
required by pack3 0.0.0.
required by pack4 0.0.0.
We have a develop egg: pack1 0.0.0
Getting required 'pack5'
required by pack4 0.0.0.
We have no distributions for pack5 that satisfies 'pack5'.
Couldn't find index page for 'pack5' (maybe misspelled?)
Getting distribution for 'pack5'.
While:
Installing pack1.
Getting distribution for 'pack5'.
Error: Couldn't find a distribution for 'pack5'.
"""
###################################################################### ######################################################################
def create_sample_eggs(test, executable=sys.executable): def create_sample_eggs(test, executable=sys.executable):
...@@ -2130,8 +2233,11 @@ def test_suite(): ...@@ -2130,8 +2233,11 @@ def test_suite():
'zc.buildout.egg'), 'zc.buildout.egg'),
(re.compile('creating \S*setup.cfg'), 'creating setup.cfg'), (re.compile('creating \S*setup.cfg'), 'creating setup.cfg'),
(re.compile('hello\%ssetup' % os.path.sep), 'hello/setup'), (re.compile('hello\%ssetup' % os.path.sep), 'hello/setup'),
(re.compile('zc.buildout.easy_install.picked: (\S+) = \S+'), (re.compile('Picked: (\S+) = \S+'),
'picked \\1 = V.V'), 'Picked: \\1 = V.V'),
(re.compile(r'We have a develop egg: zc.buildout (\S+)'),
'We have a develop egg: zc.buildout X.X.'),
]) ])
), ),
doctest.DocFileSuite( doctest.DocFileSuite(
...@@ -2193,6 +2299,11 @@ def test_suite(): ...@@ -2193,6 +2299,11 @@ def test_suite():
'zc.buildout.egg'), 'zc.buildout.egg'),
(re.compile('File "\S+one.py"'), (re.compile('File "\S+one.py"'),
'File "one.py"'), 'File "one.py"'),
(re.compile(r'We have a develop egg: (\S+) (\S+)'),
r'We have a develop egg: \1 V'),
(re.compile('Picked: setuptools = \S+'),
'Picked: setuptools = V'),
]), ]),
), ),
)) ))
......
...@@ -64,17 +64,17 @@ Now if we run the buildout, the buildout will upgrade itself to the ...@@ -64,17 +64,17 @@ Now if we run the buildout, the buildout will upgrade itself to the
new versions found in new releases: new versions found in new releases:
>>> print system(buildout), >>> print system(buildout),
zc.buildout.easy_install: Getting new distribution for zc.buildout Getting distribution for 'zc.buildout'.
zc.buildout.easy_install: Got zc.buildout 99.99 Got zc.buildout 99.99.
zc.buildout.easy_install: Getting new distribution for setuptools Getting distribution for 'setuptools'.
zc.buildout.easy_install: Got setuptools 99.99 Got setuptools 99.99.
buildout: Upgraded: Upgraded:
zc.buildout version 99.99, zc.buildout version 99.99,
setuptools version 99.99; setuptools version 99.99;
restarting. restarting.
zc.buildout.easy_install: Generated script /sample-buildout/bin/buildout. Generated script '/sample-buildout/bin/buildout'.
buildout: Develop: /sample-buildout/showversions Develop: '/sample-buildout/showversions'
buildout: Installing show-versions Installing show-versions.
zc.buildout 99.99 zc.buildout 99.99
setuptools 99.99 setuptools 99.99
...@@ -117,13 +117,13 @@ version: ...@@ -117,13 +117,13 @@ version:
We'll actually "upgrade" to an earlier version. We'll actually "upgrade" to an earlier version.
>>> print system(buildout), >>> print system(buildout),
buildout: Upgraded: Upgraded:
zc.buildout version 1.0.0, zc.buildout version 1.0.0,
setuptools version 0.6; setuptools version 0.6;
restarting. restarting.
zc.buildout.easy_install: Generated script /sample-buildout/bin/buildout. Generated script '/sample-buildout/bin/buildout'.
buildout: Develop: /sample-buildout/showversions Develop: '/sample-buildout/showversions'
buildout: Updating show-versions Updating show-versions.
zc.buildout 1.0.0 zc.buildout 1.0.0
setuptools 0.6 setuptools 0.6
...@@ -142,16 +142,16 @@ We won't upgrade in offline mode: ...@@ -142,16 +142,16 @@ We won't upgrade in offline mode:
... """ % dict(new_releases=new_releases)) ... """ % dict(new_releases=new_releases))
>>> print system(buildout+' -o'), >>> print system(buildout+' -o'),
buildout: Develop: /sample-buildout/showversions Develop: '/sample-buildout/showversions'
buildout: Updating show-versions Updating show-versions.
zc.buildout 1.0.0 zc.buildout 1.0.0
setuptools 0.6 setuptools 0.6
Or in non-newest mode: Or in non-newest mode:
>>> print system(buildout+' -N'), >>> print system(buildout+' -N'),
buildout: Develop: /sample-buildout/showversions Develop: '/sample-buildout/showversions'
buildout: Updating show-versions Updating show-versions.
zc.buildout 1.0.0 zc.buildout 1.0.0
setuptools 0.6 setuptools 0.6
...@@ -170,14 +170,14 @@ directory: ...@@ -170,14 +170,14 @@ directory:
>>> cd(sample_buildout2) >>> cd(sample_buildout2)
>>> print system(buildout), >>> print system(buildout),
buildout: Creating directory /sample_buildout2/bin Creating directory '/sample_buildout2/bin'.
buildout: Creating directory /sample_buildout2/parts Creating directory '/sample_buildout2/parts'.
buildout: Creating directory /sample_buildout2/eggs Creating directory '/sample_buildout2/eggs'.
buildout: Creating directory /sample_buildout2/develop-eggs Creating directory '/sample_buildout2/develop-eggs'.
zc.buildout.easy_install: Getting new distribution for zc.buildout Getting distribution for 'zc.buildout'.
zc.buildout.easy_install: Got zc.buildout 99.99 Got zc.buildout 99.99.
zc.buildout.easy_install: Getting new distribution for setuptools Getting distribution for 'setuptools'.
zc.buildout.easy_install: Got setuptools 99.99 Got setuptools 99.99.
buildout: Not upgrading because not running a local buildout command Not upgrading because not running a local buildout command.
>>> ls('bin') >>> ls('bin')
...@@ -65,11 +65,11 @@ Let's run the buildout: ...@@ -65,11 +65,11 @@ Let's run the buildout:
>>> import os >>> import os
>>> print system(buildout), >>> print system(buildout),
buildout: Installing demo Installing demo.
zc.buildout.easy_install: Getting new distribution for demo<0.3 Getting distribution for 'demo<0.3'.
zc.buildout.easy_install: Got demo 0.2 Got demo 0.2.
zc.buildout.easy_install: Getting new distribution for demoneeded Getting distribution for 'demoneeded'.
zc.buildout.easy_install: Got demoneeded 1.1 Got demoneeded 1.1.
Now, if we look at the buildout eggs directory: Now, if we look at the buildout eggs directory:
...@@ -109,9 +109,9 @@ scripts recipe: ...@@ -109,9 +109,9 @@ scripts recipe:
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print system(buildout),
buildout: Uninstalling demo Uninstalling demo.
buildout: Installing demo Installing demo.
zc.buildout.easy_install: Generated script /sample-buildout/bin/demo. Generated script '/sample-buildout/bin/demo'.
Now we also see the script defined by the dmo script: Now we also see the script defined by the dmo script:
...@@ -171,10 +171,10 @@ specification. We were able to do this because the scripts recipe if ...@@ -171,10 +171,10 @@ specification. We were able to do this because the scripts recipe if
the default entry point for the zc.recipe.egg egg. the default entry point for the zc.recipe.egg egg.
>>> print system(buildout), >>> print system(buildout),
buildout: Uninstalling demo Uninstalling demo.
buildout: Installing demo Installing demo.
zc.buildout.easy_install: Generated script /sample-buildout/bin/demo. Generated script '/sample-buildout/bin/demo'.
zc.buildout.easy_install: Generated interpreter /sample-buildout/bin/py-demo. Generated interpreter '/sample-buildout/bin/py-demo'.
Now we also get a py-demo script for giving us a Python prompt with Now we also get a py-demo script for giving us a Python prompt with
the path for demo and any eggs it depends on included in sys.path. the path for demo and any eggs it depends on included in sys.path.
...@@ -229,9 +229,9 @@ remove the restriction on demo: ...@@ -229,9 +229,9 @@ remove the restriction on demo:
and run the buildout in non-newest mode: and run the buildout in non-newest mode:
>>> print system(buildout+' -N'), >>> print system(buildout+' -N'),
buildout: Uninstalling demo Uninstalling demo.
buildout: Installing demo Installing demo.
zc.buildout.easy_install: Generated script /sample-buildout/bin/demo. Generated script '/sample-buildout/bin/demo'.
Note that we removed the eggs option, and the eggs defaulted to the Note that we removed the eggs option, and the eggs defaulted to the
part name. Because we removed the eggs option, the demo was part name. Because we removed the eggs option, the demo was
...@@ -240,8 +240,7 @@ reinstalled. ...@@ -240,8 +240,7 @@ reinstalled.
We'll also run the buildout in off-line mode: We'll also run the buildout in off-line mode:
>>> print system(buildout+' -o'), >>> print system(buildout+' -o'),
buildout: Updating demo Updating demo.
zc.buildout.easy_install: Generated script /sample-buildout/bin/demo.
We didn't get an update for demo: We didn't get an update for demo:
...@@ -255,10 +254,10 @@ If we run the buildout on the default online and newest modes, ...@@ -255,10 +254,10 @@ If we run the buildout on the default online and newest modes,
we'll get an update for demo: we'll get an update for demo:
>>> print system(buildout), >>> print system(buildout),
buildout: Updating demo Updating demo.
zc.buildout.easy_install: Getting new distribution for demo Getting distribution for 'demo'.
zc.buildout.easy_install: Got demo 0.3 Got demo 0.3.
zc.buildout.easy_install: Generated script /sample-buildout/bin/demo. Generated script '/sample-buildout/bin/demo'.
Then we'll get a new demo egg: Then we'll get a new demo egg:
...@@ -295,8 +294,8 @@ arguments: ...@@ -295,8 +294,8 @@ arguments:
>>> print system(buildout), >>> print system(buildout),
buildout: Uninstalling demo Uninstalling demo.
buildout: Installing demo Installing demo.
>>> ls(sample_buildout, 'bin') >>> ls(sample_buildout, 'bin')
- buildout - buildout
...@@ -316,9 +315,9 @@ You can also control the name used for scripts: ...@@ -316,9 +315,9 @@ You can also control the name used for scripts:
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print system(buildout),
buildout: Uninstalling demo Uninstalling demo.
buildout: Installing demo Installing demo.
zc.buildout.easy_install: Generated script /sample-buildout/bin/foo. Generated script '/sample-buildout/bin/foo'.
>>> ls(sample_buildout, 'bin') >>> ls(sample_buildout, 'bin')
- buildout - buildout
...@@ -346,9 +345,9 @@ extra-paths option: ...@@ -346,9 +345,9 @@ extra-paths option:
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print system(buildout),
buildout: Uninstalling demo Uninstalling demo.
buildout: Installing demo Installing demo.
zc.buildout.easy_install: Generated script /sample-buildout/bin/foo. Generated script '/sample-buildout/bin/foo'.
Let's look at the script that was generated: Let's look at the script that was generated:
...@@ -395,9 +394,9 @@ to be included in generated scripts: ...@@ -395,9 +394,9 @@ to be included in generated scripts:
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print system(buildout),
buildout: Uninstalling demo Uninstalling demo.
buildout: Installing demo Installing demo.
zc.buildout.easy_install: Generated script /sample-buildout/bin/foo. Generated script '/sample-buildout/bin/foo'.
>>> cat(sample_buildout, 'bin', 'foo') # doctest: +NORMALIZE_WHITESPACE >>> cat(sample_buildout, 'bin', 'foo') # doctest: +NORMALIZE_WHITESPACE
#!/usr/local/bin/python2.4 #!/usr/local/bin/python2.4
...@@ -445,11 +444,11 @@ declare entry points using the entry-points option: ...@@ -445,11 +444,11 @@ declare entry points using the entry-points option:
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print system(buildout),
buildout: Uninstalling demo Uninstalling demo.
buildout: Installing demo Installing demo.
zc.buildout.easy_install: Generated script /sample-buildout/bin/demo. Generated script '/sample-buildout/bin/demo'.
zc.buildout.easy_install: Generated script /sample-buildout/bin/alt. Generated script '/sample-buildout/bin/alt'.
zc.buildout.easy_install: Generated script /sample-buildout/bin/other. Generated script '/sample-buildout/bin/other'.
>>> ls(sample_buildout, 'bin') >>> ls(sample_buildout, 'bin')
- alt - alt
...@@ -492,6 +491,6 @@ be made to contact an index server: ...@@ -492,6 +491,6 @@ be made to contact an index server:
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print system(buildout),
buildout: Uninstalling demo Uninstalling demo.
buildout: Installing demo Installing demo.
zc.buildout.easy_install: Generated script /sample-buildout/bin/foo. Generated script '/sample-buildout/bin/foo'.
...@@ -133,7 +133,7 @@ the egg: ...@@ -133,7 +133,7 @@ the egg:
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print system(buildout),
buildout: Installing extdemo Installing extdemo.
zip_safe flag not set; analyzing archive contents... zip_safe flag not set; analyzing archive contents...
We got the zip_safe warning because the source distribution we used We got the zip_safe warning because the source distribution we used
...@@ -189,10 +189,10 @@ Let's define a script that uses out ext demo: ...@@ -189,10 +189,10 @@ Let's define a script that uses out ext demo:
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/demo Develop: '/sample-buildout/demo'
buildout: Updating extdemo Updating extdemo.
buildout: Installing demo Installing demo.
zc.buildout.easy_install: Generated script /sample-buildout/bin/demo. Generated script '/sample-buildout/bin/demo'.
When we run the script, we'll 42 printed: When we run the script, we'll 42 printed:
...@@ -212,16 +212,14 @@ distribution for extdemo: ...@@ -212,16 +212,14 @@ distribution for extdemo:
If we run the buildout in non-newest or offline modes: If we run the buildout in non-newest or offline modes:
>>> print system(buildout+' -N'), >>> print system(buildout+' -N'),
buildout: Develop: /sample-buildout/demo Develop: '/sample-buildout/demo'
buildout: Updating extdemo Updating extdemo.
buildout: Updating demo Updating demo.
zc.buildout.easy_install: Generated script /sample-buildout/bin/demo.
>>> print system(buildout+' -o'), >>> print system(buildout+' -o'),
buildout: Develop: /sample-buildout/demo Develop: '/sample-buildout/demo'
buildout: Updating extdemo Updating extdemo.
buildout: Updating demo Updating demo.
zc.buildout.easy_install: Generated script /sample-buildout/bin/demo.
We won't get an update. We won't get an update.
...@@ -234,11 +232,11 @@ But if we run the buildout in the default on-line and newest modes, we ...@@ -234,11 +232,11 @@ But if we run the buildout in the default on-line and newest modes, we
will: will:
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/demo Develop: '/sample-buildout/demo'
buildout: Updating extdemo Updating extdemo.
zip_safe flag not set; analyzing archive contents... zip_safe flag not set; analyzing archive contents...
buildout: Updating demo Updating demo.
zc.buildout.easy_install: Generated script /sample-buildout/bin/demo. Generated script '/sample-buildout/bin/demo'.
>>> ls(sample_buildout, 'develop-eggs') >>> ls(sample_buildout, 'develop-eggs')
- demo.egg-link - demo.egg-link
...@@ -272,13 +270,13 @@ We can specify a specific version using the egg option: ...@@ -272,13 +270,13 @@ We can specify a specific version using the egg option:
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout+' -D'), >>> print system(buildout+' -D'),
buildout: Develop: /sample-buildout/demo Develop: '/sample-buildout/demo'
buildout: Uninstalling demo Uninstalling demo.
buildout: Uninstalling extdemo Uninstalling extdemo.
buildout: Installing extdemo Installing extdemo.
zip_safe flag not set; analyzing archive contents... zip_safe flag not set; analyzing archive contents...
buildout: Installing demo Installing demo.
zc.buildout.easy_install: Generated script /sample-buildout/bin/demo. Generated script '/sample-buildout/bin/demo'.
>>> ls(sample_buildout, 'develop-eggs') >>> ls(sample_buildout, 'develop-eggs')
- demo.egg-link - demo.egg-link
...@@ -383,12 +381,12 @@ TWO to be defined. This will cause the module-variable, 'val', to be ...@@ -383,12 +381,12 @@ TWO to be defined. This will cause the module-variable, 'val', to be
set with a value of 2. set with a value of 2.
>>> print system(buildout), >>> print system(buildout),
buildout: Develop: /sample-buildout/demo Develop: '/sample-buildout/demo'
buildout: Uninstalling demo Uninstalling demo.
buildout: Uninstalling extdemo Uninstalling extdemo.
buildout: Installing extdemo Installing extdemo.
buildout: Installing demo Installing demo.
zc.buildout.easy_install: Generated script /sample-buildout/bin/demo. Generated script '/sample-buildout/bin/demo'.
Our develop-eggs now includes an egg link for extdemo: Our develop-eggs now includes an egg link for extdemo:
......
...@@ -48,15 +48,15 @@ Now, if we run the buildout: ...@@ -48,15 +48,15 @@ Now, if we run the buildout:
>>> os.chdir(sample_buildout) >>> os.chdir(sample_buildout)
>>> buildout = os.path.join(sample_buildout, 'bin', 'buildout') >>> buildout = os.path.join(sample_buildout, 'bin', 'buildout')
>>> print system(buildout), >>> print system(buildout),
buildout: Installing demo Installing demo.
zc.buildout.easy_install: Getting new distribution for demo<0.3 Getting distribution for 'demo<0.3'.
zc.buildout.easy_install: Got demo 0.2 Got demo 0.2.
zc.buildout.easy_install: Getting new distribution for demoneeded Getting distribution for 'demoneeded'.
zc.buildout.easy_install: Getting new distribution for setuptools Getting distribution for 'setuptools'.
zc.buildout.easy_install: Got setuptools 0.6 Got setuptools 0.6.
zc.buildout.easy_install: Got demoneeded 1.1 Got demoneeded 1.1.
zc.buildout.easy_install: Generated script /sample-buildout/bin/demo. Generated script '/sample-buildout/bin/demo'.
zc.buildout.easy_install: Generated interpreter /sample-buildout/bin/py-demo. Generated interpreter '/sample-buildout/bin/py-demo'.
we'll get the Python 2.3 eggs for demo and demoneeded: we'll get the Python 2.3 eggs for demo and demoneeded:
......
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