Commit 1409c372 authored by Gary Poster's avatar Gary Poster

tests pass on Py 2.7

parent 7fe1f4a7
......@@ -6,6 +6,8 @@ Change History
New Features:
- zc.buildout supports Python 2.7.
- Added buildout:socket-timout option so that socket timeout can be configured
both from command line and from config files. (gotcha)
......@@ -45,8 +47,8 @@ New Features:
- You can develop zc.buildout using Distribute instead of Setuptools. Use
the --distribute option on the dev.py script. (Releases should be tested
with both Distribute and Setuptools.) The tests for zc.buildout pass
with Setuptools and Python 2.4, 2.5, and 2.6; and with Distribute and
Python 2.5 and 2.6. Using zc.buildout with Distribute and Python 2.4
with Setuptools and Python 2.4, 2.5, 2.6, and 2.7; and with Distribute and
Python 2.5, 2.6, and 2.7. Using zc.buildout with Distribute and Python 2.4
is not recommended.
- The ``distribute-version`` now works in the [buildout] section, mirroring
......
......@@ -2,14 +2,14 @@ Allow hosts
-----------
On some environments the links visited by `zc.buildout` can be forbidden
by paranoiac firewalls. These URL might be on the chain of links
by paranoiac firewalls. These URL might be on the chain of links
visited by `zc.buildout` whether they are defined in the `find-links` option
or by various eggs in their `url`, `download_url` and `dependency_links` metadata.
It is even harder to track that package_index works like a spider and
It is even harder to track that package_index works like a spider and
might visit links and go to other location.
The `allow-hosts` option provides a way to prevent this, and
The `allow-hosts` option provides a way to prevent this, and
works exactly like the one provided in `easy_install`
(see `easy_install allow-hosts option`_).
......@@ -17,7 +17,7 @@ You can provide a list of allowed host, together with wildcards::
[buildout]
...
allow-hosts =
*.python.org
example.com
......@@ -36,7 +36,7 @@ Let's create a develop egg in our buildout that specifies
... zip_safe=True, version='1')
... ''')
Now let's configure the buildout to use the develop egg,
Now let's configure the buildout to use the develop egg,
together with some rules that disallow any website but PyPI and
local files::
......@@ -55,14 +55,11 @@ local files::
Now we can run the buildout and make sure all attempts to dist.plone.org fails::
>>> print system(buildout)
>>> print system(buildout) # doctest: +ELLIPSIS
Develop: '/sample-buildout/allowdemo'
Installing eggs.
<BLANKLINE>
...
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:
Installing eggs.
Getting distribution for 'kss.core'.
......@@ -91,14 +88,11 @@ XXX (showcase with a svn:// file)
Now we can run the buildout and make sure all attempts to dist.plone.org fails::
>>> print system(buildout)
>>> print system(buildout) # doctest: +ELLIPSIS
Develop: '/sample-buildout/allowdemo'
Installing eggs.
<BLANKLINE>
...
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:
Installing eggs.
Getting distribution for 'kss.core'.
......@@ -115,7 +109,7 @@ Test for 1.0.5 breakage as in https://bugs.launchpad.net/zc.buildout/+bug/239212
... [buildout]
... parts=python
... foo = ${python:interpreter}
...
...
... [python]
... recipe=zc.recipe.egg
... eggs=zc.buildout
......
......@@ -52,11 +52,11 @@ Now we will try the `--version` option, which lets you define a version for
Let's try with an unknown version::
>>> print 'X'; print system(
>>> print 'XX'; print system(
... zc.buildout.easy_install._safe_arg(sys.executable)+' '+
... 'bootstrap.py --version UNKNOWN'); print 'X' # doctest: +ELLIPSIS
...
X
X...
No local packages or download links found for zc.buildout==UNKNOWN...
...
......@@ -128,8 +128,7 @@ option::
...
X
...
Generated script '/sample/bin/buildout'.
<BLANKLINE>
Generated script '/sample/bin/buildout'...
X
Let's make sure the generated `buildout` script uses it::
......@@ -158,8 +157,7 @@ Make sure both options can be used together::
...
X
...
Generated script '/sample/bin/buildout'.
<BLANKLINE>
Generated script '/sample/bin/buildout'...
X
Let's make sure the generated `buildout` script uses ``Distribute`` *and*
......@@ -192,8 +190,7 @@ Last, the -c option needs to work on bootstrap.py::
...
X
...
Generated script '/sample/bin/buildout'.
<BLANKLINE>
Generated script '/sample/bin/buildout'...
X
You can specify a location of ez_setup.py or distribute_setup, so you
......
......@@ -20,7 +20,7 @@ testing repository.
Turn on logging on this server so that we can see when eggs are pulled
from it.
>>> get(link_server2 + 'enable_server_logging')
GET 200 /enable_server_logging
''
......@@ -83,10 +83,9 @@ buildout to see where the egg comes from this time.
... for egg in glob(join(sample_buildout, 'eggs', 'demoneeded*.egg')):
... remove(sample_buildout, 'eggs', egg)
>>> remove_demoneeded_egg()
>>> print system(buildout)
>>> print system(buildout) # doctest: +ELLIPSIS
Develop: '/sample-buildout/depdemo'
Updating eggs.
Couldn't find index page for 'demoneeded' (maybe misspelled?)
...
Getting distribution for 'demoneeded'.
While:
Updating eggs.
......
......@@ -3718,7 +3718,18 @@ normalize_bang = (
)
hide_distribute_additions = (re.compile('install_dir .+\n'), '')
hide_zip_safe_message = (
# This comes in a different place in the output in Python 2.7. It's not
# important to our tests. Hide it.
re.compile(
'((?<=\n)\n)?zip_safe flag not set; analyzing archive contents...\n'),
'')
hide_first_index_page_message = (
# This comes in a different place in the output in Python 2.7. It's not
# important to our tests. Hide it.
re.compile(
"Couldn't find index page for '[^']+' \(maybe misspelled\?\)\n"),
'')
def test_suite():
test_suite = [
doctest.DocFileSuite(
......@@ -3731,6 +3742,7 @@ def test_suite():
zc.buildout.testing.normalize_script,
zc.buildout.testing.normalize_egg_py,
zc.buildout.tests.hide_distribute_additions,
hide_zip_safe_message,
(re.compile('__buildout_signature__ = recipes-\S+'),
'__buildout_signature__ = recipes-SSSSSSSSSSS'),
(re.compile('executable = [\S ]+python\S*', re.I),
......@@ -3809,6 +3821,7 @@ def test_suite():
zc.buildout.testing.normalize_script,
zc.buildout.testing.normalize_egg_py,
normalize_bang,
hide_first_index_page_message,
zc.buildout.tests.hide_distribute_additions,
(re.compile('extdemo[.]pyd'), 'extdemo.so'),
(re.compile('[-d] (setuptools|distribute)-\S+[.]egg'),
......@@ -3852,6 +3865,7 @@ def test_suite():
zc.buildout.testing.normalize_script,
zc.buildout.testing.normalize_egg_py,
zc.buildout.tests.hide_distribute_additions,
hide_first_index_page_message,
(re.compile("buildout: Running \S*setup.py"),
'buildout: Running setup.py'),
(re.compile('(setuptools|distribute)-\S+-'),
......@@ -3910,7 +3924,17 @@ def test_suite():
])
),
doctest.DocFileSuite(
'testing_bugfix.txt'),
'testing_bugfix.txt',
checker=renormalizing.RENormalizing([
# Python 2.7
(re.compile(
re.escape(
'testrunner.logsupport.NullHandler instance at')),
'testrunner.logsupport.NullHandler object at'),
(re.compile(re.escape('logging.StreamHandler instance at')),
'logging.StreamHandler object at'),
])
),
]
# adding bootstrap.txt doctest to the suite
......
......@@ -422,6 +422,7 @@ def test_suite():
zc.buildout.testing.normalize_egg_py,
zc.buildout.tests.normalize_bang,
zc.buildout.tests.hide_distribute_additions,
zc.buildout.tests.hide_first_index_page_message,
(re.compile(r'zc.buildout(-\S+)?[.]egg(-link)?'),
'zc.buildout.egg'),
(re.compile('[-d] (setuptools|distribute)-[^-]+-'), 'setuptools-X-'),
......@@ -444,6 +445,7 @@ def test_suite():
zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_egg_py,
zc.buildout.tests.hide_distribute_additions,
zc.buildout.tests.hide_first_index_page_message,
(re.compile(r'[a-zA-Z]:\\\\foo\\\\bar'), '/foo/bar'),
]),
),
......
......@@ -85,15 +85,16 @@ def test_suite():
'custom.txt',
setUp=setUp, tearDown=zc.buildout.testing.buildoutTearDown,
checker=renormalizing.RENormalizing([
zc.buildout.testing.normalize_path,
zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_path,
zc.buildout.testing.normalize_endings,
zc.buildout.tests.hide_distribute_additions,
(re.compile("(d ((ext)?demo(needed)?|other)"
"-\d[.]\d-py)\d[.]\d(-\S+)?[.]egg"),
'\\1V.V.egg'),
(re.compile('extdemo.c\n.+\\extdemo.exp\n'), ''),
(re.compile('extdemo[.]pyd'), 'extdemo.so')
]),
zc.buildout.tests.hide_zip_safe_message,
(re.compile("(d ((ext)?demo(needed)?|other)"
"-\d[.]\d-py)\d[.]\d(-\S+)?[.]egg"),
'\\1V.V.egg'),
(re.compile('extdemo.c\n.+\\extdemo.exp\n'), ''),
(re.compile('extdemo[.]pyd'), 'extdemo.so')
]),
),
))
......
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