Commit 3bc9d21c authored by jim's avatar jim

Added an upload entry point for extensions.

Also fixed some spurious failures in the bootstrap test.


git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@101154 62d5b8a3-27da-0310-9561-8e5933582275
parent ea56fd86
Change History
**************
1.2.2 (unreleased)
1.2.2 (2009-06-19)
==================
- Better Windows compatibility in test infrastructure.
......@@ -16,6 +16,8 @@ Change History
- fixed usage of 'relative_paths' keyword parameter on Windows
- Added an unload entry point for extensions.
1.2.1 (2009-03-18)
==================
......
......@@ -59,12 +59,7 @@ Let's try with an unknown version::
X
No local packages or download links found for zc.buildout==UNKNOWN
error: Could not find suitable distribution for Requirement.parse('zc.buildout==UNKNOWN')
Traceback (most recent call last):
File "bootstrap.py", line 78, in <module>
) == 0
AssertionError
<BLANKLINE>
X
...
Now let's try with `1.1.2`, which happens to exist::
......
This diff is collapsed.
......@@ -2368,15 +2368,17 @@ parts:
Extensions
----------
An **experimental** feature allows code to be loaded and run after
A feature allows code to be loaded and run after
configuration files have been read but before the buildout has begun
any processing. The intent is to allow special plugins such as
urllib2 request handlers to be loaded.
To load an extension, we use the extensions option and list one or
more distribution requirements, on separate lines. The distributions
named will be loaded and any zc.buildout.extensions entry points found
will be called with the buildout as an argument.
named will be loaded and any ``zc.buildout.extension`` entry points found
will be called with the buildout as an argument. When buildout
finishes processing, any ``zc.buildout.unloadextension`` entry points
found will be called with the buildout as an argument.
Let's create a sample extension in our sample buildout created in the
previous section:
......@@ -2387,6 +2389,8 @@ previous section:
... """
... def ext(buildout):
... print 'ext', list(buildout)
... def unload(buildout):
... print 'unload', list(buildout)
... """)
>>> write(sample_bootstrapped, 'demo', 'setup.py',
......@@ -2395,7 +2399,10 @@ previous section:
...
... setup(
... name = "demo",
... entry_points = {'zc.buildout.extension': ['ext = demo:ext']},
... entry_points = {
... 'zc.buildout.extension': ['ext = demo:ext'],
... 'zc.buildout.unloadextension': ['ext = demo:unload'],
... },
... )
... """)
......@@ -2436,6 +2443,7 @@ We see that our extension is loaded and executed:
>>> print system(os.path.join(sample_bootstrapped, 'bin', 'buildout')),
ext ['buildout']
Develop: '/sample-bootstrapped/demo'
unload ['buildout']
Allow hosts
-----------
......
......@@ -2895,6 +2895,7 @@ def test_suite():
zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_script,
normalize_bang,
(re.compile('Downloading.*setuptools.*egg\n'), ''),
]),
))
......
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