Commit 17788366 authored by jim's avatar jim

Various whitespace, formatting and typo cleanups. Thanks Gary!


git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@105510 62d5b8a3-27da-0310-9561-8e5933582275
parent b22e70f0
...@@ -52,11 +52,11 @@ if is_jython: ...@@ -52,11 +52,11 @@ if is_jython:
import subprocess import subprocess
class MissingOption(zc.buildout.UserError, KeyError): class MissingOption(zc.buildout.UserError, KeyError):
"""A required option was missing """A required option was missing.
""" """
class MissingSection(zc.buildout.UserError, KeyError): class MissingSection(zc.buildout.UserError, KeyError):
"""A required section is missinh """A required section is missing.
""" """
def __str__(self): def __str__(self):
...@@ -145,8 +145,8 @@ class Buildout(UserDict.DictMixin): ...@@ -145,8 +145,8 @@ class Buildout(UserDict.DictMixin):
print 'Creating %r.' % config_file print 'Creating %r.' % config_file
open(config_file, 'w').write('[buildout]\nparts = \n') open(config_file, 'w').write('[buildout]\nparts = \n')
elif command == 'setup': elif command == 'setup':
# Sigh. this model of a buildout nstance # Sigh. This model of a buildout instance
# with methods is breaking down :( # with methods is breaking down. :(
config_file = None config_file = None
data['buildout']['directory'] = ('.', 'COMPUTED_VALUE') data['buildout']['directory'] = ('.', 'COMPUTED_VALUE')
else: else:
...@@ -334,7 +334,7 @@ class Buildout(UserDict.DictMixin): ...@@ -334,7 +334,7 @@ class Buildout(UserDict.DictMixin):
return os.path.join(self._buildout_dir, name) return os.path.join(self._buildout_dir, name)
def bootstrap(self, args): def bootstrap(self, args):
__doing__ = 'Bootstraping.' __doing__ = 'Bootstrapping.'
self._setup_directories() self._setup_directories()
...@@ -905,7 +905,7 @@ class Buildout(UserDict.DictMixin): ...@@ -905,7 +905,7 @@ class Buildout(UserDict.DictMixin):
if not args: if not args:
raise zc.buildout.UserError( raise zc.buildout.UserError(
"The setup command requires the path to a setup script or \n" "The setup command requires the path to a setup script or \n"
"directory containing a setup script, and it's arguments." "directory containing a setup script, and its arguments."
) )
setup = args.pop(0) setup = args.pop(0)
if os.path.isdir(setup): if os.path.isdir(setup):
......
...@@ -575,7 +575,8 @@ When we rerun the buildout: ...@@ -575,7 +575,8 @@ When we rerun the buildout:
.. Wait for the file to really disappear. My linux is weird. .. Wait for the file to really disappear. My linux is weird.
>>> wait_until("foo goes away", lambda : not os.path.exists('foo')) >>> wait_until("foo goes away", lambda : not os.path.exists('foo'),
... timeout=100)
we get the same error, but we don't get the directory left behind: we get the same error, but we don't get the directory left behind:
...@@ -710,13 +711,14 @@ characters, hyphens, and periods. ...@@ -710,13 +711,14 @@ characters, hyphens, and periods.
Annotated sections Annotated sections
------------------ ------------------
When used with the `annotate` command, buildout displays annotated sections. When used with the `annotate` command, buildout displays annotated sections.
All sections are displayed, sorted alphabetically. For each section, All sections are displayed, sorted alphabetically. For each section,
all key-value pairs are displayed, sorted alphabetically, along with all key-value pairs are displayed, sorted alphabetically, along with
the origin of the value (file name or COMPUTED_VALUE, DEFAULT_VALUE, the origin of the value (file name or COMPUTED_VALUE, DEFAULT_VALUE,
COMMAND_LINE_VALUE). COMMAND_LINE_VALUE).
>>> print system(buildout+ ' annotate'), # doctest: +ELLIPSIS >>> print system(buildout+ ' annotate'),
... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
<BLANKLINE> <BLANKLINE>
Annotated sections Annotated sections
================== ==================
...@@ -736,7 +738,7 @@ COMMAND_LINE_VALUE). ...@@ -736,7 +738,7 @@ COMMAND_LINE_VALUE).
DEFAULT_VALUE DEFAULT_VALUE
installed= .installed.cfg installed= .installed.cfg
DEFAULT_VALUE DEFAULT_VALUE
log-format= log-format=
DEFAULT_VALUE DEFAULT_VALUE
log-level= INFO log-level= INFO
DEFAULT_VALUE DEFAULT_VALUE
...@@ -1156,7 +1158,7 @@ Annotated sections output shows which files are responsible for which ...@@ -1156,7 +1158,7 @@ Annotated sections output shows which files are responsible for which
operations. operations.
>>> print system(os.path.join('bin', 'buildout') + ' annotate'), >>> print system(os.path.join('bin', 'buildout') + ' annotate'),
... # doctest: +ELLIPSIS ... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
<BLANKLINE> <BLANKLINE>
Annotated sections Annotated sections
================== ==================
...@@ -1169,7 +1171,7 @@ operations. ...@@ -1169,7 +1171,7 @@ operations.
/sample-buildout/base.cfg /sample-buildout/base.cfg
+= /sample-buildout/extension1.cfg += /sample-buildout/extension1.cfg
+= /sample-buildout/extension2.cfg += /sample-buildout/extension2.cfg
recipe= recipe=
/sample-buildout/base.cfg /sample-buildout/base.cfg
<BLANKLINE> <BLANKLINE>
[part2] [part2]
...@@ -1177,7 +1179,7 @@ operations. ...@@ -1177,7 +1179,7 @@ operations.
/sample-buildout/base.cfg /sample-buildout/base.cfg
-= /sample-buildout/extension1.cfg -= /sample-buildout/extension1.cfg
-= /sample-buildout/extension2.cfg -= /sample-buildout/extension2.cfg
recipe= recipe=
/sample-buildout/base.cfg /sample-buildout/base.cfg
<BLANKLINE> <BLANKLINE>
[part3] [part3]
...@@ -1185,13 +1187,12 @@ operations. ...@@ -1185,13 +1187,12 @@ operations.
c3 c4 c5 c3 c4 c5
/sample-buildout/base.cfg /sample-buildout/base.cfg
+= /sample-buildout/extension1.cfg += /sample-buildout/extension1.cfg
recipe= recipe=
/sample-buildout/base.cfg /sample-buildout/base.cfg
<BLANKLINE> <BLANKLINE>
[part4] [part4]
option= h1 h2 option= h1 h2
/sample-buildout/extension1.cfg /sample-buildout/extension1.cfg
...
Cleanup. Cleanup.
...@@ -1902,12 +1903,13 @@ the buildout in the usual way: ...@@ -1902,12 +1903,13 @@ the buildout in the usual way:
d recipes d recipes
>>> cat(sample_buildout, '.installed.cfg') >>> cat(sample_buildout, '.installed.cfg')
... # doctest: +NORMALIZE_WHITESPACE
[buildout] [buildout]
installed_develop_eggs = /sample-buildout/develop-eggs/recipes.egg-link installed_develop_eggs = /sample-buildout/develop-eggs/recipes.egg-link
parts = debug d1 d2 d3 parts = debug d1 d2 d3
<BLANKLINE> <BLANKLINE>
[debug] [debug]
__buildout_installed__ = __buildout_installed__ =
__buildout_signature__ = recipes-PiIFiO8ny5yNZ1S3JfT0xg== __buildout_signature__ = recipes-PiIFiO8ny5yNZ1S3JfT0xg==
recipe = recipes:debug recipe = recipes:debug
<BLANKLINE> <BLANKLINE>
...@@ -1987,12 +1989,13 @@ were created. ...@@ -1987,12 +1989,13 @@ were created.
The .installed.cfg is only updated for the recipes that ran: The .installed.cfg is only updated for the recipes that ran:
>>> cat(sample_buildout, '.installed.cfg') >>> cat(sample_buildout, '.installed.cfg')
... # doctest: +NORMALIZE_WHITESPACE
[buildout] [buildout]
installed_develop_eggs = /sample-buildout/develop-eggs/recipes.egg-link installed_develop_eggs = /sample-buildout/develop-eggs/recipes.egg-link
parts = debug d1 d2 d3 d4 parts = debug d1 d2 d3 d4
<BLANKLINE> <BLANKLINE>
[debug] [debug]
__buildout_installed__ = __buildout_installed__ =
__buildout_signature__ = recipes-PiIFiO8ny5yNZ1S3JfT0xg== __buildout_signature__ = recipes-PiIFiO8ny5yNZ1S3JfT0xg==
recipe = recipes:debug recipe = recipes:debug
<BLANKLINE> <BLANKLINE>
...@@ -2189,7 +2192,7 @@ database is shown. ...@@ -2189,7 +2192,7 @@ database is shown.
... parts = ... parts =
... """) ... """)
>>> print system(buildout+' -vv'), >>> print system(buildout+' -vv'), # doctest: +NORMALIZE_WHITESPACE
Installing 'zc.buildout', 'setuptools'. Installing 'zc.buildout', 'setuptools'.
We have a develop egg: zc.buildout 1.0.0. We have a develop egg: zc.buildout 1.0.0.
We have the best distribution that satisfies 'setuptools'. We have the best distribution that satisfies 'setuptools'.
...@@ -2203,11 +2206,11 @@ database is shown. ...@@ -2203,11 +2206,11 @@ 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 = 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 = 20 verbosity = 20
...@@ -2323,20 +2326,20 @@ If we have an existing buildout that already has a buildout.cfg, we'll ...@@ -2323,20 +2326,20 @@ If we have an existing buildout that already has a buildout.cfg, we'll
normally use the bootstrap command instead of init. It will complain normally use the bootstrap command instead of init. It will complain
if there isn't a configuration file: if there isn't a configuration file:
>>> sample_bootstrapped2 = tmpdir('sample-bootstrapped2') >>> sample_bootstrapped2 = tmpdir('sample-bootstrapped2')
>>> print system(buildout >>> print system(buildout
... +' -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',
... """ ... """
... [buildout] ... [buildout]
... parts = ... parts =
... """) ... """)
>>> print system(buildout >>> print system(buildout
... +' -c'+os.path.join(sample_bootstrapped2, 'setup.cfg') ... +' -c'+os.path.join(sample_bootstrapped2, 'setup.cfg')
...@@ -2510,8 +2513,7 @@ buildout installed option: ...@@ -2510,8 +2513,7 @@ buildout installed option:
d recipes d recipes
Note that there will be no installation database if there are no Note that there will be no installation database if there are no parts:
parts:
>>> write('buildout.cfg', >>> write('buildout.cfg',
... """ ... """
......
...@@ -67,6 +67,7 @@ buildout_and_setuptools_path = [ ...@@ -67,6 +67,7 @@ buildout_and_setuptools_path = [
pkg_resources.Requirement.parse('zc.buildout')).location, pkg_resources.Requirement.parse('zc.buildout')).location,
] ]
class IncompatibleVersionError(zc.buildout.UserError): class IncompatibleVersionError(zc.buildout.UserError):
"""A specified version is incompatible with a given requirement. """A specified version is incompatible with a given requirement.
""" """
...@@ -95,6 +96,7 @@ def _get_version(executable): ...@@ -95,6 +96,7 @@ def _get_version(executable):
FILE_SCHEME = re.compile('file://', re.I).match FILE_SCHEME = re.compile('file://', re.I).match
class AllowHostsPackageIndex(setuptools.package_index.PackageIndex): class AllowHostsPackageIndex(setuptools.package_index.PackageIndex):
"""Will allow urls that are local to the system. """Will allow urls that are local to the system.
...@@ -139,6 +141,7 @@ _easy_install_cmd = _safe_arg( ...@@ -139,6 +141,7 @@ _easy_install_cmd = _safe_arg(
'from setuptools.command.easy_install import main; main()' 'from setuptools.command.easy_install import main; main()'
) )
class Installer: class Installer:
_versions = {} _versions = {}
...@@ -1164,6 +1167,7 @@ sys.argv[0] = %(setup)r ...@@ -1164,6 +1167,7 @@ sys.argv[0] = %(setup)r
execfile(%(setup)r) execfile(%(setup)r)
""" """
class VersionConflict(zc.buildout.UserError): class VersionConflict(zc.buildout.UserError):
def __init__(self, err, ws): def __init__(self, err, ws):
...@@ -1181,6 +1185,7 @@ class VersionConflict(zc.buildout.UserError): ...@@ -1181,6 +1185,7 @@ class VersionConflict(zc.buildout.UserError):
result.append("but %s requires %r." % (dist, str(req))) result.append("but %s requires %r." % (dist, str(req)))
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):
......
...@@ -29,12 +29,14 @@ doesn't import setuptools. Let's try running it to create an egg. ...@@ -29,12 +29,14 @@ doesn't import setuptools. Let's try running it to create an egg.
We'll use the buildout script from our sample buildout: We'll use the buildout script from our sample buildout:
>>> print system(buildout+' setup'), >>> print system(buildout+' setup'),
Error: The setup command requires the path to a setup script or ... # doctest: +NORMALIZE_WHITESPACE
directory containing a setup script, and it's arguments. Error: The setup command requires the path to a setup script or
directory containing a setup script, and its arguments.
Oops, we forgot to give the name of the setup script: Oops, we forgot to give the name of the setup script:
>>> print system(buildout+' setup setup.py bdist_egg'), # doctest: +ELLIPSIS >>> print system(buildout+' setup setup.py bdist_egg'),
... # doctest: +ELLIPSIS
Running setup script 'setup.py'. Running setup script 'setup.py'.
... ...
......
...@@ -274,7 +274,7 @@ def buildoutSetUp(test): ...@@ -274,7 +274,7 @@ def buildoutSetUp(test):
# Create the develop-eggs dir, which didn't get created the usual # Create the develop-eggs dir, which didn't get created the usual
# way due to thr trick above: # way due to the trick above:
os.mkdir('develop-eggs') os.mkdir('develop-eggs')
def start_server(path): def start_server(path):
......
...@@ -260,18 +260,18 @@ def make_dist_that_requires(dest, name, requires=[], version=1, egg=''): ...@@ -260,18 +260,18 @@ def make_dist_that_requires(dest, name, requires=[], version=1, egg=''):
def show_who_requires_when_there_is_a_conflict(): def show_who_requires_when_there_is_a_conflict():
""" """
It's a pain when we require eggs that have requirements that are It's a pain when we require eggs that have requirements that are
incompatible. We want the error we get to tell us what is missing. incompatible. We want the error we get to tell us what is missing.
Let's make a few develop distros, some of which have incompatible Let's make a few develop distros, some of which have incompatible
requirements. requirements.
>>> make_dist_that_requires(sample_buildout, 'sampley', >>> make_dist_that_requires(sample_buildout, 'sampley',
... ['demoneeded ==1.0']) ... ['demoneeded ==1.0'])
>>> make_dist_that_requires(sample_buildout, 'samplez', >>> make_dist_that_requires(sample_buildout, 'samplez',
... ['demoneeded ==1.1']) ... ['demoneeded ==1.1'])
Now, let's create a buildout that requires y and z: Now, let's create a buildout that requires y and z:
>>> write('buildout.cfg', >>> write('buildout.cfg',
... ''' ... '''
...@@ -298,8 +298,8 @@ def show_who_requires_when_there_is_a_conflict(): ...@@ -298,8 +298,8 @@ def show_who_requires_when_there_is_a_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
What if we hadn't required sampley ourselves: if we hadn't required sampley ourselves:
>>> make_dist_that_requires(sample_buildout, 'samplea', ['sampleb']) >>> make_dist_that_requires(sample_buildout, 'samplea', ['sampleb'])
>>> make_dist_that_requires(sample_buildout, 'sampleb', >>> make_dist_that_requires(sample_buildout, 'sampleb',
...@@ -317,7 +317,7 @@ def show_who_requires_when_there_is_a_conflict(): ...@@ -317,7 +317,7 @@ def show_who_requires_when_there_is_a_conflict():
... samplez ... samplez
... ''' % globals()) ... ''' % globals())
If we use the verbose switch, we can see where requirements are comning from: If we use the verbose switch, we can see where requirements are coming from:
>>> print system(buildout+' -v'), # doctest: +ELLIPSIS >>> print system(buildout+' -v'), # doctest: +ELLIPSIS
Installing 'zc.buildout', 'setuptools'. Installing 'zc.buildout', 'setuptools'.
...@@ -351,10 +351,9 @@ If we use the verbose switch, we can see where requirements are comning from: ...@@ -351,10 +351,9 @@ If we use the verbose switch, we can see where requirements are comning from:
def show_who_requires_missing_distributions(): def show_who_requires_missing_distributions():
""" """
When working with a lot of eggs, which require eggs recursively, When working with a lot of eggs, which require eggs recursively, it can
it can be hard to tell why we're requireing things we can't find. be hard to tell why we're requiring things we can't find. Fortunately,
Fortunately, buildout will tell us who's asking for something that buildout will tell us who's asking for something that we can't find.
we can't find.
>>> make_dist_that_requires(sample_buildout, 'sampley', ['demoneeded']) >>> make_dist_that_requires(sample_buildout, 'sampley', ['demoneeded'])
>>> make_dist_that_requires(sample_buildout, 'samplea', ['sampleb']) >>> make_dist_that_requires(sample_buildout, 'samplea', ['sampleb'])
...@@ -387,8 +386,8 @@ def show_who_requires_missing_distributions(): ...@@ -387,8 +386,8 @@ def show_who_requires_missing_distributions():
def test_comparing_saved_options_with_funny_characters(): def test_comparing_saved_options_with_funny_characters():
""" """
If an option has newlines, extra/odd spaces or a %, we need to make If an option has newlines, extra/odd spaces or a %, we need to make sure
sure the comparison with the saved value works correctly. the comparison with the saved value works correctly.
>>> mkdir(sample_buildout, 'recipes') >>> mkdir(sample_buildout, 'recipes')
>>> write(sample_buildout, 'recipes', 'debug.py', >>> write(sample_buildout, 'recipes', 'debug.py',
...@@ -2158,7 +2157,7 @@ def prefer_final(): ...@@ -2158,7 +2157,7 @@ def prefer_final():
""" """
This test tests several permutations: This test tests several permutations:
Using different version numbers to work around zip impporter cache problems. :( Using different version numbers to work around zip importer cache problems. :(
- With prefer final: - With prefer final:
...@@ -2980,7 +2979,7 @@ def test_suite(): ...@@ -2980,7 +2979,7 @@ def test_suite():
'-q develop -mxN -d "/sample-buildout/develop-eggs'), '-q develop -mxN -d "/sample-buildout/develop-eggs'),
'-q develop -mxN -d /sample-buildout/develop-eggs' '-q develop -mxN -d /sample-buildout/develop-eggs'
), ),
(re.compile(r'^[*]...'), '...'), (re.compile(r'^[*]...'), '...'),
]), ]),
), ),
zc.buildout.testselectingpython.test_suite(), zc.buildout.testselectingpython.test_suite(),
......
...@@ -24,14 +24,14 @@ else: ...@@ -24,14 +24,14 @@ else:
__test__ = dict( __test__ = dict(
test_selecting_python_via_easy_install= test_selecting_python_via_easy_install=
"""\ """\
We can specify an specific Python executable. We can specify a specific Python executable.
>>> dest = tmpdir('sample-install') >>> dest = tmpdir('sample-install')
>>> ws = zc.buildout.easy_install.install( >>> ws = zc.buildout.easy_install.install(
... ['demo'], dest, links=[link_server], ... ['demo'], dest, links=[link_server],
... index='http://www.python.org/pypi/', ... index='http://www.python.org/pypi/',
... always_unzip=True, executable= other_executable) ... always_unzip=True, executable=other_executable)
>>> ls(dest) >>> ls(dest)
d demo-0.3-py%(other_version)s.egg d demo-0.3-py%(other_version)s.egg
......
...@@ -21,10 +21,9 @@ By default, zc.buildout doesn't unzip zip-safe eggs. ...@@ -21,10 +21,9 @@ By default, zc.buildout doesn't unzip zip-safe eggs.
d setuptools-0.6c8-py2.4.egg d setuptools-0.6c8-py2.4.egg
- zc.buildout.egg-link - zc.buildout.egg-link
This follows the This follows the policy followed by setuptools itself. Experience shows
policy followed by setuptools itself. Experience shows this policy this policy to to be inconvenient. Zipped eggs make debugging more
to to be inconvenient. Zipped eggs make debugging more difficult and difficult and often import more slowly.
often import more slowly.
You can include an unzip option in the buildout section to change the You can include an unzip option in the buildout section to change the
default unzipping policy. default unzipping policy.
......
...@@ -21,7 +21,7 @@ Let's update the sample buildout.cfg to look in this area: ...@@ -21,7 +21,7 @@ Let's update the sample buildout.cfg to look in this area:
... index = %(new_releases)s ... index = %(new_releases)s
... parts = show-versions ... parts = show-versions
... develop = showversions ... develop = showversions
... ...
... [show-versions] ... [show-versions]
... recipe = showversions ... recipe = showversions
... """ % dict(new_releases=new_releases)) ... """ % dict(new_releases=new_releases))
...@@ -31,7 +31,7 @@ zc.buildout used: ...@@ -31,7 +31,7 @@ zc.buildout used:
>>> mkdir(sample_buildout, 'showversions') >>> mkdir(sample_buildout, 'showversions')
>>> write(sample_buildout, 'showversions', 'showversions.py', >>> write(sample_buildout, 'showversions', 'showversions.py',
... """ ... """
... import pkg_resources ... import pkg_resources
... ...
...@@ -52,7 +52,7 @@ zc.buildout used: ...@@ -52,7 +52,7 @@ zc.buildout used:
>>> write(sample_buildout, 'showversions', 'setup.py', >>> write(sample_buildout, 'showversions', 'setup.py',
... """ ... """
... from setuptools import setup ... from setuptools import setup
... ...
... setup( ... setup(
... name = "showversions", ... name = "showversions",
... entry_points = {'zc.buildout': ['default = showversions:Recipe']}, ... entry_points = {'zc.buildout': ['default = showversions:Recipe']},
...@@ -80,7 +80,7 @@ new versions found in new releases: ...@@ -80,7 +80,7 @@ new versions found in new releases:
Our buildout script has been updated to use the new eggs: Our buildout script has been updated to use the new eggs:
>>> cat(sample_buildout, 'bin', 'buildout') >>> cat(sample_buildout, 'bin', 'buildout')
#!/usr/local/bin/python2.4 #!/usr/local/bin/python2.4
<BLANKLINE> <BLANKLINE>
import sys import sys
...@@ -107,7 +107,7 @@ buildout will install earlier versions of these packages: ...@@ -107,7 +107,7 @@ buildout will install earlier versions of these packages:
... develop = showversions ... develop = showversions
... zc.buildout-version = < 99 ... zc.buildout-version = < 99
... setuptools-version = < 99 ... setuptools-version = < 99
... ...
... [show-versions] ... [show-versions]
... recipe = showversions ... recipe = showversions
... """ % dict(new_releases=new_releases)) ... """ % dict(new_releases=new_releases))
...@@ -126,7 +126,7 @@ Now we can see that we actually "upgrade" to an earlier version. ...@@ -126,7 +126,7 @@ Now we can see that we actually "upgrade" to an earlier version.
setuptools 0.6 setuptools 0.6
There are a number of cases, described below, in which the updates There are a number of cases, described below, in which the updates
don't happen. don't happen.
We won't upgrade in offline mode: We won't upgrade in offline mode:
...@@ -137,7 +137,7 @@ We won't upgrade in offline mode: ...@@ -137,7 +137,7 @@ We won't upgrade in offline mode:
... index = %(new_releases)s ... index = %(new_releases)s
... parts = show-versions ... parts = show-versions
... develop = showversions ... develop = showversions
... ...
... [show-versions] ... [show-versions]
... recipe = showversions ... recipe = showversions
... """ % dict(new_releases=new_releases)) ... """ % dict(new_releases=new_releases))
...@@ -166,9 +166,9 @@ directory: ...@@ -166,9 +166,9 @@ directory:
... [buildout] ... [buildout]
... find-links = %(new_releases)s ... find-links = %(new_releases)s
... index = %(new_releases)s ... index = %(new_releases)s
... parts = ... parts =
... """ % dict(new_releases=new_releases)) ... """ % dict(new_releases=new_releases))
>>> cd(sample_buildout2) >>> cd(sample_buildout2)
>>> print system(buildout), >>> print system(buildout),
Creating directory '/sample_buildout2/bin'. Creating directory '/sample_buildout2/bin'.
......
...@@ -96,7 +96,7 @@ The demo egg defined a script, but we didn't get one installed: ...@@ -96,7 +96,7 @@ The demo egg defined a script, but we didn't get one installed:
>>> ls(sample_buildout, 'bin') >>> ls(sample_buildout, 'bin')
- buildout - buildout
If we want scripts provided by eggs to be installed, we should use the If we want scripts provided by eggs to be installed, we should use the
scripts recipe: scripts recipe:
>>> write(sample_buildout, 'buildout.cfg', >>> write(sample_buildout, 'buildout.cfg',
...@@ -135,7 +135,7 @@ entry-points ...@@ -135,7 +135,7 @@ entry-points
This option is useful when working with distributions that don't This option is useful when working with distributions that don't
declare entry points, such as distributions not written to work declare entry points, such as distributions not written to work
with setuptools. with setuptools.
Examples can be seen in the section "Specifying entry points" below. Examples can be seen in the section "Specifying entry points" below.
...@@ -271,7 +271,7 @@ We didn't get an update for demo: ...@@ -271,7 +271,7 @@ We didn't get an update for demo:
- setuptools-0.6-py2.3.egg - setuptools-0.6-py2.3.egg
- zc.buildout-1.0-py2.3.egg - zc.buildout-1.0-py2.3.egg
If we run the buildout on the default online and newest modes, 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),
......
...@@ -42,7 +42,7 @@ class Eggs(object): ...@@ -42,7 +42,7 @@ class Eggs(object):
allow_hosts = buildout['buildout'].get('allow-hosts', '*') allow_hosts = buildout['buildout'].get('allow-hosts', '*')
allow_hosts = tuple([host.strip() for host in allow_hosts.split('\n') allow_hosts = tuple([host.strip() for host in allow_hosts.split('\n')
if host.strip()!='']) if host.strip()!=''])
self.allow_hosts = allow_hosts self.allow_hosts = allow_hosts
options['eggs-directory'] = buildout['buildout']['eggs-directory'] options['eggs-directory'] = buildout['buildout']['eggs-directory']
options['_e'] = options['eggs-directory'] # backward compat. options['_e'] = options['eggs-directory'] # backward compat.
...@@ -81,9 +81,9 @@ class Eggs(object): ...@@ -81,9 +81,9 @@ class Eggs(object):
ws = zc.buildout.easy_install.install( ws = zc.buildout.easy_install.install(
distributions, options['eggs-directory'], distributions, options['eggs-directory'],
links = self.links, links=self.links,
index = self.index, index=self.index,
executable = options['executable'], executable=options['executable'],
path=[options['develop-eggs-directory']], path=[options['develop-eggs-directory']],
newest=self.buildout['buildout'].get('newest') == 'true', newest=self.buildout['buildout'].get('newest') == 'true',
allow_hosts=self.allow_hosts, allow_hosts=self.allow_hosts,
...@@ -115,7 +115,7 @@ class Scripts(Eggs): ...@@ -115,7 +115,7 @@ class Scripts(Eggs):
relative_paths = options.get( relative_paths = options.get(
'relative-paths', 'relative-paths',
buildout['buildout'].get('relative-paths', 'false') buildout['buildout'].get('relative-paths', 'false')
) )
if relative_paths == 'true': if relative_paths == 'true':
...@@ -150,7 +150,7 @@ class Scripts(Eggs): ...@@ -150,7 +150,7 @@ class Scripts(Eggs):
reqs.append(parsed.groups()) reqs.append(parsed.groups())
if get_bool(options, 'dependent-scripts'): if get_bool(options, 'dependent-scripts'):
# generate scripts for all packages in the working set, # Generate scripts for all packages in the working set,
# except setuptools. # except setuptools.
reqs = list(reqs) reqs = list(reqs)
for dist in ws: for dist in ws:
...@@ -183,6 +183,6 @@ def get_bool(options, name, default=False): ...@@ -183,6 +183,6 @@ def get_bool(options, name, default=False):
return False return False
else: else:
raise zc.buildout.UserError( raise zc.buildout.UserError(
"Invalid value for %s: %s" % (name, value)) "Invalid value for %s option: %s" % (name, value))
Egg = Scripts Egg = Scripts
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