Commit 70c9ae13 authored by Jim Fulton's avatar Jim Fulton

checkpoint

parent 83d53da5
...@@ -55,19 +55,15 @@ local files:: ...@@ -55,19 +55,15 @@ local files::
Now we can run the buildout and make sure all attempts to dist.plone.org fails:: Now we can run the buildout and make sure all attempts to dist.plone.org fails::
>>> print_(system(buildout)) >>> print_(system(buildout), end='') # doctest: +ELLIPSIS
Develop: '/sample-buildout/allowdemo' Develop: '/sample-buildout/allowdemo'
Installing eggs. Installing eggs...
<BLANKLINE>
Link to http://dist.plone.org ***BLOCKED*** by --allow-hosts Link to http://dist.plone.org ***BLOCKED*** by --allow-hosts
<BLANKLINE> ...
Couldn't find index page for 'kss.core' (maybe misspelled?)
Getting distribution for 'kss.core'.
While: While:
Installing eggs. Installing eggs.
Getting distribution for 'kss.core'. Getting distribution for 'kss.core'.
Error: Couldn't find a distribution for 'kss.core'. Error: Couldn't find a distribution for 'kss.core'.
<BLANKLINE>
That's what we wanted : this will prevent any attempt to access That's what we wanted : this will prevent any attempt to access
unwanted domains. For instance, some packages are listing in their unwanted domains. For instance, some packages are listing in their
...@@ -91,19 +87,15 @@ XXX (showcase with a svn:// file) ...@@ -91,19 +87,15 @@ XXX (showcase with a svn:// file)
Now we can run the buildout and make sure all attempts to dist.plone.org fails:: Now we can run the buildout and make sure all attempts to dist.plone.org fails::
>>> print_(system(buildout)) >>> print_(system(buildout), end='') # doctest: +ELLIPSIS
Develop: '/sample-buildout/allowdemo' Develop: '/sample-buildout/allowdemo'
Installing eggs. Installing eggs...
<BLANKLINE>
Link to http://dist.plone.org ***BLOCKED*** by --allow-hosts Link to http://dist.plone.org ***BLOCKED*** by --allow-hosts
<BLANKLINE> ...
Couldn't find index page for 'kss.core' (maybe misspelled?)
Getting distribution for 'kss.core'.
While: While:
Installing eggs. Installing eggs.
Getting distribution for 'kss.core'. Getting distribution for 'kss.core'.
Error: Couldn't find a distribution for 'kss.core'. Error: Couldn't find a distribution for 'kss.core'.
<BLANKLINE>
Test for issues Test for issues
--------------- ---------------
...@@ -121,15 +113,14 @@ Test for 1.0.5 breakage as in https://bugs.launchpad.net/zc.buildout/+bug/239212 ...@@ -121,15 +113,14 @@ Test for 1.0.5 breakage as in https://bugs.launchpad.net/zc.buildout/+bug/239212
... eggs=zc.buildout ... eggs=zc.buildout
... interpreter=python ... interpreter=python
... ''') ... ''')
>>> print_('XX'; print system(buildout)) # doctest: +ELLIPSIS >>> print_('XX'); print_(system(buildout), end='') # doctest: +ELLIPSIS
X... X...
Unused options for buildout: 'foo'. Unused options for buildout: 'foo'.
Installing python. Installing python.
Generated script '/sample-buildout/bin/buildout'. Generated script '/sample-buildout/bin/buildout'.
Generated interpreter '/sample-buildout/bin/python'. Generated interpreter '/sample-buildout/bin/python'.
<BLANKLINE>
The bug 239212 above would have got us an *AttributeError* on *buildout._allow_hosts*. The bug 239212 above would have got us an *AttributeError* on
This was fixed in this changeset: *buildout._allow_hosts*. This was fixed in this changeset:
http://svn.zope.org/zc.buildout/trunk/src/zc/buildout/buildout.py?rev=87309&r1=87277&r2=87309 http://svn.zope.org/zc.buildout/trunk/src/zc/buildout/buildout.py?rev=87309&r1=87277&r2=87309
...@@ -20,7 +20,7 @@ Make sure the bootstrap script actually works:: ...@@ -20,7 +20,7 @@ Make sure the bootstrap script actually works::
... parts = ... parts =
... ''') ... ''')
>>> write('bootstrap.py', open(bootstrap_py).read()) >>> write('bootstrap.py', open(bootstrap_py).read())
>>> print_('X'; print system( >>> print_('X'); print_(system(
... zc.buildout.easy_install._safe_arg(sys.executable)+' '+ ... zc.buildout.easy_install._safe_arg(sys.executable)+' '+
... 'bootstrap.py')); print_('X') # doctest: +ELLIPSIS ... 'bootstrap.py')); print_('X') # doctest: +ELLIPSIS
X... X...
......
...@@ -82,11 +82,10 @@ buildout to see where the egg comes from this time. ...@@ -82,11 +82,10 @@ buildout to see where the egg comes from this time.
... for egg in glob(join(sample_buildout, 'eggs', 'demoneeded*.egg')): ... for egg in glob(join(sample_buildout, 'eggs', 'demoneeded*.egg')):
... remove(sample_buildout, 'eggs', egg) ... remove(sample_buildout, 'eggs', egg)
>>> remove_demoneeded_egg() >>> remove_demoneeded_egg()
>>> print_(system(buildout), end='') >>> print_(system(buildout), end='') # doctest: +ELLIPSIS
Develop: '/sample-buildout/depdemo' Develop: '/sample-buildout/depdemo'
Updating eggs. Updating eggs.
Couldn't find index page for 'demoneeded' (maybe misspelled?) ...
Getting distribution for 'demoneeded'.
While: While:
Updating eggs. Updating eggs.
Getting distribution for 'demoneeded'. Getting distribution for 'demoneeded'.
......
...@@ -23,6 +23,7 @@ import os ...@@ -23,6 +23,7 @@ import os
import os.path import os.path
import re import re
import shutil import shutil
import sys
import tempfile import tempfile
import urllib.request, urllib.parse, urllib.error import urllib.request, urllib.parse, urllib.error
import urllib.parse import urllib.parse
...@@ -183,7 +184,7 @@ class Download(object): ...@@ -183,7 +184,7 @@ class Download(object):
e = sys.exc_info()[1] e = sys.exc_info()[1]
os.remove(tmp_path) os.remove(tmp_path)
raise zc.buildout.UserError("Error downloading extends for URL " raise zc.buildout.UserError("Error downloading extends for URL "
"%s: %r" % (url, e[1:3])) "%s: %s" % (url, e))
except Exception: except Exception:
os.remove(tmp_path) os.remove(tmp_path)
raise raise
...@@ -201,7 +202,7 @@ class Download(object): ...@@ -201,7 +202,7 @@ class Download(object):
""" """
if self.hash_name: if self.hash_name:
return md5(url).hexdigest() return md5(url.encode()).hexdigest()
else: else:
if re.match(r"^[A-Za-z]:\\", url): if re.match(r"^[A-Za-z]:\\", url):
url = 'file:' + url url = 'file:' + url
......
...@@ -75,13 +75,13 @@ We can also have the downloaded file's MD5 sum checked: ...@@ -75,13 +75,13 @@ We can also have the downloaded file's MD5 sum checked:
... except ImportError: from md5 import new as md5 ... except ImportError: from md5 import new as md5
>>> path, is_temp = download(server_url+'foo.txt', >>> path, is_temp = download(server_url+'foo.txt',
... md5('This is a foo text.').hexdigest()) ... md5('This is a foo text.'.encode()).hexdigest())
>>> is_temp >>> is_temp
True True
>>> remove(path) >>> remove(path)
>>> download(server_url+'foo.txt', >>> download(server_url+'foo.txt',
... md5('The wrong text.').hexdigest()) ... md5('The wrong text.'.encode()).hexdigest())
Traceback (most recent call last): Traceback (most recent call last):
ChecksumError: MD5 checksum mismatch downloading 'http://localhost/foo.txt' ChecksumError: MD5 checksum mismatch downloading 'http://localhost/foo.txt'
...@@ -89,11 +89,11 @@ The error message in the event of an MD5 checksum mismatch for a local file ...@@ -89,11 +89,11 @@ The error message in the event of an MD5 checksum mismatch for a local file
reads somewhat differently: reads somewhat differently:
>>> download(join(server_data, 'foo.txt'), >>> download(join(server_data, 'foo.txt'),
... md5('This is a foo text.').hexdigest()) ... md5('This is a foo text.'.encode()).hexdigest())
('/sample_files/foo.txt', False) ('/sample_files/foo.txt', False)
>>> download(join(server_data, 'foo.txt'), >>> download(join(server_data, 'foo.txt'),
... md5('The wrong text.').hexdigest()) ... md5('The wrong text.'.encode()).hexdigest())
Traceback (most recent call last): Traceback (most recent call last):
ChecksumError: MD5 checksum mismatch for local resource at '/sample_files/foo.txt'. ChecksumError: MD5 checksum mismatch for local resource at '/sample_files/foo.txt'.
...@@ -168,7 +168,7 @@ This is a foo text. ...@@ -168,7 +168,7 @@ This is a foo text.
If we specify an MD5 checksum for a file that is already in the cache, the If we specify an MD5 checksum for a file that is already in the cache, the
cached copy's checksum will be verified: cached copy's checksum will be verified:
>>> download(server_url+'foo.txt', md5('The wrong text.').hexdigest()) >>> download(server_url+'foo.txt', md5('The wrong text.'.encode()).hexdigest())
Traceback (most recent call last): Traceback (most recent call last):
ChecksumError: MD5 checksum mismatch for cached download ChecksumError: MD5 checksum mismatch for cached download
from 'http://localhost/foo.txt' at '/download-cache/foo.txt' from 'http://localhost/foo.txt' at '/download-cache/foo.txt'
...@@ -247,7 +247,7 @@ This is a foo text. ...@@ -247,7 +247,7 @@ This is a foo text.
However, resources with checksum mismatches will not be copied to the cache: However, resources with checksum mismatches will not be copied to the cache:
>>> download(server_url+'foo.txt', md5('The wrong text.').hexdigest()) >>> download(server_url+'foo.txt', md5('The wrong text.'.encode()).hexdigest())
Traceback (most recent call last): Traceback (most recent call last):
ChecksumError: MD5 checksum mismatch downloading 'http://localhost/foo.txt' ChecksumError: MD5 checksum mismatch downloading 'http://localhost/foo.txt'
>>> ls(cache) >>> ls(cache)
...@@ -256,9 +256,11 @@ ChecksumError: MD5 checksum mismatch downloading 'http://localhost/foo.txt' ...@@ -256,9 +256,11 @@ ChecksumError: MD5 checksum mismatch downloading 'http://localhost/foo.txt'
If the file is completely missing it should notify the user of the error: If the file is completely missing it should notify the user of the error:
>>> download(server_url+'bar.txt') >>> download(server_url+'bar.txt') # doctest: +NORMALIZE_WHITESPACE
Traceback (most recent call last): Traceback (most recent call last):
UserError: Error downloading extends for URL http://localhost/bar.txt: (404, 'Not Found') ...
UserError: Error downloading extends for URL http://localhost/bar.txt:
HTTP Error 404: Not Found
>>> ls(cache) >>> ls(cache)
Finally, let's see what happens if the download cache to be used doesn't exist Finally, let's see what happens if the download cache to be used doesn't exist
...@@ -344,7 +346,8 @@ checksum since we don't know which port the server happens to listen at when ...@@ -344,7 +346,8 @@ checksum since we don't know which port the server happens to listen at when
the test is run, so we don't actually know the full URL of the file. Let's the test is run, so we don't actually know the full URL of the file. Let's
check that the checksum actually belongs to the particular URL used: check that the checksum actually belongs to the particular URL used:
>>> path.lower() == join(cache, md5(server_url+'foo.txt').hexdigest()).lower() >>> (path.lower() ==
... join(cache, md5((server_url+'foo.txt').encode()).hexdigest()).lower())
True True
The cached copy is used when downloading the file again: The cached copy is used when downloading the file again:
...@@ -366,7 +369,9 @@ cache under a different name: ...@@ -366,7 +369,9 @@ cache under a different name:
/download-cache/537b6d73267f8f4447586989af8c470e /download-cache/537b6d73267f8f4447586989af8c470e
>>> path == path2 >>> path == path2
False False
>>> path2.lower() == join(cache, md5(server_url+'other/foo.txt').hexdigest()).lower() >>> (path2.lower() ==
... join(cache, md5((server_url+'other/foo.txt').encode()).hexdigest()
... ).lower())
True True
>>> cat(path) >>> cat(path)
This is a foo text. This is a foo text.
...@@ -446,7 +451,7 @@ When trying to download a resource whose checksum does not match, the cached ...@@ -446,7 +451,7 @@ When trying to download a resource whose checksum does not match, the cached
copy will neither be used nor overwritten: copy will neither be used nor overwritten:
>>> write(server_data, 'foo.txt', 'This is a foo text.') >>> write(server_data, 'foo.txt', 'This is a foo text.')
>>> download(server_url+'foo.txt', md5('The wrong text.').hexdigest()) >>> download(server_url+'foo.txt', md5('The wrong text.'.encode()).hexdigest())
Traceback (most recent call last): Traceback (most recent call last):
ChecksumError: MD5 checksum mismatch downloading 'http://localhost/foo.txt' ChecksumError: MD5 checksum mismatch downloading 'http://localhost/foo.txt'
>>> cat(cache, 'foo.txt') >>> cat(cache, 'foo.txt')
...@@ -539,9 +544,10 @@ conversions: ...@@ -539,9 +544,10 @@ conversions:
>>> text = 'First line of text.\r\nSecond line.\r\n' >>> text = 'First line of text.\r\nSecond line.\r\n'
>>> f = open(join(server_data, 'foo.txt'), 'wb') >>> f = open(join(server_data, 'foo.txt'), 'wb')
>>> f.write(text) >>> _ = f.write(text.encode())
>>> f.close() >>> f.close()
>>> path, is_temp = Download()(server_url+'foo.txt', md5(text).hexdigest()) >>> path, is_temp = Download()(server_url+'foo.txt',
... md5(text.encode()).hexdigest())
>>> remove(path) >>> remove(path)
When "downloading" a directory given by file-system path or ``file:`` URL and When "downloading" a directory given by file-system path or ``file:`` URL and
......
...@@ -22,7 +22,7 @@ To see how this works, we'll create two versions of a recipe egg: ...@@ -22,7 +22,7 @@ To see how this works, we'll create two versions of a recipe egg:
>>> write('recipe', 'recipe.py', >>> write('recipe', 'recipe.py',
... ''' ... '''
... import sys ... import sys
... print_ = lambda *a: sys.stdout.write(' '.join(map(str, a))+'\n') ... print_ = lambda *a: sys.stdout.write(' '.join(map(str, a))+'\\n')
... class Recipe: ... class Recipe:
... def __init__(*a): pass ... def __init__(*a): pass
... def install(self): ... def install(self):
...@@ -50,7 +50,7 @@ To see how this works, we'll create two versions of a recipe egg: ...@@ -50,7 +50,7 @@ To see how this works, we'll create two versions of a recipe egg:
>>> write('recipe', 'recipe.py', >>> write('recipe', 'recipe.py',
... ''' ... '''
... import sys ... import sys
... print_ = lambda *a: sys.stdout.write(' '.join(map(str, a))+'\n') ... print_ = lambda *a: sys.stdout.write(' '.join(map(str, a))+'\\n')
... class Recipe: ... class Recipe:
... def __init__(*a): pass ... def __init__(*a): pass
... def install(self): ... def install(self):
......
...@@ -18,7 +18,7 @@ To illustrate this, we'll create a package in a sample buildout: ...@@ -18,7 +18,7 @@ To illustrate this, we'll create a package in a sample buildout:
>>> mkdir('hello') >>> mkdir('hello')
>>> write('hello', 'hello.py', >>> write('hello', 'hello.py',
... 'import sys; sys.stdout.write("Hello World!\n")\n') ... 'import sys; sys.stdout.write("Hello World!\\n")\n')
>>> write('hello', 'README', 'This is hello') >>> write('hello', 'README', 'This is hello')
>>> write('hello', 'setup.py', >>> write('hello', 'setup.py',
... """ ... """
......
...@@ -49,7 +49,7 @@ We should be able to deal with setup scripts that aren't setuptools based. ...@@ -49,7 +49,7 @@ We should be able to deal with setup scripts that aren't setuptools based.
... parts = ... parts =
... ''') ... ''')
>>> print_(system(join('bin', 'buildout')), end=' ') >>> print_(system(join('bin', 'buildout')), end='')
Develop: '/sample-buildout/foo' Develop: '/sample-buildout/foo'
>>> ls('develop-eggs') >>> ls('develop-eggs')
...@@ -76,7 +76,7 @@ We should be able to deal with setup scripts that aren't setuptools based. ...@@ -76,7 +76,7 @@ We should be able to deal with setup scripts that aren't setuptools based.
... parts = ... parts =
... ''') ... ''')
>>> print_(system(join('bin', 'buildout')+' -vv'), end=' ') >>> print_(system(join('bin', 'buildout')+' -vv'), end='')
... # doctest: +ELLIPSIS ... # doctest: +ELLIPSIS
Installing... Installing...
Develop: '/sample-buildout/foo' Develop: '/sample-buildout/foo'
...@@ -88,7 +88,7 @@ We should be able to deal with setup scripts that aren't setuptools based. ...@@ -88,7 +88,7 @@ We should be able to deal with setup scripts that aren't setuptools based.
- foo.egg-link - foo.egg-link
- zc.recipe.egg.egg-link - zc.recipe.egg.egg-link
>>> print_(system(join('bin', 'buildout')+' -vvv'), end=' ') >>> print_(system(join('bin', 'buildout')+' -vvv'), end='')
... # doctest: +ELLIPSIS ... # doctest: +ELLIPSIS
Installing... Installing...
Develop: '/sample-buildout/foo' Develop: '/sample-buildout/foo'
...@@ -131,7 +131,7 @@ It is an error to create a variable-reference cycle: ...@@ -131,7 +131,7 @@ 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')),
... end=' ') ... end='')
... # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS ... # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
While: While:
Initializing. Initializing.
...@@ -154,7 +154,7 @@ It is an error to use funny characters in variable refereces: ...@@ -154,7 +154,7 @@ 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')),
... end=' ') ... end='')
While: While:
Initializing. Initializing.
Getting section buildout. Getting section buildout.
...@@ -172,7 +172,7 @@ It is an error to use funny characters in variable refereces: ...@@ -172,7 +172,7 @@ 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')),
... end=' ') ... end='')
While: While:
Initializing. Initializing.
Getting section buildout. Getting section buildout.
...@@ -192,7 +192,7 @@ and too have too many or too few colons: ...@@ -192,7 +192,7 @@ 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')),
... end=' ') ... end='')
While: While:
Initializing. Initializing.
Getting section buildout. Getting section buildout.
...@@ -210,7 +210,7 @@ and too have too many or too few colons: ...@@ -210,7 +210,7 @@ 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')),
... end=' ') ... end='')
While: While:
Initializing. Initializing.
Getting section buildout. Getting section buildout.
...@@ -228,7 +228,7 @@ Al parts have to have a section: ...@@ -228,7 +228,7 @@ 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')),
... end=' ') ... end='')
While: While:
Installing. Installing.
Getting section x. Getting section x.
...@@ -247,7 +247,7 @@ and all parts have to have a specified recipe: ...@@ -247,7 +247,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')),
... end=' ') ... end='')
While: While:
Installing. Installing.
Error: Missing option: x:recipe Error: Missing option: x:recipe
...@@ -296,7 +296,7 @@ Now, let's create a buildout that requires y and z: ...@@ -296,7 +296,7 @@ Now, let's create a buildout that requires y and z:
... samplez ... samplez
... ''' % globals()) ... ''' % globals())
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Develop: '/sample-buildout/sampley' Develop: '/sample-buildout/sampley'
Develop: '/sample-buildout/samplez' Develop: '/sample-buildout/samplez'
Installing eggs. Installing eggs.
...@@ -329,7 +329,7 @@ if we hadn't required sampley ourselves: ...@@ -329,7 +329,7 @@ if we hadn't required sampley ourselves:
If we use the verbose switch, we can see where requirements are coming from: If we use the verbose switch, we can see where requirements are coming from:
>>> print_(system(buildout+' -v'), end=' ') # doctest: +ELLIPSIS >>> print_(system(buildout+' -v'), end='') # doctest: +ELLIPSIS
Installing 'zc.buildout', 'distribute'. Installing 'zc.buildout', 'distribute'.
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 'distribute'. We have the best distribution that satisfies 'distribute'.
...@@ -380,7 +380,7 @@ buildout will tell us who's asking for something that we can't find. ...@@ -380,7 +380,7 @@ buildout will tell us who's asking for something that we can't find.
... eggs = samplea ... eggs = samplea
... ''') ... ''')
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Develop: '/sample-buildout/sampley' Develop: '/sample-buildout/sampley'
Develop: '/sample-buildout/samplea' Develop: '/sample-buildout/samplea'
Develop: '/sample-buildout/sampleb' Develop: '/sample-buildout/sampleb'
...@@ -457,14 +457,14 @@ the comparison with the saved value works correctly. ...@@ -457,14 +457,14 @@ the comparison with the saved value works correctly.
>>> 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), end=' ') >>> print_(system(buildout), end='')
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
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), end=' ') >>> print_(system(buildout), end='')
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
Updating debug. Updating debug.
""" """
...@@ -518,7 +518,7 @@ def create_sections_on_command_line(): ...@@ -518,7 +518,7 @@ def create_sections_on_command_line():
... x = ${foo:bar} ... x = ${foo:bar}
... ''') ... ''')
>>> print_(system(buildout + ' foo:bar=1 -vv'), end=' ') >>> print_(system(buildout + ' foo:bar=1 -vv'), end='')
... # doctest: +ELLIPSIS ... # doctest: +ELLIPSIS
Installing 'zc.buildout', 'distribute'. Installing 'zc.buildout', 'distribute'.
... ...
...@@ -567,7 +567,7 @@ bootstrapping. ...@@ -567,7 +567,7 @@ 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'), end=' ') ... + ' bootstrap'), end='')
Creating directory '/sample-bootstrap/bin'. Creating directory '/sample-bootstrap/bin'.
Creating directory '/sample-bootstrap/parts'. Creating directory '/sample-bootstrap/parts'.
Creating directory '/sample-bootstrap/eggs'. Creating directory '/sample-bootstrap/eggs'.
...@@ -594,14 +594,14 @@ def bug_92891_bootstrap_crashes_with_egg_recipe_in_buildout_section(): ...@@ -594,14 +594,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'), end=' ') ... + ' bootstrap'), end='')
Creating directory '/sample-bootstrap/bin'. Creating directory '/sample-bootstrap/bin'.
Creating directory '/sample-bootstrap/parts'. Creating directory '/sample-bootstrap/parts'.
Creating directory '/sample-bootstrap/eggs'. Creating directory '/sample-bootstrap/eggs'.
Creating directory '/sample-bootstrap/develop-eggs'. Creating directory '/sample-bootstrap/develop-eggs'.
Generated script '/sample-bootstrap/bin/buildout'. Generated script '/sample-bootstrap/bin/buildout'.
>>> print_(system(os.path.join('bin', 'buildout')), end=' ') >>> print_(system(os.path.join('bin', 'buildout')), end='')
Unused options for buildout: 'scripts' 'eggs'. Unused options for buildout: 'scripts' 'eggs'.
""" """
...@@ -625,7 +625,7 @@ Create a develop egg: ...@@ -625,7 +625,7 @@ Create a develop egg:
... parts = ... parts =
... """) ... """)
>>> print_(system(join('bin', 'buildout')), end=' ') >>> print_(system(join('bin', 'buildout')), end='')
Develop: '/sample-buildout/foo' Develop: '/sample-buildout/foo'
>>> ls('develop-eggs') >>> ls('develop-eggs')
...@@ -647,7 +647,7 @@ Create another: ...@@ -647,7 +647,7 @@ Create another:
... parts = ... parts =
... """) ... """)
>>> print_(system(join('bin', 'buildout')), end=' ') >>> print_(system(join('bin', 'buildout')), end='')
Develop: '/sample-buildout/foo' Develop: '/sample-buildout/foo'
Develop: '/sample-buildout/bar' Develop: '/sample-buildout/bar'
...@@ -664,7 +664,7 @@ Remove one: ...@@ -664,7 +664,7 @@ Remove one:
... develop = bar ... develop = bar
... parts = ... parts =
... """) ... """)
>>> print_(system(join('bin', 'buildout')), end=' ') >>> print_(system(join('bin', 'buildout')), end='')
Develop: '/sample-buildout/bar' Develop: '/sample-buildout/bar'
It is gone It is gone
...@@ -680,7 +680,7 @@ Remove the other: ...@@ -680,7 +680,7 @@ Remove the other:
... [buildout] ... [buildout]
... parts = ... parts =
... """) ... """)
>>> print_(system(join('bin', 'buildout')), end=' ') >>> print_(system(join('bin', 'buildout')), end='')
All gone All gone
...@@ -725,7 +725,7 @@ a devlop egg, we will also generate a warning. ...@@ -725,7 +725,7 @@ a devlop egg, we will also generate a warning.
... parts = ... parts =
... """) ... """)
>>> print_(system(join('bin', 'buildout')), end=' ') >>> print_(system(join('bin', 'buildout')), end='')
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
...@@ -776,7 +776,7 @@ We do not get a warning, but we do get distribute included in the working set: ...@@ -776,7 +776,7 @@ We do not get a warning, but we do get distribute included in the working set:
... ])] ... ])]
['foox', 'distribute'] ['foox', 'distribute']
>>> print_(handler, end=' ') >>> print_(handler, end='')
We get the same behavior if the it is a depedency that uses a We get the same behavior if the it is a depedency that uses a
namespace package. namespace package.
...@@ -797,7 +797,7 @@ namespace package. ...@@ -797,7 +797,7 @@ namespace package.
... parts = ... parts =
... """) ... """)
>>> print_(system(join('bin', 'buildout')), end=' ') >>> print_(system(join('bin', 'buildout')), end='')
Develop: '/sample-buildout/foo' Develop: '/sample-buildout/foo'
Develop: '/sample-buildout/bar' Develop: '/sample-buildout/bar'
...@@ -809,7 +809,7 @@ namespace package. ...@@ -809,7 +809,7 @@ namespace package.
... ])] ... ])]
['bar', 'foox', 'distribute'] ['bar', 'foox', 'distribute']
>>> print_(handler, end=' ') >>> print_(handler, end='')
zc.buildout.easy_install WARNING zc.buildout.easy_install WARNING
Develop distribution: foox 0.0.0 Develop distribution: foox 0.0.0
uses namespace packages but the distribution does not require distribute. uses namespace packages but the distribution does not require distribute.
...@@ -900,7 +900,7 @@ Uninstall recipes need to be called when a part is removed too: ...@@ -900,7 +900,7 @@ Uninstall recipes need to be called when a part is removed too:
... recipe = recipes:demo ... recipe = recipes:demo
... ''') ... ''')
>>> print_(system(join('bin', 'buildout')), end=' ') >>> print_(system(join('bin', 'buildout')), end='')
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
Installing demo. Installing demo.
installing installing
...@@ -915,7 +915,7 @@ Uninstall recipes need to be called when a part is removed too: ...@@ -915,7 +915,7 @@ Uninstall recipes need to be called when a part is removed too:
... x = 1 ... x = 1
... ''') ... ''')
>>> print_(system(join('bin', 'buildout')), end=' ') >>> print_(system(join('bin', 'buildout')), end='')
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
Uninstalling demo. Uninstalling demo.
Running uninstall recipe. Running uninstall recipe.
...@@ -930,7 +930,7 @@ Uninstall recipes need to be called when a part is removed too: ...@@ -930,7 +930,7 @@ Uninstall recipes need to be called when a part is removed too:
... parts = ... parts =
... ''') ... ''')
>>> print_(system(join('bin', 'buildout')), end=' ') >>> print_(system(join('bin', 'buildout')), end='')
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
Uninstalling demo. Uninstalling demo.
Running uninstall recipe. Running uninstall recipe.
...@@ -970,7 +970,7 @@ def extensions_installed_as_eggs_work_in_offline_mode(): ...@@ -970,7 +970,7 @@ def extensions_installed_as_eggs_work_in_offline_mode():
... offline = true ... offline = true
... """) ... """)
>>> print_(system(join(sample_buildout, 'bin', 'buildout')), end=' ') >>> print_(system(join(sample_buildout, 'bin', 'buildout')), end='')
ext ['buildout'] ext ['buildout']
...@@ -1008,20 +1008,20 @@ changes in .svn or CVS directories. ...@@ -1008,20 +1008,20 @@ changes in .svn or CVS directories.
... ''') ... ''')
>>> print_(system(join(sample_buildout, 'bin', 'buildout')), end=' ') >>> print_(system(join(sample_buildout, 'bin', 'buildout')), end='')
Develop: '/sample-buildout/recipe' Develop: '/sample-buildout/recipe'
Installing foo. Installing foo.
>>> mkdir('recipe', '.svn') >>> mkdir('recipe', '.svn')
>>> mkdir('recipe', 'CVS') >>> mkdir('recipe', 'CVS')
>>> print_(system(join(sample_buildout, 'bin', 'buildout')), end=' ') >>> print_(system(join(sample_buildout, 'bin', 'buildout')), end='')
Develop: '/sample-buildout/recipe' Develop: '/sample-buildout/recipe'
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')), end=' ') >>> print_(system(join(sample_buildout, 'bin', 'buildout')), end='')
Develop: '/sample-buildout/recipe' Develop: '/sample-buildout/recipe'
Updating foo. Updating foo.
...@@ -1060,7 +1060,7 @@ because of the missing target file. ...@@ -1060,7 +1060,7 @@ because of the missing target file.
... ''') ... ''')
>>> print_(system(join(sample_buildout, 'bin', 'buildout')), end=' ') >>> print_(system(join(sample_buildout, 'bin', 'buildout')), end='')
Develop: '/sample-buildout/recipe' Develop: '/sample-buildout/recipe'
Installing foo. Installing foo.
...@@ -1077,7 +1077,7 @@ because of the missing target file. ...@@ -1077,7 +1077,7 @@ because of the missing target file.
>>> remove('recipe', 'some-file') >>> remove('recipe', 'some-file')
>>> print_(system(join(sample_buildout, 'bin', 'buildout')), end=' ') >>> print_(system(join(sample_buildout, 'bin', 'buildout')), end='')
Develop: '/sample-buildout/recipe' Develop: '/sample-buildout/recipe'
Updating foo. Updating foo.
...@@ -1085,7 +1085,7 @@ because of the missing target file. ...@@ -1085,7 +1085,7 @@ because of the missing target file.
def o_option_sets_offline(): def o_option_sets_offline():
""" """
>>> print_(system(join(sample_buildout, 'bin', 'buildout')+' -vvo'), end=' ') >>> print_(system(join(sample_buildout, 'bin', 'buildout')+' -vvo'), end='')
... # doctest: +ELLIPSIS ... # doctest: +ELLIPSIS
<BLANKLINE> <BLANKLINE>
... ...
...@@ -1140,7 +1140,7 @@ And update our buildout to use it. ...@@ -1140,7 +1140,7 @@ And update our buildout to use it.
... recipe = recipe ... recipe = recipe
... ''' % join('recipe', 'dist')) ... ''' % join('recipe', 'dist'))
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Getting distribution for 'recipe'. Getting distribution for 'recipe'.
Got recipe 1. Got recipe 1.
Installing foo. Installing foo.
...@@ -1174,19 +1174,19 @@ Now, if we update the recipe egg: ...@@ -1174,19 +1174,19 @@ Now, if we update the recipe egg:
We won't get the update if we specify -N: We won't get the update if we specify -N:
>>> print_(system(buildout+' -N'), end=' ') >>> print_(system(buildout+' -N'), end='')
Updating foo. Updating foo.
recipe v1 recipe v1
or if we use -o: or if we use -o:
>>> print_(system(buildout+' -o'), end=' ') >>> print_(system(buildout+' -o'), end='')
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), end=' ') >>> print_(system(buildout), end='')
Getting distribution for 'recipe'. Getting distribution for 'recipe'.
Got recipe 2. Got recipe 2.
Uninstalling foo. Uninstalling foo.
...@@ -1205,7 +1205,7 @@ We can also select a particular recipe version: ...@@ -1205,7 +1205,7 @@ We can also select a particular recipe version:
... recipe = recipe ==1 ... recipe = recipe ==1
... ''' % join('recipe', 'dist')) ... ''' % join('recipe', 'dist'))
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Uninstalling foo. Uninstalling foo.
Installing foo. Installing foo.
recipe v1 recipe v1
...@@ -1254,11 +1254,11 @@ uninstall ...@@ -1254,11 +1254,11 @@ uninstall
... recipe = recipe ... recipe = recipe
... ''') ... ''')
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Develop: '/sample-buildout/recipe' Develop: '/sample-buildout/recipe'
Installing foo. Installing foo.
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Develop: '/sample-buildout/recipe' Develop: '/sample-buildout/recipe'
Updating foo. Updating foo.
...@@ -1336,7 +1336,7 @@ def internal_errors(): ...@@ -1336,7 +1336,7 @@ def internal_errors():
... recipe = recipes:mkdir ... recipe = recipes:mkdir
... ''') ... ''')
>>> print_(system(buildout), end=' ') # doctest: +ELLIPSIS >>> print_(system(buildout), end='') # doctest: +ELLIPSIS
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
While: While:
Installing. Installing.
...@@ -1388,7 +1388,7 @@ def whine_about_unused_options(): ...@@ -1388,7 +1388,7 @@ def whine_about_unused_options():
... z = 1 ... z = 1
... """) ... """)
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Develop: '/sample-buildout/.' Develop: '/sample-buildout/.'
Unused options for buildout: 'a'. Unused options for buildout: 'a'.
Installing foo. Installing foo.
...@@ -1456,19 +1456,19 @@ Now let's look at 3 cases: ...@@ -1456,19 +1456,19 @@ Now let's look at 3 cases:
... recipe = recipes:clean ... recipe = recipes:clean
... ''') ... ''')
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
Installing p1. Installing p1.
Installing p2. Installing p2.
Installing p3. Installing p3.
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
Updating p1. Updating p1.
Updating p2. Updating p2.
Installing p3. Installing p3.
>>> print_(system(buildout+' buildout:parts='), end=' ') >>> print_(system(buildout+' buildout:parts='), end='')
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
Uninstalling p2. Uninstalling p2.
Uninstalling p1. Uninstalling p1.
...@@ -1494,20 +1494,20 @@ Now let's look at 3 cases: ...@@ -1494,20 +1494,20 @@ Now let's look at 3 cases:
... recipe = recipes:clean ... recipe = recipes:clean
... ''') ... ''')
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
Installing p1. Installing p1.
Installing p2. Installing p2.
Installing p3. Installing p3.
Installing p4. Installing p4.
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
Updating p1. Updating p1.
Updating p2. Updating p2.
Updating p3. Updating p3.
>>> print_(system(buildout+' buildout:parts='), end=' ') >>> print_(system(buildout+' buildout:parts='), end='')
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
Uninstalling p2. Uninstalling p2.
Uninstalling p1. Uninstalling p1.
...@@ -1535,7 +1535,7 @@ Now let's look at 3 cases: ...@@ -1535,7 +1535,7 @@ Now let's look at 3 cases:
... recipe = recipes:clean ... recipe = recipes:clean
... ''') ... ''')
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
Installing p1. Installing p1.
Installing p2. Installing p2.
...@@ -1562,7 +1562,7 @@ Now let's look at 3 cases: ...@@ -1562,7 +1562,7 @@ Now let's look at 3 cases:
... x = 1 ... x = 1
... ''') ... ''')
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
Uninstalling p4. Uninstalling p4.
Updating p1. Updating p1.
...@@ -1586,7 +1586,7 @@ Now let's look at 3 cases: ...@@ -1586,7 +1586,7 @@ Now let's look at 3 cases:
... recipe = recipes:clean ... recipe = recipes:clean
... ''') ... ''')
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
Uninstalling p1. Uninstalling p1.
Installing p1. Installing p1.
...@@ -1619,7 +1619,7 @@ def install_source_dist_with_bad_py(): ...@@ -1619,7 +1619,7 @@ def install_source_dist_with_bad_py():
... zip_safe=False) ... zip_safe=False)
... ''') ... ''')
>>> print_(system(buildout+' setup badegg sdist'), end=' ') # doctest: +ELLIPSIS >>> print_(system(buildout+' setup badegg sdist'), end='') # doctest: +ELLIPSIS
Running setup script 'badegg/setup.py'. Running setup script 'badegg/setup.py'.
... ...
...@@ -1703,7 +1703,7 @@ def bug_105081_Specific_egg_versions_are_ignored_when_newer_eggs_are_around(): ...@@ -1703,7 +1703,7 @@ def bug_105081_Specific_egg_versions_are_ignored_when_newer_eggs_are_around():
... eggs = demo ... eggs = demo
... ''' % globals()) ... ''' % globals())
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Installing x. Installing x.
Getting distribution for 'demo'. Getting distribution for 'demo'.
Got demo 0.4c1. Got demo 0.4c1.
...@@ -1711,7 +1711,7 @@ def bug_105081_Specific_egg_versions_are_ignored_when_newer_eggs_are_around(): ...@@ -1711,7 +1711,7 @@ def bug_105081_Specific_egg_versions_are_ignored_when_newer_eggs_are_around():
Got demoneeded 1.2c1. Got demoneeded 1.2c1.
Generated script '/sample-buildout/bin/demo'. Generated script '/sample-buildout/bin/demo'.
>>> print_(system(join('bin', 'demo')), end=' ') >>> print_(system(join('bin', 'demo')), end='')
4 2 4 2
>>> write('buildout.cfg', >>> write('buildout.cfg',
...@@ -1725,14 +1725,14 @@ def bug_105081_Specific_egg_versions_are_ignored_when_newer_eggs_are_around(): ...@@ -1725,14 +1725,14 @@ def bug_105081_Specific_egg_versions_are_ignored_when_newer_eggs_are_around():
... eggs = demo ==0.1 ... eggs = demo ==0.1
... ''' % globals()) ... ''' % globals())
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Uninstalling x. Uninstalling x.
Installing x. Installing x.
Getting distribution for 'demo==0.1'. Getting distribution for 'demo==0.1'.
Got demo 0.1. Got demo 0.1.
Generated script '/sample-buildout/bin/demo'. Generated script '/sample-buildout/bin/demo'.
>>> print_(system(join('bin', 'demo')), end=' ') >>> print_(system(join('bin', 'demo')), end='')
1 2 1 2
""" """
...@@ -1814,9 +1814,11 @@ def bug_59270_recipes_always_start_in_buildout_dir(): ...@@ -1814,9 +1814,11 @@ def bug_59270_recipes_always_start_in_buildout_dir():
>>> write('bad_recipe.py', >>> write('bad_recipe.py',
... r''' ... r'''
... import os, sys ... import os, sys
... def print_(*args):
... sys.stdout.write(' '.join(map(str, args)))
... class Bad: ... class Bad:
... def __init__(self, *_): ... def __init__(self, *_):
... print os.getcwd() ... print_(os.getcwd())
... def install(self): ... def install(self):
... sys.stdout.write(os.getcwd()+'\n') ... sys.stdout.write(os.getcwd()+'\n')
... os.chdir('bad_start') ... os.chdir('bad_start')
...@@ -1844,7 +1846,7 @@ def bug_59270_recipes_always_start_in_buildout_dir(): ...@@ -1844,7 +1846,7 @@ 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')), end=' ') ... +' -c '+join(sample_buildout, 'buildout.cfg')), end='')
Develop: '/sample-buildout/.' Develop: '/sample-buildout/.'
/sample-buildout /sample-buildout
/sample-buildout /sample-buildout
...@@ -1886,7 +1888,7 @@ def bug_61890_file_urls_dont_seem_to_work_in_find_dash_links(): ...@@ -1886,7 +1888,7 @@ def bug_61890_file_urls_dont_seem_to_work_in_find_dash_links():
def bug_75607_buildout_should_not_run_if_it_creates_an_empty_buildout_cfg(): def bug_75607_buildout_should_not_run_if_it_creates_an_empty_buildout_cfg():
""" """
>>> remove('buildout.cfg') >>> remove('buildout.cfg')
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
While: While:
Initializing. Initializing.
Error: Couldn't open /sample-buildout/buildout.cfg Error: Couldn't open /sample-buildout/buildout.cfg
...@@ -1927,7 +1929,7 @@ def dealing_with_extremely_insane_dependencies(): ...@@ -1927,7 +1929,7 @@ def dealing_with_extremely_insane_dependencies():
... eggs = pack0 ... eggs = pack0
... ''') ... ''')
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Develop: '/sample-buildout/pack0' Develop: '/sample-buildout/pack0'
Develop: '/sample-buildout/pack1' Develop: '/sample-buildout/pack1'
Develop: '/sample-buildout/pack2' Develop: '/sample-buildout/pack2'
...@@ -1943,7 +1945,7 @@ def dealing_with_extremely_insane_dependencies(): ...@@ -1943,7 +1945,7 @@ def dealing_with_extremely_insane_dependencies():
However, if we run in verbose mode, we can see why packages were included: However, if we run in verbose mode, we can see why packages were included:
>>> print_(system(buildout+' -v'), end=' ') # doctest: +ELLIPSIS >>> print_(system(buildout+' -v'), end='') # doctest: +ELLIPSIS
Installing 'zc.buildout', 'distribute'. Installing 'zc.buildout', 'distribute'.
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 'distribute'. We have the best distribution that satisfies 'distribute'.
...@@ -2008,7 +2010,7 @@ We'll create a wacky buildout extension that is just another name for http: ...@@ -2008,7 +2010,7 @@ We'll create a wacky buildout extension that is just another name for http:
... }, ... },
... ) ... )
... ''') ... ''')
>>> print_(system(buildout+' setup '+src+' bdist_egg'), end=' ') >>> print_(system(buildout+' setup '+src+' bdist_egg'), end='')
... # doctest: +ELLIPSIS ... # doctest: +ELLIPSIS
Running setup ... Running setup ...
creating 'dist/wackyextension-1-... creating 'dist/wackyextension-1-...
...@@ -2032,7 +2034,7 @@ Now we'll create a buildout that uses this extension to load other packages: ...@@ -2032,7 +2034,7 @@ Now we'll create a buildout that uses this extension to load other packages:
When we run the buildout. it will load the extension from the dist When we run the buildout. it will load the extension from the dist
directory and then use the wacky extension to load the demo package directory and then use the wacky extension to load the demo package
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Getting distribution for 'wackyextension'. Getting distribution for 'wackyextension'.
Got wackyextension 1. Got wackyextension 1.
Installing demo. Installing demo.
...@@ -2233,7 +2235,7 @@ The default is prefer-final = false: ...@@ -2233,7 +2235,7 @@ The default is prefer-final = false:
... eggs = demo ... eggs = demo
... ''' % globals()) ... ''' % globals())
>>> print_(system(buildout+' -v'), end=' ') # doctest: +ELLIPSIS >>> print_(system(buildout+' -v'), end='') # doctest: +ELLIPSIS
Installing 'zc.buildout', 'distribute'. Installing 'zc.buildout', 'distribute'.
... ...
Picked: demo = 0.4c1 Picked: demo = 0.4c1
...@@ -2255,7 +2257,7 @@ We get the same behavior if we add prefer-final = false ...@@ -2255,7 +2257,7 @@ We get the same behavior if we add prefer-final = false
... eggs = demo ... eggs = demo
... ''' % globals()) ... ''' % globals())
>>> print_(system(buildout+' -v'), end=' ') # doctest: +ELLIPSIS >>> print_(system(buildout+' -v'), end='') # doctest: +ELLIPSIS
Installing 'zc.buildout', 'distribute'. Installing 'zc.buildout', 'distribute'.
... ...
Picked: demo = 0.4c1 Picked: demo = 0.4c1
...@@ -2277,7 +2279,7 @@ distributions: ...@@ -2277,7 +2279,7 @@ distributions:
... eggs = demo ... eggs = demo
... ''' % globals()) ... ''' % globals())
>>> print_(system(buildout+' -v'), end=' ') # doctest: +ELLIPSIS >>> print_(system(buildout+' -v'), end='') # doctest: +ELLIPSIS
Installing 'zc.buildout', 'distribute'. Installing 'zc.buildout', 'distribute'.
... ...
Picked: demo = 0.3 Picked: demo = 0.3
...@@ -2298,7 +2300,7 @@ We get an error if we specify anything but true or false: ...@@ -2298,7 +2300,7 @@ We get an error if we specify anything but true or false:
... eggs = demo ... eggs = demo
... ''' % globals()) ... ''' % globals())
>>> print_(system(buildout+' -v'), end=' ') # doctest: +ELLIPSIS >>> print_(system(buildout+' -v'), end='') # doctest: +ELLIPSIS
While: While:
Initializing. Initializing.
Error: Invalid value for prefer-final option: no Error: Invalid value for prefer-final option: no
...@@ -2328,7 +2330,7 @@ Distribution setup scripts can import modules in the distribution directory: ...@@ -2328,7 +2330,7 @@ Distribution setup scripts can import modules in the distribution directory:
... parts = ... parts =
... ''') ... ''')
>>> print_(system(join('bin', 'buildout')), end=' ') >>> print_(system(join('bin', 'buildout')), end='')
Develop: '/sample-buildout/foo' Develop: '/sample-buildout/foo'
>>> ls('develop-eggs') >>> ls('develop-eggs')
...@@ -2369,7 +2371,7 @@ honoring our version specification. ...@@ -2369,7 +2371,7 @@ honoring our version specification.
... ''' % pkg_resources.working_set.find( ... ''' % pkg_resources.working_set.find(
... pkg_resources.Requirement.parse('distribute')).version) ... pkg_resources.Requirement.parse('distribute')).version)
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Installing foo. Installing foo.
Getting distribution for 'foo==1'. Getting distribution for 'foo==1'.
Got foo 1. Got foo 1.
...@@ -2400,7 +2402,7 @@ def pyc_and_pyo_files_have_correct_paths(): ...@@ -2400,7 +2402,7 @@ def pyc_and_pyo_files_have_correct_paths():
... sys.stdout.write(eggrecipedemoneeded.f.func_code.co_filename+'\n') ... sys.stdout.write(eggrecipedemoneeded.f.func_code.co_filename+'\n')
... ''') ... ''')
>>> print_(system(join('bin', 'py')+ ' t.py'), end=' ') >>> print_(system(join('bin', 'py')+ ' t.py'), end='')
/sample-buildout/eggs/demo-0.4c1-py2.4.egg/eggrecipedemo.py /sample-buildout/eggs/demo-0.4c1-py2.4.egg/eggrecipedemo.py
/sample-buildout/eggs/demoneeded-1.2c1-py2.4.egg/eggrecipedemoneeded.py /sample-buildout/eggs/demoneeded-1.2c1-py2.4.egg/eggrecipedemoneeded.py
...@@ -2423,7 +2425,7 @@ def dont_mess_with_standard_dirs_with_variable_refs(): ...@@ -2423,7 +2425,7 @@ def dont_mess_with_standard_dirs_with_variable_refs():
... eggs-directory = ${buildout:directory}/develop-eggs ... eggs-directory = ${buildout:directory}/develop-eggs
... parts = ... parts =
... ''' % globals()) ... ''' % globals())
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
""" """
...@@ -2454,7 +2456,7 @@ def expand_shell_patterns_in_develop_paths(): ...@@ -2454,7 +2456,7 @@ def expand_shell_patterns_in_develop_paths():
We can see that both eggs were found: We can see that both eggs were found:
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Develop: '/sample-buildout/sampley' Develop: '/sample-buildout/sampley'
Develop: '/sample-buildout/samplez' Develop: '/sample-buildout/samplez'
Installing eggs. Installing eggs.
...@@ -2486,7 +2488,7 @@ def warn_users_when_expanding_shell_patterns_yields_no_results(): ...@@ -2486,7 +2488,7 @@ def warn_users_when_expanding_shell_patterns_yields_no_results():
We should get one of the eggs, and a warning for the pattern that We should get one of the eggs, and a warning for the pattern that
did not match anything. did not match anything.
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Develop: '/sample-buildout/samplea' Develop: '/sample-buildout/samplea'
Couldn't develop '/sample-buildout/grumble*' (not found) Couldn't develop '/sample-buildout/grumble*' (not found)
Installing eggs. Installing eggs.
...@@ -2541,7 +2543,7 @@ def increment_buildout_options(): ...@@ -2541,7 +2543,7 @@ def increment_buildout_options():
... <= p1 ... <= p1
... ''') ... ''')
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Installing p1. Installing p1.
foo='1\n2 b' foo='1\n2 b'
recipe='zc.buildout:debug' recipe='zc.buildout:debug'
...@@ -2581,7 +2583,7 @@ def increment_buildout_with_multiple_extended_files_421022(): ...@@ -2581,7 +2583,7 @@ def increment_buildout_with_multiple_extended_files_421022():
... x = ${buildout:bar-option} ${buildout:foo-option} ... x = ${buildout:bar-option} ${buildout:foo-option}
... ''') ... ''')
>>> print_(system(buildout), end=' ') >>> print_(system(buildout), end='')
Installing p. Installing p.
recipe='zc.buildout:debug' recipe='zc.buildout:debug'
x='bar\nbaz foo\nham' x='bar\nbaz foo\nham'
...@@ -2608,7 +2610,7 @@ def increment_on_command_line(): ...@@ -2608,7 +2610,7 @@ def increment_on_command_line():
... <= p1 ... <= p1
... ''') ... ''')
>>> print_(system(buildout+' buildout:parts+=p2 p1:foo+=bar'), end=' ') >>> print_(system(buildout+' buildout:parts+=p2 p1:foo+=bar'), end='')
Installing p1. Installing p1.
foo='1 a\nb\nbar' foo='1 a\nb\nbar'
recipe='zc.buildout:debug' recipe='zc.buildout:debug'
...@@ -2828,8 +2830,10 @@ def makeNewRelease(project, ws, dest, version='99.99'): ...@@ -2828,8 +2830,10 @@ def makeNewRelease(project, ws, dest, version='99.99'):
zip = zipfile.ZipFile(dest, 'a') zip = zipfile.ZipFile(dest, 'a')
zip.writestr( zip.writestr(
'EGG-INFO/PKG-INFO', 'EGG-INFO/PKG-INFO',
zip.read('EGG-INFO/PKG-INFO').replace("Version: %s" % oldver, ((zip.read('EGG-INFO/PKG-INFO').decode()
).replace("Version: %s" % oldver,
"Version: %s" % version) "Version: %s" % version)
).encode()
) )
zip.close() zip.close()
else: else:
...@@ -2983,6 +2987,9 @@ def test_suite(): ...@@ -2983,6 +2987,9 @@ def test_suite():
checker=renormalizing.RENormalizing([ checker=renormalizing.RENormalizing([
zc.buildout.testing.normalize_path, zc.buildout.testing.normalize_path,
zc.buildout.testing.normalize_endings, zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_exception_type_for_python_2_and_3,
(re.compile('zc.buildout.buildout.MissingOption'),
'MissingOption'),
(re.compile(r'\S+buildout.py'), 'buildout.py'), (re.compile(r'\S+buildout.py'), 'buildout.py'),
(re.compile(r'line \d+'), 'line NNN'), (re.compile(r'line \d+'), 'line NNN'),
(re.compile(r'py\(\d+\)'), 'py(NNN)'), (re.compile(r'py\(\d+\)'), 'py(NNN)'),
...@@ -3040,6 +3047,7 @@ def test_suite(): ...@@ -3040,6 +3047,7 @@ def test_suite():
tearDown=zc.buildout.testing.buildoutTearDown, tearDown=zc.buildout.testing.buildoutTearDown,
optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS, optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS,
checker=renormalizing.RENormalizing([ checker=renormalizing.RENormalizing([
zc.buildout.testing.normalize_exception_type_for_python_2_and_3,
(re.compile(' at -?0x[^>]+'), '<MEM ADDRESS>'), (re.compile(' at -?0x[^>]+'), '<MEM ADDRESS>'),
(re.compile('http://localhost:[0-9]{4,5}/'), (re.compile('http://localhost:[0-9]{4,5}/'),
'http://localhost/'), 'http://localhost/'),
......
...@@ -35,7 +35,7 @@ zc.buildout used: ...@@ -35,7 +35,7 @@ zc.buildout used:
... """ ... """
... import pkg_resources ... import pkg_resources
... import sys ... import sys
... print_ = lambda *a: sys.stdout.write(' '.join(map(str, a))+'\n') ... print_ = lambda *a: sys.stdout.write(' '.join(map(str, a))+'\\n')
... ...
... class Recipe: ... class Recipe:
... ...
...@@ -66,15 +66,18 @@ Now if we run the buildout, the buildout will upgrade itself to the ...@@ -66,15 +66,18 @@ 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), end='') >>> print_(system(buildout), end='')
Getting distribution for 'zc.buildout'.
Got zc.buildout 99.99.
Getting distribution for 'distribute'. Getting distribution for 'distribute'.
Got distribute 99.99. Got distribute 99.99.
Upgraded: Upgraded:
zc.buildout version 99.99,
distribute version 99.99; distribute version 99.99;
restarting. restarting.
Generated script '/sample-buildout/bin/buildout'. Generated script '/sample-buildout/bin/buildout'.
Develop: '/sample-buildout/showversions' Develop: '/sample-buildout/showversions'
Installing show-versions. Installing show-versions.
zc.buildout 1.4.4 zc.buildout 99.99
distribute 99.99 distribute 99.99
Our buildout script has been updated to use the new eggs: Our buildout script has been updated to use the new eggs:
...@@ -84,7 +87,7 @@ Our buildout script has been updated to use the new eggs: ...@@ -84,7 +87,7 @@ Our buildout script has been updated to use the new eggs:
<BLANKLINE> <BLANKLINE>
import sys import sys
sys.path[0:0] = [ sys.path[0:0] = [
'/sample-buildout/eggs/zc.buildout-1.4.4-py2.4.egg', '/sample-buildout/eggs/zc.buildout-99.99-py2.4.egg',
'/sample-buildout/eggs/distribute-99.99-py2.4.egg', '/sample-buildout/eggs/distribute-99.99-py2.4.egg',
] ]
<BLANKLINE> <BLANKLINE>
...@@ -115,6 +118,7 @@ Now we can see that we actually "upgrade" to an earlier version. ...@@ -115,6 +118,7 @@ Now we can see that we actually "upgrade" to an earlier version.
>>> print_(system(buildout), end='') >>> print_(system(buildout), end='')
Upgraded: Upgraded:
zc.buildout version 1.4.4;
distribute version 0.6; distribute version 0.6;
restarting. restarting.
Generated script '/sample-buildout/bin/buildout'. Generated script '/sample-buildout/bin/buildout'.
...@@ -140,7 +144,7 @@ We won't upgrade in offline mode: ...@@ -140,7 +144,7 @@ We won't upgrade in offline mode:
... recipe = showversions ... recipe = showversions
... """ % dict(new_releases=new_releases)) ... """ % dict(new_releases=new_releases))
>>> print_(system(buildout+' -o'), ed='') >>> print_(system(buildout+' -o'), end='')
Develop: '/sample-buildout/showversions' Develop: '/sample-buildout/showversions'
Updating show-versions. Updating show-versions.
zc.buildout 1.0.0 zc.buildout 1.0.0
...@@ -173,6 +177,8 @@ directory: ...@@ -173,6 +177,8 @@ directory:
Creating directory '/sample_buildout2/parts'. Creating directory '/sample_buildout2/parts'.
Creating directory '/sample_buildout2/eggs'. Creating directory '/sample_buildout2/eggs'.
Creating directory '/sample_buildout2/develop-eggs'. Creating directory '/sample_buildout2/develop-eggs'.
Getting distribution for 'zc.buildout'.
Got zc.buildout 99.99.
Getting distribution for 'distribute'. Getting distribution for 'distribute'.
Got distribute 99.99. Got distribute 99.99.
Not upgrading because not running a local buildout command. Not upgrading because not running a local buildout command.
......
...@@ -25,7 +25,7 @@ index ...@@ -25,7 +25,7 @@ index
We have a link server that has a number of distributions: We have a link server that has a number of distributions:
>>> print get(link_server), >>> print_(get(link_server), end='')
<html><body> <html><body>
<a href="bigdemo-0.1-py2.3.egg">bigdemo-0.1-py2.3.egg</a><br> <a href="bigdemo-0.1-py2.3.egg">bigdemo-0.1-py2.3.egg</a><br>
<a href="demo-0.1-py2.3.egg">demo-0.1-py2.3.egg</a><br> <a href="demo-0.1-py2.3.egg">demo-0.1-py2.3.egg</a><br>
...@@ -62,7 +62,7 @@ specified where to find distributions using the find-links option. ...@@ -62,7 +62,7 @@ specified where to find distributions using the find-links option.
Let's run the buildout: Let's run the buildout:
>>> import os >>> import os
>>> print system(buildout), >>> print_(system(buildout), end='')
Installing demo. Installing demo.
Getting distribution for 'demo<0.3'. Getting distribution for 'demo<0.3'.
Got demo 0.2. Got demo 0.2.
...@@ -106,7 +106,7 @@ scripts recipe: ...@@ -106,7 +106,7 @@ scripts recipe:
... index = %(server)s/index ... index = %(server)s/index
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print_(system(buildout), end='')
Uninstalling demo. Uninstalling demo.
Installing demo. Installing demo.
Generated script '/sample-buildout/bin/demo'. Generated script '/sample-buildout/bin/demo'.
...@@ -186,7 +186,7 @@ Note that we ommitted the entry point name from the recipe ...@@ -186,7 +186,7 @@ Note that we ommitted the entry point name from the recipe
specification. We were able to do this because the scripts recipe is specification. We were able to do this because the scripts recipe is
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), end='')
Uninstalling demo. Uninstalling demo.
Installing demo. Installing demo.
Generated script '/sample-buildout/bin/demo'. Generated script '/sample-buildout/bin/demo'.
...@@ -203,20 +203,20 @@ This is useful for debugging and testing. ...@@ -203,20 +203,20 @@ This is useful for debugging and testing.
If we run the demo script, it prints out some minimal data: If we run the demo script, it prints out some minimal data:
>>> print system(join(sample_buildout, 'bin', 'demo')), >>> print_(system(join(sample_buildout, 'bin', 'demo')), end='')
2 2 2 2
The value it prints out happens to be some values defined in the The value it prints out happens to be some values defined in the
modules installed. modules installed.
We can also run the py-demo script. Here we'll just print out We can also run the py-demo script. Here we'll just print_(out)
the bits if the path added to reflect the eggs: the bits if the path added to reflect the eggs:
>>> print system(join(sample_buildout, 'bin', 'py-demo'), >>> print_(system(join(sample_buildout, 'bin', 'py-demo'), end='')
... """import os, sys ... """import os, sys
... for p in sys.path: ... for p in sys.path:
... if 'demo' in p: ... if 'demo' in p:
... print os.path.basename(p) ... print_(os.path.basename(p))
... ...
... """).replace('>>> ', '').replace('... ', ''), ... """).replace('>>> ', '').replace('... ', ''),
... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE ... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
...@@ -244,7 +244,7 @@ remove the restriction on demo: ...@@ -244,7 +244,7 @@ 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'), end='')
Uninstalling demo. Uninstalling demo.
Installing demo. Installing demo.
Generated script '/sample-buildout/bin/demo'. Generated script '/sample-buildout/bin/demo'.
...@@ -255,7 +255,7 @@ reinstalled. ...@@ -255,7 +255,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'), end='')
Updating demo. Updating demo.
We didn't get an update for demo: We didn't get an update for demo:
...@@ -269,7 +269,7 @@ We didn't get an update for demo: ...@@ -269,7 +269,7 @@ We didn't get an update for demo:
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), end='')
Updating demo. Updating demo.
Getting distribution for 'demo'. Getting distribution for 'demo'.
Got demo 0.4c1. Got demo 0.4c1.
...@@ -286,7 +286,7 @@ Then we'll get a new demo egg: ...@@ -286,7 +286,7 @@ Then we'll get a new demo egg:
The script is updated too: The script is updated too:
>>> print system(join(sample_buildout, 'bin', 'demo')), >>> print_(system(join(sample_buildout, 'bin', 'demo')), end='')
4 2 4 2
Controlling script generation Controlling script generation
...@@ -309,7 +309,7 @@ arguments: ...@@ -309,7 +309,7 @@ arguments:
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print_(system(buildout), end='')
Uninstalling demo. Uninstalling demo.
Installing demo. Installing demo.
...@@ -330,7 +330,7 @@ You can also control the name used for scripts: ...@@ -330,7 +330,7 @@ You can also control the name used for scripts:
... scripts = demo=foo ... scripts = demo=foo
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print_(system(buildout), end='')
Uninstalling demo. Uninstalling demo.
Installing demo. Installing demo.
Generated script '/sample-buildout/bin/foo'. Generated script '/sample-buildout/bin/foo'.
...@@ -360,7 +360,7 @@ extra-paths option: ...@@ -360,7 +360,7 @@ extra-paths option:
... ${buildout:directory}/spam ... ${buildout:directory}/spam
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print_(system(buildout), end='')
Uninstalling demo. Uninstalling demo.
Installing demo. Installing demo.
Generated script '/sample-buildout/bin/foo'. Generated script '/sample-buildout/bin/foo'.
...@@ -407,7 +407,7 @@ breaking scripts. ...@@ -407,7 +407,7 @@ breaking scripts.
... ${buildout:directory}/spam ... ${buildout:directory}/spam
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print_(system(buildout), end='')
Uninstalling demo. Uninstalling demo.
Installing demo. Installing demo.
Generated script '/sample-buildout/bin/foo'. Generated script '/sample-buildout/bin/foo'.
...@@ -456,7 +456,7 @@ each individual script section: ...@@ -456,7 +456,7 @@ each individual script section:
... ${buildout:directory}/spam ... ${buildout:directory}/spam
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print_(system(buildout), end='')
Uninstalling demo. Uninstalling demo.
Installing demo. Installing demo.
Generated script '/sample-buildout/bin/foo'. Generated script '/sample-buildout/bin/foo'.
...@@ -509,7 +509,7 @@ to be included in generated scripts: ...@@ -509,7 +509,7 @@ to be included in generated scripts:
... arguments = a, 2 ... arguments = a, 2
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print_(system(buildout), end='')
Uninstalling demo. Uninstalling demo.
Installing demo. Installing demo.
Generated script '/sample-buildout/bin/foo'. Generated script '/sample-buildout/bin/foo'.
...@@ -559,7 +559,7 @@ declare entry points using the entry-points option: ...@@ -559,7 +559,7 @@ declare entry points using the entry-points option:
... entry-points = alt=eggrecipedemo:alt other=foo.bar:a.b.c ... entry-points = alt=eggrecipedemo:alt other=foo.bar:a.b.c
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print_(system(buildout), end='')
Uninstalling demo. Uninstalling demo.
Installing demo. Installing demo.
Generated script '/sample-buildout/bin/demo'. Generated script '/sample-buildout/bin/demo'.
...@@ -606,7 +606,7 @@ generate all scripts in required packages: ...@@ -606,7 +606,7 @@ generate all scripts in required packages:
... index = %(server)s/index ... index = %(server)s/index
... dependent-scripts = true ... dependent-scripts = true
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout+' -N'), >>> print_(system(buildout+' -N'), end='')
Uninstalling demo. Uninstalling demo.
Installing bigdemo. Installing bigdemo.
Getting distribution for 'bigdemo'. Getting distribution for 'bigdemo'.
...@@ -631,7 +631,7 @@ be made to contact an index server: ...@@ -631,7 +631,7 @@ be made to contact an index server:
... scripts = demo=foo ... scripts = demo=foo
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print_(system(buildout), end='')
Uninstalling bigdemo. Uninstalling bigdemo.
Installing demo. Installing demo.
Generated script '/sample-buildout/bin/foo'. Generated script '/sample-buildout/bin/foo'.
...@@ -17,9 +17,12 @@ around the egg recipe: ...@@ -17,9 +17,12 @@ around the egg recipe:
>>> mkdir(sample_buildout, 'sample') >>> mkdir(sample_buildout, 'sample')
>>> write(sample_buildout, 'sample', 'sample.py', >>> write(sample_buildout, 'sample', 'sample.py',
... """ ... """
... import logging, os ... import logging, os, sys
... import zc.recipe.egg ... import zc.recipe.egg
... ...
... def print_(*args):
... sys.stdout.write(' '.join(map(str, args)))
...
... class Sample: ... class Sample:
... ...
... def __init__(self, buildout, name, options): ... def __init__(self, buildout, name, options):
...@@ -30,14 +33,14 @@ around the egg recipe: ...@@ -30,14 +33,14 @@ around the egg recipe:
... def install(self): ... def install(self):
... extras = self.options['extras'].split() ... extras = self.options['extras'].split()
... requirements, ws = self.egg.working_set(extras) ... requirements, ws = self.egg.working_set(extras)
... print 'Part:', self.name ... print_('Part:', self.name)
... print 'Egg requirements:' ... print_('Egg requirements:')
... for r in requirements: ... for r in requirements:
... print r ... print_(r)
... print 'Working set:' ... print_('Working set:')
... for d in ws: ... for d in ws:
... print d ... print_(d)
... print 'extra paths:', self.egg.extra_paths ... print_('extra paths:', self.egg.extra_paths)
... return () ... return ()
... ...
... update = install ... update = install
...@@ -81,7 +84,7 @@ of extra requirements to be included in the working set. ...@@ -81,7 +84,7 @@ of extra requirements to be included in the working set.
>>> import os >>> import os
>>> 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 + ' -q'), >>> print_(system(buildout + ' -q'), end='')
Part: sample-part Part: sample-part
Egg requirements: Egg requirements:
demo<0.3 demo<0.3
...@@ -139,7 +142,7 @@ If we use the extra-paths option: ...@@ -139,7 +142,7 @@ If we use the extra-paths option:
Then we'll see that reflected in the extra_paths attribute in the egg Then we'll see that reflected in the extra_paths attribute in the egg
recipe instance: recipe instance:
>>> print system(buildout + ' -q'), >>> print_(system(buildout + ' -q'), end='')
Part: sample-part Part: sample-part
Egg requirements: Egg requirements:
demo<0.3 demo<0.3
......
...@@ -131,7 +131,7 @@ the egg: ...@@ -131,7 +131,7 @@ the egg:
... ...
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print_(system(buildout), end='')
Installing extdemo. Installing extdemo.
zip_safe flag not set; analyzing archive contents... zip_safe flag not set; analyzing archive contents...
...@@ -156,9 +156,11 @@ Let's define a script that uses out ext demo: ...@@ -156,9 +156,11 @@ Let's define a script that uses out ext demo:
>>> mkdir('demo') >>> mkdir('demo')
>>> write('demo', 'demo.py', >>> write('demo', 'demo.py',
... """ ... """
... import extdemo ... import extdemo, sys
... def print_(*args):
... sys.stdout.write(' '.join(map(str, args)))
... def main(): ... def main():
... print extdemo.val ... print_(extdemo.val)
... """) ... """)
>>> write('demo', 'setup.py', >>> write('demo', 'setup.py',
...@@ -187,7 +189,7 @@ Let's define a script that uses out ext demo: ...@@ -187,7 +189,7 @@ Let's define a script that uses out ext demo:
... entry-points = demo=demo:main ... entry-points = demo=demo:main
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print_(system(buildout), end='')
Develop: '/sample-buildout/demo' Develop: '/sample-buildout/demo'
Updating extdemo. Updating extdemo.
Installing demo. Installing demo.
...@@ -195,7 +197,7 @@ Let's define a script that uses out ext demo: ...@@ -195,7 +197,7 @@ Let's define a script that uses out ext demo:
When we run the script, we'll 42 printed: When we run the script, we'll 42 printed:
>>> print system(join('bin', 'demo')), >>> print_(system(join('bin', 'demo')), end='')
42 42
Updating Updating
...@@ -210,12 +212,12 @@ distribution for extdemo: ...@@ -210,12 +212,12 @@ 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'), end='')
Develop: '/sample-buildout/demo' Develop: '/sample-buildout/demo'
Updating extdemo. Updating extdemo.
Updating demo. Updating demo.
>>> print system(buildout+' -o'), >>> print_(system(buildout+' -o'), end='')
Develop: '/sample-buildout/demo' Develop: '/sample-buildout/demo'
Updating extdemo. Updating extdemo.
Updating demo. Updating demo.
...@@ -231,7 +233,7 @@ But if we run the buildout in the default on-line and newest modes, we ...@@ -231,7 +233,7 @@ But if we run the buildout in the default on-line and newest modes, we
will. This time we also get the test-variable message again, because the new will. This time we also get the test-variable message again, because the new
version is imported: version is imported:
>>> print system(buildout), >>> print_(system(buildout), end='')
Develop: '/sample-buildout/demo' Develop: '/sample-buildout/demo'
Updating extdemo. Updating extdemo.
zip_safe flag not set; analyzing archive contents... zip_safe flag not set; analyzing archive contents...
...@@ -269,7 +271,7 @@ We can specify a specific version using the egg option: ...@@ -269,7 +271,7 @@ We can specify a specific version using the egg option:
... entry-points = demo=demo:main ... entry-points = demo=demo:main
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout+' -D'), >>> print_(system(buildout+' -D'), end='')
Develop: '/sample-buildout/demo' Develop: '/sample-buildout/demo'
Uninstalling demo. Uninstalling demo.
Uninstalling extdemo. Uninstalling extdemo.
...@@ -345,7 +347,7 @@ Create our buildout: ...@@ -345,7 +347,7 @@ Create our buildout:
... recipe = recipes:environ ... recipe = recipes:environ
... ...
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print_(system(buildout), end='')
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
Uninstalling demo. Uninstalling demo.
Uninstalling extdemo. Uninstalling extdemo.
...@@ -365,7 +367,7 @@ the original value will be restored: ...@@ -365,7 +367,7 @@ the original value will be restored:
>>> import os >>> import os
>>> os.environ['test-variable'] = 'bar' >>> os.environ['test-variable'] = 'bar'
>>> print system(buildout), >>> print_(system(buildout), end='')
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
Updating extdemo. Updating extdemo.
Updating checkenv. Updating checkenv.
...@@ -399,7 +401,7 @@ are interpolated with os.environ before the're set: ...@@ -399,7 +401,7 @@ are interpolated with os.environ before the're set:
... recipe = recipes:environ ... recipe = recipes:environ
... ...
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print_(system(buildout), end='')
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
Uninstalling extdemo. Uninstalling extdemo.
Installing extdemo. Installing extdemo.
...@@ -428,7 +430,7 @@ Create a clean buildout.cfg w/o the checkenv recipe, and delete the recipe: ...@@ -428,7 +430,7 @@ Create a clean buildout.cfg w/o the checkenv recipe, and delete the recipe:
... include-dirs = include ... include-dirs = include
... ...
... """ % dict(server=link_server)) ... """ % dict(server=link_server))
>>> print system(buildout), >>> print_(system(buildout), end='')
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
Uninstalling checkenv. Uninstalling checkenv.
Uninstalling extdemo. Uninstalling extdemo.
...@@ -529,7 +531,7 @@ Note that we added a define option to cause the preprocessor variable ...@@ -529,7 +531,7 @@ Note that we added a define option to cause the preprocessor variable
TWO to be defined. This will cause the module-variable, 'val', to be 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), end='')
Develop: '/sample-buildout/demo' Develop: '/sample-buildout/demo'
Uninstalling extdemo. Uninstalling extdemo.
Installing extdemo. Installing extdemo.
...@@ -558,5 +560,5 @@ and the extdemo now has a built extension: ...@@ -558,5 +560,5 @@ and the extdemo now has a built extension:
Because develop eggs take precedence over non-develop eggs, the demo Because develop eggs take precedence over non-develop eggs, the demo
script will use the new develop egg: script will use the new develop egg:
>>> print system(join('bin', 'demo')), >>> print_(system(join('bin', 'demo')), end='')
2 2
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